diff --git a/sys/conf/NOTES b/sys/conf/NOTES --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -677,6 +677,7 @@ options TCP_RFC7413 # TCP Fast Open options TCPHPTS +makeoptions WITH_EXTRA_TCP_STACKS=1 # RACK and BBR TCP kernel modules # In order to enable IPSEC you MUST also add device crypto to # your kernel configuration diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -32,6 +32,7 @@ #include "opt_ipsec.h" #include "opt_ratelimit.h" #include "opt_kern_tls.h" +#if defined(INET) || defined(INET6) #include #include #include @@ -12347,6 +12348,7 @@ ip6, rack->r_ctl.fsb.th); } else #endif /* INET6 */ +#ifdef INET { rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct tcpiphdr); ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; @@ -12366,6 +12368,7 @@ tp->t_port, ip, rack->r_ctl.fsb.th); } +#endif rack->r_fsb_inited = 1; } @@ -15611,7 +15614,7 @@ struct tcpopt to; u_char opt[TCP_MAXOLEN]; uint32_t hdrlen, optlen; - int32_t slot, segsiz, max_val, tso = 0, error, ulen = 0; + int32_t slot, segsiz, max_val, tso = 0, error = 0, ulen = 0; uint16_t flags; uint32_t if_hw_tsomaxsegcount = 0, startseq; uint32_t if_hw_tsomaxsegsize; @@ -15935,8 +15938,6 @@ &inp->inp_route6, 0, NULL, NULL, inp); } -#endif -#if defined(INET) && defined(INET6) else #endif #ifdef INET @@ -16102,7 +16103,9 @@ * the max-burst). We have how much to send and all the info we * need to just send. */ +#ifdef INET struct ip *ip = NULL; +#endif struct udphdr *udp = NULL; struct tcphdr *th = NULL; struct mbuf *m, *s_mb; @@ -16133,8 +16136,10 @@ } else #endif /* INET6 */ { +#ifdef INET ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; hdrlen = sizeof(struct tcpiphdr); +#endif } if (tp->t_port && (V_tcp_udp_tunneling_port == 0)) { m = NULL; @@ -16281,8 +16286,10 @@ else #endif { +#ifdef INET ip->ip_tos &= ~IPTOS_ECN_MASK; ip->ip_tos |= ect; +#endif } } tcp_set_flags(th, flags); @@ -18346,7 +18353,9 @@ ip6 = (struct ip6_hdr *)rack->r_ctl.fsb.tcp_ip_hdr; else #endif /* INET6 */ +#ifdef INET ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; +#endif th = rack->r_ctl.fsb.th; udp = rack->r_ctl.fsb.udp; if (udp) { @@ -18375,6 +18384,7 @@ } else #endif /* INET6 */ { +#ifdef INET ip = mtod(m, struct ip *); if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); @@ -18386,6 +18396,7 @@ } else th = (struct tcphdr *)(ip + 1); tcpip_fillheaders(inp, tp->t_port, ip, th); +#endif } } /* @@ -18419,8 +18430,10 @@ else #endif { +#ifdef INET ip->ip_tos &= ~IPTOS_ECN_MASK; ip->ip_tos |= ect; +#endif } } /* @@ -18514,7 +18527,9 @@ ip6 = mtod(m, struct ip6_hdr *); else #endif /* INET6 */ +#ifdef INET ip = mtod(m, struct ip *); +#endif th = (struct tcphdr *)(cpto + ((uint8_t *)rack->r_ctl.fsb.th - rack->r_ctl.fsb.tcp_ip_hdr)); /* If we have a udp header lets set it into the mbuf as well */ if (udp) @@ -20834,3 +20849,5 @@ MODULE_VERSION(MODNAME, 1); DECLARE_MODULE(MODNAME, tcp_rack, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); MODULE_DEPEND(MODNAME, tcphpts, 1, 1, 1); + +#endif /* #if !defined(INET) && !defined(INET6) */