Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ifconfig: remove undocumented -carpdev

7 views
Skip to first unread message

Fabian Raetz

unread,
Dec 30, 2015, 6:54:20 AM12/30/15
to te...@openbsd.org
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 -0000 1.311
+++ ifconfig.c 30 Dec 2015 11:07:40 -0000
@@ -236,7 +236,6 @@ void setcarp_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 struct cmd {
{ "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)&ifr) == -1)
- err(1, "SIOCSVH");
-}
-
-void
-unsetcarpdev(const char *val, int d)
-{
- struct carpreq carpr;
-
- bzero(&carpr, sizeof(struct carpreq));
- ifr.ifr_data = (caddr_t)&carpr;
-
- if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
-
- bzero(&carpr.carpr_carpdev, sizeof(carpr.carpr_carpdev));

if (ioctl(s, SIOCSVH, (caddr_t)&ifr) == -1)
err(1, "SIOCSVH");

Ted Unangst

unread,
Dec 30, 2015, 7:25:30 AM12/30/15
to Fabian Raetz, te...@openbsd.org
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?

Fabian Raetz

unread,
Dec 30, 2015, 7:37:41 AM12/30/15
to Ted Unangst, te...@openbsd.org
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&m=145147632420539&w=2

Sebastian Benoit

unread,
Dec 30, 2015, 8:42:52 AM12/30/15
to Fabian Raetz, Ted Unangst, te...@openbsd.org
Fabian Raetz(fabian...@gmail.com) on 2015.12.30 13:32:54 +0100:
-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.

Claudio Jeker

unread,
Dec 30, 2015, 10:22:17 AM12/30/15
to te...@openbsd.org, Fabian Raetz, Ted Unangst
Yes, the replacement command is 'ifconfig carp0 destroy && ifconfig carp0
up'.

--
:wq Claudio

0 new messages