Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys #if 0'ed undo code for interface address addition failure.



details:   https://anonhg.NetBSD.org/src/rev/6afb0b43fd29
branches:  trunk
changeset: 483769:6afb0b43fd29
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sat Mar 18 02:41:58 2000 +0000

description:
#if 0'ed undo code for interface address addition failure.
it was a bit too strong, and forbids multiple addresses from
same prefix to be assigned.

now the behavior is the same as previous - memory leak on interface address
addition failure.
http://orange.kame.net/dev/query-pr.cgi?pr=218

diffstat:

 sys/netinet/in.c   |  6 +++++-
 sys/netinet6/in6.c |  6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diffs (72 lines):

diff -r 7989dd9ac60c -r 6afb0b43fd29 sys/netinet/in.c
--- a/sys/netinet/in.c  Sat Mar 18 00:39:49 2000 +0000
+++ b/sys/netinet/in.c  Sat Mar 18 02:41:58 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in.c,v 1.56 2000/03/12 05:01:16 itojun Exp $   */
+/*     $NetBSD: in.c,v 1.57 2000/03/18 02:41:58 itojun Exp $   */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -476,6 +476,7 @@
 
        case SIOCSIFADDR:
                error = in_ifinit(ifp, ia, satosin(&ifr->ifr_addr), 1);
+#if 0
   undo:
                if (error && newifaddr) {
                        TAILQ_REMOVE(&ifp->if_addrlist, &ia->ia_ifa, ifa_list);
@@ -485,6 +486,7 @@
                        if ((ifp->if_flags & IFF_LOOPBACK) == 0)
                                in_interfaces--;
                }
+#endif
                return error;
 
        case SIOCSIFNETMASK:
@@ -518,8 +520,10 @@
                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 -r 7989dd9ac60c -r 6afb0b43fd29 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c        Sat Mar 18 00:39:49 2000 +0000
+++ b/sys/netinet6/in6.c        Sat Mar 18 02:41:58 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6.c,v 1.24 2000/03/12 05:23:07 itojun Exp $  */
+/*     $NetBSD: in6.c,v 1.25 2000/03/18 02:41:59 itojun Exp $  */
 /*     $KAME: in6.c,v 1.56 2000/03/02 07:11:00 itojun Exp $    */
 
 /*
@@ -644,6 +644,7 @@
 
        case SIOCSIFADDR_IN6:
                error = in6_ifinit(ifp, ia, &ifr->ifr_addr, 1);
+#if 0
   undo:
                if (error && newifaddr) {
                        TAILQ_REMOVE(&ifp->if_addrlist, &ia->ia_ifa, ifa_list);
@@ -664,6 +665,7 @@
                        }
                        IFAFREE(&ia->ia_ifa);
                }
+#endif
                return error;
 
 #ifdef COMPAT_IN6IFIOCTL               /* XXX should be unused */
@@ -746,8 +748,10 @@
                }
                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;



Home | Main Index | Thread Index | Old Index