Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 restore previous logic.



details:   https://anonhg.NetBSD.org/src/rev/79562a9d145b
branches:  trunk
changeset: 348637:79562a9d145b
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 31 14:34:32 2016 +0000

description:
restore previous logic.

diffstat:

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

diffs (45 lines):

diff -r f432f5a13d43 -r 79562a9d145b sys/netinet6/in6_pcb.c
--- a/sys/netinet6/in6_pcb.c    Mon Oct 31 12:49:04 2016 +0000
+++ b/sys/netinet6/in6_pcb.c    Mon Oct 31 14:34:32 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_pcb.c,v 1.151 2016/10/31 04:16:25 ozaki-r Exp $    */
+/*     $NetBSD: in6_pcb.c,v 1.152 2016/10/31 14:34:32 christos Exp $   */
 /*     $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $        */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.151 2016/10/31 04:16:25 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.152 2016/10/31 14:34:32 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -534,21 +534,22 @@
                error = in6_selectsrc(sin6, in6p->in6p_outputopts,
                    in6p->in6p_moptions, &in6p->in6p_route, &in6p->in6p_laddr,
                    &ifp, &psref, &ia6);
+               if (error == 0)
+                       in6a = &ia6;
                if (ifp && scope_ambiguous &&
                    (error = in6_setscope(&sin6->sin6_addr, ifp, NULL)) != 0) {
                        if_put(ifp, &psref);
                        curlwp_bindx(bound);
-                       return(error);
+                       return error;
                }
 
-               if (error != 0) {
+               if (in6a == NULL) {
                        if_put(ifp, &psref);
                        curlwp_bindx(bound);
                        if (error == 0)
                                error = EADDRNOTAVAIL;
-                       return (error);
+                       return error;
                }
-               in6a = &ia6;
        }
 
        if (ifp != NULL) {



Home | Main Index | Thread Index | Old Index