Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 PR/52382: BERTRAND Joel: Fix mapped IPv4 source...



details:   https://anonhg.NetBSD.org/src/rev/1258a6a852e4
branches:  trunk
changeset: 826303:1258a6a852e4
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Aug 27 12:34:21 2017 +0000

description:
PR/52382: BERTRAND Joel: Fix mapped IPv4 source selection; this got broken
in the last code refactoring. in6_selectif failing is not fatal.
XXX: pullup-8

diffstat:

 sys/netinet6/in6_src.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (48 lines):

diff -r 3e7e23a1810e -r 1258a6a852e4 sys/netinet6/in6_src.c
--- a/sys/netinet6/in6_src.c    Sun Aug 27 11:44:49 2017 +0000
+++ b/sys/netinet6/in6_src.c    Sun Aug 27 12:34:21 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_src.c,v 1.79 2017/02/17 03:57:17 ozaki-r Exp $     */
+/*     $NetBSD: in6_src.c,v 1.80 2017/08/27 12:34:21 christos Exp $    */
 /*     $KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $     */
 
 /*
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.79 2017/02/17 03:57:17 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.80 2017/08/27 12:34:21 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -461,7 +461,7 @@
        struct in6_ifaddr *ia = NULL;
        struct in6_pktinfo *pi = NULL;
        u_int32_t odstzone;
-       int error;
+       int error = 0, iferror;
 #if defined(MIP6) && NMIP > 0
        u_int8_t ip6po_usecoa = 0;
 #endif /* MIP6 && NMIP > 0 */
@@ -484,7 +484,7 @@
         * to this function (e.g., for identifying the appropriate scope zone
         * ID).
         */
-       error = in6_selectif(dstsock, opts, mopts, ro, &ifp, PSREF);
+       iferror = in6_selectif(dstsock, opts, mopts, ro, &ifp, PSREF);
        if (ifpp != NULL)
                *ifpp = ifp;
 
@@ -549,8 +549,10 @@
         * The outgoing interface is crucial in the general selection procedure
         * below.  If it is not known at this point, we fail.
         */
-       if (ifp == NULL)
+       if (ifp == NULL) {
+               error = iferror;
                goto exit;
+       }
 
        /*
         * If the address is not yet determined, choose the best one based on



Home | Main Index | Thread Index | Old Index