On 30/12/15(Wed) 12:51, Fabian Raetz wrote: > Hi tech@, > > i've found the undocumented -carpdev option in ifconfig(8) which freezes > my sytem if executed. > > As the -carpdev option is undocumented in both ifconfig(8) and carp(4) i > propose two patches to remove this functionality. > > The patch below will return EINVAL in SIOCSVH if carpr.carpr_carpdev is not a > valid interface name.
Did you try this diff? The SIOCGVH ioctl(2) is not always issued with carpr_carpdev set, so this will break your system. > I will send another patch to @tech to remove -carpdev from ifconfig(8) > > Cheers, > Fabian > > > Index: ip_carp.c > =================================================================== > RCS file: /cvs/src/sys/netinet/ip_carp.c,v > retrieving revision 1.284 > diff -u -p -r1.284 ip_carp.c > --- ip_carp.c 19 Dec 2015 11:19:35 -0000 1.284 > +++ ip_carp.c 30 Dec 2015 11:31:57 -0000 > @@ -2022,8 +2022,7 @@ carp_ioctl(struct ifnet *ifp, u_long cmd > if ((error = copyin(ifr->ifr_data, &carpr, sizeof carpr))) > break; > error = 1; > - if (carpr.carpr_carpdev[0] != '\0' && > - (ifp0 = ifunit(carpr.carpr_carpdev)) == NULL) > + if ((ifp0 = ifunit(carpr.carpr_carpdev)) == NULL) > return (EINVAL); > if (carpr.carpr_peer.s_addr == 0) > sc->sc_peer.s_addr = INADDR_CARP_GROUP; >