mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-23 19:28:36 +00:00
udplite: make socketoption available on IPv6 sockets
This patch allows the IPPROTO_UDPLITE-level socket options UDPLITE_SEND_CSCOV and UDPLITE_RECV_CSCOV to be used on AF_INET6 sockets in addition to AF_INET sockets. Reviewed by: ae, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42430
This commit is contained in:
parent
b10ae5a9b2
commit
03c3a70abe
|
@ -897,6 +897,10 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt)
|
|||
#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 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt)
|
|||
#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);
|
||||
|
|
|
@ -1244,7 +1244,7 @@ udp6_disconnect(struct socket *so)
|
|||
#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, \
|
||||
|
|
Loading…
Reference in a new issue