Source-Changes-HG archive

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

[src/trunk]: src/sys/net PR kern/51280



details:   https://anonhg.NetBSD.org/src/rev/9f37414743d1
branches:  trunk
changeset: 821559:9f37414743d1
user:      kre <kre%NetBSD.org@localhost>
date:      Thu Feb 09 11:43:32 2017 +0000

description:
PR kern/51280

This allows srt devices to work for IPv6.   srt still needs work
(particularly #ifdef INET6 but also general effeciency and similar.)

diffstat:

 sys/net/if_srt.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r e992b551d26d -r 9f37414743d1 sys/net/if_srt.c
--- a/sys/net/if_srt.c  Thu Feb 09 09:30:26 2017 +0000
+++ b/sys/net/if_srt.c  Thu Feb 09 11:43:32 2017 +0000
@@ -1,8 +1,8 @@
-/* $NetBSD: if_srt.c,v 1.24 2017/01/14 16:34:44 maya Exp $ */
+/* $NetBSD: if_srt.c,v 1.25 2017/02/09 11:43:32 kre Exp $ */
 /* This file is in the public domain. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.24 2017/01/14 16:34:44 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.25 2017/02/09 11:43:32 kre Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -35,6 +35,9 @@
 #include <sys/device.h>
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
+#include <netinet6/in6_var.h>
+#include <netinet6/nd6.h>
+#include <netinet6/scope6_var.h>
 #include <net/if_types.h>
 
 #include "if_srt.h"
@@ -236,6 +239,8 @@
                return 0; /* XXX ENETDOWN? */
        }
        /* XXX is 0 the right last arg here? */
+       if (to->sa_family == AF_INET6)
+               return nd6_output(r->u.dstifp, r->u.dstifp, m, &r->dst.sin6, 0);
        return if_output_lock(r->u.dstifp, r->u.dstifp, m, &r->dst.sa, 0);
 }
 
@@ -466,6 +471,8 @@
                scr->srcmask = dr->srcmask;
                scr->u.dstifp = ifp;
                memcpy(&scr->dst,&dr->dst,dr->dst.sa.sa_len);
+               if (dr->af == AF_INET6)
+                       in6_setzoneid(&scr->dst.sin6.sin6_addr, ifp->if_index);
                update_mtu(sc);
                return 0;
        case SRT_DELRT:



Home | Main Index | Thread Index | Old Index