summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-11-13 20:54:05 +0000
committerclaudio <claudio@openbsd.org>2009-11-13 20:54:05 +0000
commitf9e6f63a291f6bbe94cdf7ed8e9a4ffee605e995 (patch)
treefcc362d0a36f80e2ad155ebd6ff7b5bb1bd702b1 /sys/netinet/udp_usrreq.c
parentadd missing headers needed by time() (diff)
downloadwireguard-openbsd-f9e6f63a291f6bbe94cdf7ed8e9a4ffee605e995.tar.xz
wireguard-openbsd-f9e6f63a291f6bbe94cdf7ed8e9a4ffee605e995.zip
Extend the protosw pr_ctlinput function to include the rdomain. This is
needed so that the route and inp lookups done in TCP and UDP know where to look. Additionally in_pcbnotifyall() and tcp_respond() got a rdomain argument as well for similar reasons. With this tcp seems to be now fully rdomain save and no longer leaks single packets into the main domain. Looks good markus@, henning@
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 53f253f9037..6dd612a5efe 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.131 2009/11/03 10:59:04 claudio Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.132 2009/11/13 20:54:05 claudio Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -864,7 +864,7 @@ udp6_ctlinput(int cmd, struct sockaddr *sa, void *d)
#endif
void *
-udp_ctlinput(int cmd, struct sockaddr *sa, void *v)
+udp_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v)
{
struct ip *ip = v;
struct udphdr *uhp;
@@ -899,17 +899,17 @@ udp_ctlinput(int cmd, struct sockaddr *sa, void *v)
/* PMTU discovery for udpencap */
if (cmd == PRC_MSGSIZE && ip_mtudisc && udpencap_enable &&
udpencap_port && uhp->uh_sport == htons(udpencap_port)) {
- udpencap_ctlinput(cmd, sa, v);
+ udpencap_ctlinput(cmd, sa, rdomain, v);
return (NULL);
}
#endif
inp = in_pcbhashlookup(&udbtable,
ip->ip_dst, uhp->uh_dport, ip->ip_src, uhp->uh_sport,
- /* XXX */ 0);
+ rdomain);
if (inp && inp->inp_socket != NULL)
notify(inp, errno);
} else
- in_pcbnotifyall(&udbtable, sa, errno, notify);
+ in_pcbnotifyall(&udbtable, sa, rdomain, errno, notify);
return (NULL);
}