Page MenuHomeFreeBSD

D42430.id129745.diff
No OneTemporary

D42430.id129745.diff

diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -897,6 +897,10 @@
#if defined(IPSEC) || defined(IPSEC_SUPPORT)
#ifdef INET
case UDP_ENCAP:
+ if (!INP_CHECK_SOCKAF(so, AF_INET)) {
+ INP_WUNLOCK(inp);
+ return (EINVAL);
+ }
if (!IPSEC_ENABLED(ipv4)) {
INP_WUNLOCK(inp);
return (ENOPROTOOPT);
@@ -944,6 +948,10 @@
#if defined(IPSEC) || defined(IPSEC_SUPPORT)
#ifdef INET
case UDP_ENCAP:
+ if (!INP_CHECK_SOCKAF(so, AF_INET)) {
+ INP_WUNLOCK(inp);
+ return (EINVAL);
+ }
if (!IPSEC_ENABLED(ipv4)) {
INP_WUNLOCK(inp);
return (ENOPROTOOPT);
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -1244,7 +1244,7 @@
#define UDP6_PROTOSW \
.pr_type = SOCK_DGRAM, \
.pr_flags = PR_ATOMIC|PR_ADDR|PR_CAPATTACH, \
- .pr_ctloutput = ip6_ctloutput, \
+ .pr_ctloutput = udp_ctloutput, \
.pr_abort = udp6_abort, \
.pr_attach = udp6_attach, \
.pr_bind = udp6_bind, \

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 27, 11:24 AM (2 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16194972
Default Alt Text
D42430.id129745.diff (1 KB)

Event Timeline