git: a0aeb1cef53b - main - in_pcb.c: fix compilation of an IPv4 only configuration
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 09 Feb 2022 18:58:44 UTC
The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a0aeb1cef53ba782eb242597e5dcb715861ec270 commit a0aeb1cef53ba782eb242597e5dcb715861ec270 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2022-02-09 18:53:39 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2022-02-09 18:58:29 +0000 in_pcb.c: fix compilation of an IPv4 only configuration While there, remove a duplicate inclusion of sysctl.h. Reported by: Gary Jennejohn Fixes: a35bdd4489b9 - main - tcp: add sysctl interface for setting socket options Sponsored by: Netflix, Inc. --- sys/netinet/in_pcb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 147e0b88214d..25a01bc0c4e5 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include <sys/socket.h> #include <sys/socketvar.h> #include <sys/sockio.h> -#include <sys/sysctl.h> #include <sys/priv.h> #include <sys/proc.h> #include <sys/refcount.h> @@ -2831,6 +2830,7 @@ sysctl_setsockopt(SYSCTL_HANDLER_ARGS, struct inpcbinfo *pcbinfo, sopt.sopt_val = params->sop_optval; sopt.sopt_valsize = req->newlen - sizeof(struct sockopt_parameters); sopt.sopt_td = NULL; +#ifdef INET6 if (params->sop_inc.inc_flags & INC_ISIPV6) { if (IN6_IS_SCOPE_LINKLOCAL(¶ms->sop_inc.inc6_laddr)) params->sop_inc.inc6_laddr.s6_addr16[1] = @@ -2839,11 +2839,13 @@ sysctl_setsockopt(SYSCTL_HANDLER_ARGS, struct inpcbinfo *pcbinfo, params->sop_inc.inc6_faddr.s6_addr16[1] = htons(params->sop_inc.inc6_zoneid & 0xffff); } +#endif if (params->sop_inc.inc_lport != htons(0)) { if (params->sop_inc.inc_fport == htons(0)) inpi.hash = INP_PCBHASH_WILD(params->sop_inc.inc_lport, pcbinfo->ipi_hashmask); else +#ifdef INET6 if (params->sop_inc.inc_flags & INC_ISIPV6) inpi.hash = INP6_PCBHASH( ¶ms->sop_inc.inc6_faddr, @@ -2851,6 +2853,7 @@ sysctl_setsockopt(SYSCTL_HANDLER_ARGS, struct inpcbinfo *pcbinfo, params->sop_inc.inc_fport, pcbinfo->ipi_hashmask); else +#endif inpi.hash = INP_PCBHASH( ¶ms->sop_inc.inc_faddr, params->sop_inc.inc_lport,