Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet backout 1.72. it is not correct for the kernel ...



details:   https://anonhg.NetBSD.org/src/rev/90e9ef82a892
branches:  trunk
changeset: 526715:90e9ef82a892
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu May 09 06:49:15 2002 +0000

description:
backout 1.72.  it is not correct for the kernel to remove routes by itself,
and the code was buggy (dereferenced null pointer when IFAFREE removes the
route).

diffstat:

 sys/netinet/in.c |  29 ++---------------------------
 1 files changed, 2 insertions(+), 27 deletions(-)

diffs (70 lines):

diff -r e489719218f5 -r 90e9ef82a892 sys/netinet/in.c
--- a/sys/netinet/in.c  Thu May 09 05:31:13 2002 +0000
+++ b/sys/netinet/in.c  Thu May 09 06:49:15 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in.c,v 1.75 2002/03/30 00:40:32 itojun Exp $   */
+/*     $NetBSD: in.c,v 1.76 2002/05/09 06:49:15 itojun Exp $   */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -102,7 +102,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.75 2002/03/30 00:40:32 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.76 2002/05/09 06:49:15 itojun Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet_conf.h"
@@ -136,7 +136,6 @@
 static void in_len2mask __P((struct in_addr *, int));
 static int in_lifaddr_ioctl __P((struct socket *, u_long, caddr_t,
        struct ifnet *, struct proc *));
-static int in_rt_walktree __P((struct radix_node *, void *));
 
 static int in_addprefix __P((struct in_ifaddr *, int));
 static int in_scrubprefix __P((struct in_ifaddr *));
@@ -541,32 +540,12 @@
        return (0);
 }
 
-static int
-in_rt_walktree(rn, v)
-       struct radix_node *rn;
-       void *v;
-{
-       struct in_ifaddr *ia = (struct in_ifaddr *)v;
-       struct rtentry *rt = (struct rtentry *)rn;
-       int error;
-
-       if (rt->rt_ifa == &ia->ia_ifa) {
-               if ((error = rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway,
-                   rt_mask(rt), rt->rt_flags, NULL)) != 0) {
-                       log(LOG_WARNING, "ifa_rt_walktree: unable to delete "
-                           "rtentry. error= %d", error);
-               }
-       }
-       return 0;
-}
-
 void
 in_purgeaddr(ifa, ifp)
        struct ifaddr *ifa;
        struct ifnet *ifp;
 {
        struct in_ifaddr *ia = (void *) ifa;
-       struct radix_node_head *rnh;
 
        in_ifscrub(ifp, ia);
        LIST_REMOVE(ia, ia_hash);
@@ -583,10 +562,6 @@
            ifp->if_output != if_nulloutput)
                in_savemkludge(ia);
        IFAFREE(&ia->ia_ifa);
-
-       if ((rnh = rt_tables[AF_INET]) != NULL)
-               (*rnh->rnh_walktree)(rnh, in_rt_walktree, ifa);
-
        in_setmaxmtu();
 }
 



Home | Main Index | Thread Index | Old Index