summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2016-11-16 12:21:46 +0000
committerbluhm <bluhm@openbsd.org>2016-11-16 12:21:46 +0000
commit9bd6009c99dce30731379a35e5d8aefe016e1aff (patch)
tree44629a1581e7d22934b985d4db7327605a18e0c1
parentDon't error if renaming a session to its current name, from shik dot (diff)
downloadwireguard-openbsd-9bd6009c99dce30731379a35e5d8aefe016e1aff.tar.xz
wireguard-openbsd-9bd6009c99dce30731379a35e5d8aefe016e1aff.zip
Inherit route label when creating dynamic routes for path MTU.
From Rivo Nurges; OK claudio@ mpi@ phessler@
-rw-r--r--sys/netinet/ip_icmp.c7
-rw-r--r--sys/netinet6/icmp6.c9
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index aaebccde226..843ebd4fb6c 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.154 2016/11/14 03:51:53 dlg Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.155 2016/11/16 12:21:46 bluhm Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -951,11 +951,14 @@ icmp_mtudisc_clone(struct in_addr dst, u_int rtableid)
if ((rt->rt_flags & RTF_HOST) == 0) {
struct rtentry *nrt;
struct rt_addrinfo info;
+ struct sockaddr_rtlabel sa_rl;
memset(&info, 0, sizeof(info));
+ info.rti_flags = RTF_GATEWAY | RTF_HOST | RTF_DYNAMIC;
info.rti_info[RTAX_DST] = sintosa(&sin);
info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_flags = RTF_GATEWAY | RTF_HOST | RTF_DYNAMIC;
+ info.rti_info[RTAX_LABEL] =
+ rtlabel_id2sa(rt->rt_labelid, &sa_rl);
error = rtrequest(RTM_ADD, &info, RTP_DEFAULT, &nrt, rtableid);
if (error) {
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 179dde8fa55..a4e363870a6 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.191 2016/11/09 09:04:48 mpi Exp $ */
+/* $OpenBSD: icmp6.c,v 1.192 2016/11/16 12:21:46 bluhm Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -1912,14 +1912,17 @@ icmp6_mtudisc_clone(struct sockaddr *dst, u_int rdomain)
/* If we didn't get a host route, allocate one */
if ((rt->rt_flags & RTF_HOST) == 0) {
- struct rt_addrinfo info;
struct rtentry *nrt;
+ struct rt_addrinfo info;
+ struct sockaddr_rtlabel sa_rl;
int s;
- bzero(&info, sizeof(info));
+ memset(&info, 0, sizeof(info));
info.rti_flags = RTF_GATEWAY | RTF_HOST | RTF_DYNAMIC;
info.rti_info[RTAX_DST] = dst;
info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
+ info.rti_info[RTAX_LABEL] =
+ rtlabel_id2sa(rt->rt_labelid, &sa_rl);
s = splsoftnet();
error = rtrequest(RTM_ADD, &info, rt->rt_priority, &nrt,