ifconfig: remove undocumented -carpdev

2015-12-30 Thread Fabian Raetz
Hi,

please find below a patch to remove the undocumented -carpdev command from
ifconfig(8).

Cheers,
Fabian


Index: ifconfig.c
===
RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
retrieving revision 1.311
diff -u -p -r1.311 ifconfig.c
--- ifconfig.c  10 Dec 2015 17:26:59 -  1.311
+++ ifconfig.c  30 Dec 2015 11:07:40 -
@@ -236,7 +236,6 @@ voidsetcarp_passwd(const char *, int);
 void   setcarp_vhid(const char *, int);
 void   setcarp_state(const char *, int);
 void   setcarpdev(const char *, int);
-void   unsetcarpdev(const char *, int);
 void   setcarp_nodes(const char *, int);
 void   setcarp_balancing(const char *, int);
 void   setpfsync_syncdev(const char *, int);
@@ -395,7 +394,6 @@ const structcmd {
{ "carpdev",NEXTARG,0,  setcarpdev },
{ "carpnodes",  NEXTARG,0,  setcarp_nodes },
{ "balancing",  NEXTARG,0,  setcarp_balancing },
-   { "-carpdev",   1,  0,  unsetcarpdev },
{ "syncdev",NEXTARG,0,  setpfsync_syncdev },
{ "-syncdev",   1,  0,  unsetpfsync_syncdev },
{ "syncif", NEXTARG,0,  setpfsync_syncdev },
@@ -4008,23 +4006,6 @@ setcarpdev(const char *val, int d)
err(1, "SIOCGVH");
 
strlcpy(carpr.carpr_carpdev, val, sizeof(carpr.carpr_carpdev));
-
-   if (ioctl(s, SIOCSVH, (caddr_t)) == -1)
-   err(1, "SIOCSVH");
-}
-
-void
-unsetcarpdev(const char *val, int d)
-{
-   struct carpreq carpr;
-
-   bzero(, sizeof(struct carpreq));
-   ifr.ifr_data = (caddr_t)
-
-   if (ioctl(s, SIOCGVH, (caddr_t)) == -1)
-   err(1, "SIOCGVH");
-
-   bzero(_carpdev, sizeof(carpr.carpr_carpdev));
 
if (ioctl(s, SIOCSVH, (caddr_t)) == -1)
err(1, "SIOCSVH");



Re: ifconfig: remove undocumented -carpdev

2015-12-30 Thread Sebastian Benoit
Fabian Raetz(fabian.ra...@gmail.com) on 2015.12.30 13:32:54 +0100:
> On Wed, Dec 30, 2015 at 07:24:01AM -0500, Ted Unangst wrote:
> > Fabian Raetz wrote:
> > > Hi,
> > > 
> > > please find below a patch to remove the undocumented -carpdev command from
> > > ifconfig(8).
> > 
> > wouldn't it make more sense to document the command?
> 
> as the command is broken [0] and nobody noticed it so far, i'm
> wondering if anybody needs -carpdev
> 
> [0] https://www.marc.info/?l=openbsd-tech=145147632420539=2

-carpdev was valid back when you did not have to specify the device. Until
some time ago there was magic that chose the parent dev based on the ip on
the carp - the idea was that it must be in the same net as the parent.

This was removed (by mpi i think) to reduce complexety. So now you always
have to specify the carpdev.

I believe the option can go.



Re: ifconfig: remove undocumented -carpdev

2015-12-30 Thread Fabian Raetz
On Wed, Dec 30, 2015 at 07:24:01AM -0500, Ted Unangst wrote:
> Fabian Raetz wrote:
> > Hi,
> > 
> > please find below a patch to remove the undocumented -carpdev command from
> > ifconfig(8).
> 
> wouldn't it make more sense to document the command?

as the command is broken [0] and nobody noticed it so far, i'm
wondering if anybody needs -carpdev

[0] https://www.marc.info/?l=openbsd-tech=145147632420539=2



Re: ifconfig: remove undocumented -carpdev

2015-12-30 Thread Ted Unangst
Fabian Raetz wrote:
> Hi,
> 
> please find below a patch to remove the undocumented -carpdev command from
> ifconfig(8).

wouldn't it make more sense to document the command?