diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2023-07-27 03:35:41 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2023-07-27 03:35:42 +0000 |
commit | e3ba0d6adde3c694f46a30b3b67eba43a7099395 (patch) | |
tree | d009c671e3af4e24b32bdb530ed785f73be3d7fe /sys/netinet6 | |
parent | a43e7a96b64e4bda98f49471de33f3ec5c242a2c (diff) | |
download | src-e3ba0d6adde3c694f46a30b3b67eba43a7099395.tar.gz src-e3ba0d6adde3c694f46a30b3b67eba43a7099395.zip |
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/in6_pcb.c | 12 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 27 |
2 files changed, 6 insertions, 33 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 43f567461598..c43d4e804b46 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -256,8 +256,8 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr_in6 *sin6, struct ucred *cred) IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr) || - (t->inp_flags2 & INP_REUSEPORT) || - (t->inp_flags2 & INP_REUSEPORT_LB) == 0) && + (t->inp_socket->so_options & SO_REUSEPORT) || + (t->inp_socket->so_options & SO_REUSEPORT_LB) == 0) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); @@ -283,8 +283,8 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr_in6 *sin6, struct ucred *cred) } t = in6_pcblookup_local(pcbinfo, &sin6->sin6_addr, lport, lookupflags, cred); - if (t && (reuseport & inp_so_options(t)) == 0 && - (reuseport_lb & inp_so_options(t)) == 0) { + if (t && (reuseport & t->inp_socket->so_options) == 0 && + (reuseport_lb & t->inp_socket->so_options) == 0) { return (EADDRINUSE); } #ifdef INET @@ -296,8 +296,8 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr_in6 *sin6, struct ucred *cred) t = in_pcblookup_local(pcbinfo, sin.sin_addr, lport, lookupflags, cred); if (t && - (reuseport & inp_so_options(t)) == 0 && - (reuseport_lb & inp_so_options(t)) == 0 && + (reuseport & t->inp_socket->so_options) == 0 && + (reuseport_lb & t->inp_socket->so_options) == 0 && (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || (t->inp_vflag & INP_IPV6PROTO) != 0)) { return (EADDRINUSE); diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 7e3c98270cc2..2a447a8a738f 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1641,33 +1641,6 @@ ip6_ctloutput(struct socket *so, struct sockopt *sopt) if (sopt->sopt_level == SOL_SOCKET && sopt->sopt_dir == SOPT_SET) { switch (sopt->sopt_name) { - case SO_REUSEADDR: - INP_WLOCK(inp); - if ((so->so_options & SO_REUSEADDR) != 0) - inp->inp_flags2 |= INP_REUSEADDR; - else - inp->inp_flags2 &= ~INP_REUSEADDR; - INP_WUNLOCK(inp); - error = 0; - break; - case SO_REUSEPORT: - INP_WLOCK(inp); - if ((so->so_options & SO_REUSEPORT) != 0) - inp->inp_flags2 |= INP_REUSEPORT; - else - inp->inp_flags2 &= ~INP_REUSEPORT; - INP_WUNLOCK(inp); - error = 0; - break; - case SO_REUSEPORT_LB: - INP_WLOCK(inp); - if ((so->so_options & SO_REUSEPORT_LB) != 0) - inp->inp_flags2 |= INP_REUSEPORT_LB; - else - inp->inp_flags2 &= ~INP_REUSEPORT_LB; - INP_WUNLOCK(inp); - error = 0; - break; case SO_SETFIB: INP_WLOCK(inp); inp->inp_inc.inc_fibnum = so->so_fibnum; |