Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 backout change to in6_pcbnotify(). the change ...



details:   https://anonhg.NetBSD.org/src/rev/db7aa59104cb
branches:  trunk
changeset: 487260:db7aa59104cb
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Jun 05 08:09:48 2000 +0000

description:
backout change to in6_pcbnotify().  the change seems premature
(may cause trouble with advanced API in certain situation).

diffstat:

 sys/netinet6/in6_pcb.c |  23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diffs (58 lines):

diff -r 16bfd20519e8 -r db7aa59104cb sys/netinet6/in6_pcb.c
--- a/sys/netinet6/in6_pcb.c    Mon Jun 05 07:59:50 2000 +0000
+++ b/sys/netinet6/in6_pcb.c    Mon Jun 05 08:09:48 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_pcb.c,v 1.24 2000/06/05 06:38:23 itojun Exp $      */
+/*     $NetBSD: in6_pcb.c,v 1.25 2000/06/05 08:09:48 itojun Exp $      */
 /*     $KAME: in6_pcb.c,v 1.45 2000/06/05 00:41:58 itojun Exp $        */
 
 /*
@@ -536,7 +536,9 @@
        u_int16_t fport = fport_arg, lport = lport_arg;
        int errno;
        int nmatch = 0;
-       int do_rtchange = (notify == in6_rtchange);
+       void (*notify2) __P((struct in6pcb *, int));
+
+       notify2 = NULL;
 
        if ((unsigned)cmd > PRC_NCMDS || dst->sa_family != AF_INET6)
                return 0;
@@ -557,7 +559,14 @@
                lport = 0;
                bzero((caddr_t)laddr6, sizeof(*laddr6));
 
-               do_rtchange = 1;
+               /*
+                * Keep the old notify function to store a soft error
+                * in each PCB.
+                */
+               if (cmd == PRC_HOSTDEAD && notify != in6_rtchange)
+                       notify2 = notify;
+
+               notify = in6_rtchange;
        }
 
        if (notify == NULL)
@@ -567,7 +576,7 @@
        for (in6p = head->in6p_next; in6p != head; in6p = nin6p) {
                nin6p = in6p->in6p_next;
 
-               if (do_rtchange) {
+               if (notify == in6_rtchange) {
                        /*
                         * Since a non-connected PCB might have a cached route,
                         * we always call in6_rtchange without matching
@@ -579,8 +588,10 @@
                                               &faddr6))
                                in6_rtchange(in6p, errno);
 
-                       if (notify == in6_rtchange)
-                               continue; /* there's nothing to do any more */
+                       if (notify2 == NULL)
+                               continue;
+
+                       notify = notify2;
                }
 
                /* at this point, we can assume that NOTIFY is not NULL. */



Home | Main Index | Thread Index | Old Index