summaryrefslogtreecommitdiff
path: root/sys/netmpls
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2019-06-13 08:12:12 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2019-06-13 08:12:12 +0000
commit5e5e9391bb65e33e082e06c79c2cd84d812e8a72 (patch)
tree088987e325dd33697ff876feb7e4a77b1bed04ce /sys/netmpls
parent349c7d901c21801fa254f7427854c0f0d31a9c6f (diff)
Copy the user provided sockaddr into a normalized sockaddr in rtrequest()
before adding it to the routing table. The rtable code is doing memcmp() of those rt_dest sockaddrs so it is important that they are stored in a canonical form. To do this struct domain is extended to include the sockaddr size for this address family. OK bluhm@ anton@ Reported-by: syzbot+10fe9cd8d0211c562ead@syzkaller.appspotmail.com
Diffstat (limited to 'sys/netmpls')
-rw-r--r--sys/netmpls/mpls_proto.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netmpls/mpls_proto.c b/sys/netmpls/mpls_proto.c
index e191c4cabc4..8be741a0c43 100644
--- a/sys/netmpls/mpls_proto.c
+++ b/sys/netmpls/mpls_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpls_proto.c,v 1.17 2018/11/19 10:15:04 claudio Exp $ */
+/* $OpenBSD: mpls_proto.c,v 1.18 2019/06/13 08:12:11 claudio Exp $ */
/*
* Copyright (C) 1999, 2000 and 2001 AYAME Project, WIDE Project.
@@ -48,6 +48,7 @@
struct domain mplsdomain = {
.dom_family = AF_MPLS,
.dom_name = "mpls",
+ .dom_sasize = sizeof(struct sockaddr_mpls),
.dom_rtoffset = offsetof(struct sockaddr_mpls, smpls_label),
.dom_maxplen = 32
};