diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-03-22 03:48:31 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-03-22 03:48:31 +0000 |
commit | 3286d6b6e228d4fc5d1dc8f1cedab7d76d8b6149 (patch) | |
tree | acdf536b6eb5e392d41e02c2d8f878504de038a7 | |
parent | b3d7365d989e56c12d526e2d8f15e10b8debac9d (diff) |
comment out ifconfig undo code. they are necessary to avoid memory
leakage, however, was too strict that they disallow multiple address
from same prefix to be assigned (when rtinit returns EEXIST).
we'll need to improve it.
-rw-r--r-- | sys/netinet/in.c | 13 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 15 |
2 files changed, 25 insertions, 3 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 0f02f4c916a..a18d81295b1 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.16 2000/03/12 06:46:31 itojun Exp $ */ +/* $OpenBSD: in.c,v 1.17 2000/03/22 03:48:30 itojun Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -352,6 +352,14 @@ in_control(so, cmd, data, ifp) case SIOCSIFADDR: error = in_ifinit(ifp, ia, satosin(&ifr->ifr_addr), 1); +#if 0 + /* + * the code chokes if we are to assign multiple addresses with + * the same address prefix (rtinit() will return EEXIST, which + * is not fatal actually). we will get memory leak if we + * don't do it. + * -> we may want to hide EEXIST from rtinit(). + */ undo: if (error && newifaddr){ TAILQ_REMOVE(&ifp->if_addrlist, &ia->ia_ifa, ifa_list); @@ -360,6 +368,7 @@ in_control(so, cmd, data, ifp) if ((ifp->if_flags & IFF_LOOPBACK) == 0) in_interfaces--; } +#endif return error; case SIOCSIFNETMASK: @@ -394,8 +403,10 @@ in_control(so, cmd, data, ifp) if (ifra->ifra_addr.sin_family == AF_INET && (hostIsNew || maskIsNew)) { error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0); +#if 0 if (error) goto undo; +#endif } if ((ifp->if_flags & IFF_BROADCAST) && (ifra->ifra_broadaddr.sin_family == AF_INET)) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 296eacb83b3..5e1930cb4e9 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,5 +1,5 @@ -/* $OpenBSD: in6.c,v 1.16 2000/03/12 06:16:58 itojun Exp $ */ -/* $KAME: in6.c,v 1.55 2000/02/25 00:32:23 itojun Exp $ */ +/* $OpenBSD: in6.c,v 1.17 2000/03/22 03:48:30 itojun Exp $ */ +/* $KAME: in6.c,v 1.63 2000/03/21 05:18:38 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -628,6 +628,14 @@ in6_control(so, cmd, data, ifp, p) case SIOCSIFADDR_IN6: error = in6_ifinit(ifp, ia, &ifr->ifr_addr, 1); +#if 0 + /* + * the code chokes if we are to assign multiple addresses with + * the same address prefix (rtinit() will return EEXIST, which + * is not fatal actually). we will get memory leak if we + * don't do it. + * -> we may want to hide EEXIST from rtinit(). + */ undo: if (error && newifaddr) { TAILQ_REMOVE(&ifp->if_addrlist, &ia->ia_ifa, ifa_list); @@ -648,6 +656,7 @@ in6_control(so, cmd, data, ifp, p) } IFAFREE(&ia->ia_ifa); } +#endif return error; #ifdef COMPAT_IN6IFIOCTL /* XXX should be unused */ @@ -730,8 +739,10 @@ in6_control(so, cmd, data, ifp, p) } if (hostIsNew || prefixIsNew) { error = in6_ifinit(ifp, ia, &ifra->ifra_addr, 0); +#if 0 if (error) goto undo; +#endif } if (hostIsNew && (ifp->if_flags & IFF_MULTICAST)) { int error_local = 0; |