-/* $OpenBSD: if.c,v 1.287 2014/05/05 11:44:33 mpi Exp $ */
+/* $OpenBSD: if.c,v 1.288 2014/05/13 14:33:25 claudio Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
struct ifgroupreq *ifgr;
char ifdescrbuf[IFDESCRSIZE];
char ifrtlabelbuf[RTLABEL_LEN];
- int s, error = 0;
+ int s, error = 0, needsadd;
size_t bytesdone;
short oif_flags;
const char *label;
/* remove all routing entries when switching domains */
/* XXX hell this is ugly */
+ needsadd = 0;
if (ifr->ifr_rdomainid != ifp->if_rdomain) {
s = splnet();
if (ifp->if_flags & IFF_UP)
* of the lookup key and re-add it after the switch.
*/
ifa_del(ifp, ifp->if_lladdr);
+ needsadd = 1;
splx(s);
}
ifp->if_rdomain = ifr->ifr_rdomainid;
/* re-add sadl to the ifa RB tree in new rdomain */
- ifa_add(ifp, ifp->if_lladdr);
+ if (needsadd)
+ ifa_add(ifp, ifp->if_lladdr);
break;
case SIOCAIFGROUP: