summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2018-02-10 05:32:21 +0000
committerclaudio <claudio@openbsd.org>2018-02-10 05:32:21 +0000
commitd62081b6dd05a67ee176092f85ee96e83eb74a19 (patch)
treebd440ed013a8669b781bbb2ec79eba37b019fb08 /sys/net/if.c
parentSyncronize filesystems to disk when suspending. Each mountpoint's vnodes (diff)
downloadwireguard-openbsd-d62081b6dd05a67ee176092f85ee96e83eb74a19.tar.xz
wireguard-openbsd-d62081b6dd05a67ee176092f85ee96e83eb74a19.zip
Similar to the IPv6 case create 127.0.0.1/8 on lo(4) interfaces which act
as loopback interfaces for each rdomain (including lo0). This is done when the interface is brought up. This is now also done by default (either on attach of lo0 or when creating the rdomain). OK mpi@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 1557cae6cca..e450decf5ed 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.541 2018/02/09 09:35:03 dlg Exp $ */
+/* $OpenBSD: if.c,v 1.542 2018/02/10 05:32:21 claudio Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1550,8 +1550,10 @@ if_up(struct ifnet *ifp)
#ifdef INET6
/* Userland expects the kernel to set ::1 on default lo(4). */
- if (ifp->if_index == rtable_loindex(ifp->if_rdomain))
+ if (ifp->if_index == rtable_loindex(ifp->if_rdomain)) {
in6_ifattach(ifp);
+ in_up_loopback(ifp);
+ }
#endif
if_linkstate(ifp);
@@ -1744,6 +1746,7 @@ if_setrdomain(struct ifnet *ifp, int rdomain)
}
loifp->if_rdomain = rdomain;
+ if_up(loifp);
}
/* make sure that the routing table is a real rdomain */