Module Name:    src
Committed By:   riastradh
Date:           Sat Mar  9 13:55:28 UTC 2024

Modified Files:
        src/sys/net: if_tun.c

Log Message:
tun(4): Allow IPv6 packets with TUNSLMODE configured.

PR kern/58013


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/net/if_tun.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if_tun.c
diff -u src/sys/net/if_tun.c:1.174 src/sys/net/if_tun.c:1.175
--- src/sys/net/if_tun.c:1.174	Fri Dec 29 23:01:02 2023
+++ src/sys/net/if_tun.c	Sat Mar  9 13:55:27 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.174 2023/12/29 23:01:02 chs Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.175 2024/03/09 13:55:27 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions <j...@cs.nott.ac.uk>
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.174 2023/12/29 23:01:02 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.175 2024/03/09 13:55:27 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -604,9 +604,7 @@ tun_output(struct ifnet *ifp, struct mbu
 				goto out;
 			}
 			memcpy(mtod(m0, char *), dst, dst->sa_len);
-		}
-
-		if (tp->tun_flags & TUN_IFHEAD) {
+		} else if (tp->tun_flags & TUN_IFHEAD) {
 			/* Prepend the address family */
 			M_PREPEND(m0, sizeof(*af), M_DONTWAIT);
 			if (m0 == NULL) {

Reply via email to