Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 31 20:20:22 UTC 2020

Modified Files:
        src/share/man/man4: wg.4
        src/sys/net: if_wg.c

Log Message:
wg: Remove IFF_POINTOPOINT.

Unclear why this was set; setting it seems to have required a kludge
in netinet/in.c that broke ipsec tunnels.  Clearing it makes wg work
again after that kludge was reverted.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/wg.4
cvs rdiff -u -r1.32 -r1.33 src/sys/net/if_wg.c

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

Modified files:

Index: src/share/man/man4/wg.4
diff -u src/share/man/man4/wg.4:1.5 src/share/man/man4/wg.4:1.6
--- src/share/man/man4/wg.4:1.5	Wed Aug 26 16:03:41 2020
+++ src/share/man/man4/wg.4	Mon Aug 31 20:20:22 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: wg.4,v 1.5 2020/08/26 16:03:41 riastradh Exp $
+.\"	$NetBSD: wg.4,v 1.6 2020/08/31 20:20:22 riastradh Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -38,8 +38,8 @@
 .Sh DESCRIPTION
 The
 .Nm
-interface implements a point-to-point roaming-capable virtual private
-network tunnel, configured with
+interface implements a roaming-capable virtual private network tunnel,
+configured with
 .Xr ifconfig 8
 and
 .Xr wgconfig 8 .
@@ -117,8 +117,9 @@ A# wgconfig wg0 add peer B \e
     --allowed-ips=10.0.1.1/32
 A# ifconfig wg0 up
 A# ifconfig wg0
-wg0: flags=0x51<UP,POINTOPOINT,RUNNING> mtu 1420
-        inet 10.0.1.0/24 ->  flags 0
+wg0: flags=0x8041<UP,RUNNING,MULTICAST> mtu 1420
+        inet 10.0.1.0/24 flags 0
+        inet6 fe80::22f7:d6ff:fe3a:1e60%wg0/64 flags 0 scopeid 0x3
 .Ed
 .Pp
 Configure B to connect to A at 1.2.3.4 on port 1234 and the packets can
@@ -132,8 +133,9 @@ B# wgconfig wg0 add peer A \e
     --endpoint=1.2.3.4:1234
 B# ifconfig wg0 up
 B# ifconfig wg0
-wg0: flags=0x51<UP,POINTOPOINT,RUNNING> mtu 1420
-        inet 10.0.1.1/24 ->  flags 0
+wg0: flags=0x8041<UP,RUNNING,MULTICAST> mtu 1420
+        inet 10.0.1.1/24 flags 0
+        inet6 fe80::56eb:59ff:fe3d:d413%wg0/64 flags 0 scopeid 0x3
 B# ping -n 10.0.1.0
 PING 10.0.1.0 (10.0.1.0): 56 data bytes
 64 bytes from 10.0.1.0: icmp_seq=0 ttl=255 time=2.721110 ms

Index: src/sys/net/if_wg.c
diff -u src/sys/net/if_wg.c:1.32 src/sys/net/if_wg.c:1.33
--- src/sys/net/if_wg.c:1.32	Fri Aug 28 07:03:08 2020
+++ src/sys/net/if_wg.c	Mon Aug 31 20:20:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wg.c,v 1.32 2020/08/28 07:03:08 riastradh Exp $	*/
+/*	$NetBSD: if_wg.c,v 1.33 2020/08/31 20:20:22 riastradh Exp $	*/
 
 /*
  * Copyright (C) Ryota Ozaki <[email protected]>
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.32 2020/08/28 07:03:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.33 2020/08/31 20:20:22 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3382,7 +3382,7 @@ wg_if_attach(struct wg_softc *wg)
 
 	wg->wg_if.if_addrlen = 0;
 	wg->wg_if.if_mtu = WG_MTU;
-	wg->wg_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
+	wg->wg_if.if_flags = IFF_MULTICAST;
 	wg->wg_if.if_extflags = IFEF_NO_LINK_STATE_CHANGE;
 	wg->wg_if.if_extflags |= IFEF_MPSAFE;
 	wg->wg_if.if_ioctl = wg_ioctl;

Reply via email to