summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c197
1 files changed, 99 insertions, 98 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 4de3e59..659626c 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socketvar.h>
#include <sys/protosw.h>
#include <sys/random.h>
+#include <sys/vimage.h>
#include <vm/uma.h>
@@ -236,7 +237,7 @@ static void
tcp_zone_change(void *tag)
{
- uma_zone_set_max(tcbinfo.ipi_zone, maxsockets);
+ uma_zone_set_max(V_tcbinfo.ipi_zone, maxsockets);
uma_zone_set_max(tcpcb_zone, maxsockets);
tcp_tw_zone_change();
}
@@ -265,25 +266,25 @@ tcp_init(void)
if (tcp_rexmit_min < 1)
tcp_rexmit_min = 1;
tcp_rexmit_slop = TCPTV_CPU_VAR;
- tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH;
+ V_tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH;
tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT;
- INP_INFO_LOCK_INIT(&tcbinfo, "tcp");
- LIST_INIT(&tcb);
- tcbinfo.ipi_listhead = &tcb;
+ INP_INFO_LOCK_INIT(&V_tcbinfo, "tcp");
+ LIST_INIT(&V_tcb);
+ V_tcbinfo.ipi_listhead = &V_tcb;
TUNABLE_INT_FETCH("net.inet.tcp.tcbhashsize", &hashsize);
if (!powerof2(hashsize)) {
printf("WARNING: TCB hash size not a power of 2\n");
hashsize = 512; /* safe default */
}
tcp_tcbhashsize = hashsize;
- tcbinfo.ipi_hashbase = hashinit(hashsize, M_PCB,
- &tcbinfo.ipi_hashmask);
- tcbinfo.ipi_porthashbase = hashinit(hashsize, M_PCB,
- &tcbinfo.ipi_porthashmask);
- tcbinfo.ipi_zone = uma_zcreate("inpcb", sizeof(struct inpcb),
+ V_tcbinfo.ipi_hashbase = hashinit(hashsize, M_PCB,
+ &V_tcbinfo.ipi_hashmask);
+ V_tcbinfo.ipi_porthashbase = hashinit(hashsize, M_PCB,
+ &V_tcbinfo.ipi_porthashmask);
+ V_tcbinfo.ipi_zone = uma_zcreate("inpcb", sizeof(struct inpcb),
NULL, NULL, tcp_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
- uma_zone_set_max(tcbinfo.ipi_zone, maxsockets);
+ uma_zone_set_max(V_tcbinfo.ipi_zone, maxsockets);
#ifdef INET6
#define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr))
#else /* INET6 */
@@ -512,8 +513,8 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m,
{
tlen += sizeof (struct tcpiphdr);
ip->ip_len = tlen;
- ip->ip_ttl = ip_defttl;
- if (path_mtu_discovery)
+ ip->ip_ttl = V_ip_defttl;
+ if (V_path_mtu_discovery)
ip->ip_off |= IP_DF;
}
m->m_len = tlen;
@@ -596,9 +597,9 @@ tcp_newtcpcb(struct inpcb *inp)
/* LIST_INIT(&tp->t_segq); */ /* XXX covered by M_ZERO */
tp->t_maxseg = tp->t_maxopd =
#ifdef INET6
- isipv6 ? tcp_v6mssdflt :
+ isipv6 ? V_tcp_v6mssdflt :
#endif /* INET6 */
- tcp_mssdflt;
+ V_tcp_mssdflt;
/* Set up our timeouts. */
callout_init(&tp->t_timers->tt_rexmt, CALLOUT_MPSAFE);
@@ -607,9 +608,9 @@ tcp_newtcpcb(struct inpcb *inp)
callout_init(&tp->t_timers->tt_2msl, CALLOUT_MPSAFE);
callout_init(&tp->t_timers->tt_delack, CALLOUT_MPSAFE);
- if (tcp_do_rfc1323)
+ if (V_tcp_do_rfc1323)
tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);
- if (tcp_do_sack)
+ if (V_tcp_do_sack)
tp->t_flags |= TF_SACK_PERMIT;
TAILQ_INIT(&tp->snd_holes);
tp->t_inpcb = inp; /* XXX */
@@ -632,7 +633,7 @@ tcp_newtcpcb(struct inpcb *inp)
* because the socket may be bound to an IPv6 wildcard address,
* which may match an IPv4-mapped IPv6 address.
*/
- inp->inp_ip_ttl = ip_defttl;
+ inp->inp_ip_ttl = V_ip_defttl;
inp->inp_ppcb = tp;
return (tp); /* XXX */
}
@@ -647,15 +648,15 @@ tcp_drop(struct tcpcb *tp, int errno)
{
struct socket *so = tp->t_inpcb->inp_socket;
- INP_INFO_WLOCK_ASSERT(&tcbinfo);
+ INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
INP_WLOCK_ASSERT(tp->t_inpcb);
if (TCPS_HAVERCVDSYN(tp->t_state)) {
tp->t_state = TCPS_CLOSED;
(void) tcp_output_reset(tp);
- tcpstat.tcps_drops++;
+ V_tcpstat.tcps_drops++;
} else
- tcpstat.tcps_conndrops++;
+ V_tcpstat.tcps_conndrops++;
if (errno == ETIMEDOUT && tp->t_softerror)
errno = tp->t_softerror;
so->so_error = errno;
@@ -748,7 +749,7 @@ tcp_discardcb(struct tcpcb *tp)
m_freem(q->tqe_m);
uma_zfree(tcp_reass_zone, q);
tp->t_segqlen--;
- tcp_reass_qsize--;
+ V_tcp_reass_qsize--;
}
/* Disconnect offload device, if any. */
tcp_offload_detach(tp);
@@ -769,14 +770,14 @@ tcp_close(struct tcpcb *tp)
struct inpcb *inp = tp->t_inpcb;
struct socket *so;
- INP_INFO_WLOCK_ASSERT(&tcbinfo);
+ INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
INP_WLOCK_ASSERT(inp);
/* Notify any offload devices of listener close */
if (tp->t_state == TCPS_LISTEN)
tcp_offload_listen_close(tp);
in_pcbdrop(inp);
- tcpstat.tcps_closed++;
+ V_tcpstat.tcps_closed++;
KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL"));
so = inp->inp_socket;
soisdisconnected(so);
@@ -811,8 +812,8 @@ tcp_drain(void)
* where we're really low on mbufs, this is potentially
* usefull.
*/
- INP_INFO_RLOCK(&tcbinfo);
- LIST_FOREACH(inpb, tcbinfo.ipi_listhead, inp_list) {
+ INP_INFO_RLOCK(&V_tcbinfo);
+ LIST_FOREACH(inpb, V_tcbinfo.ipi_listhead, inp_list) {
if (inpb->inp_vflag & INP_TIMEWAIT)
continue;
INP_WLOCK(inpb);
@@ -823,13 +824,13 @@ tcp_drain(void)
m_freem(te->tqe_m);
uma_zfree(tcp_reass_zone, te);
tcpb->t_segqlen--;
- tcp_reass_qsize--;
+ V_tcp_reass_qsize--;
}
tcp_clean_sackreport(tcpb);
}
INP_WUNLOCK(inpb);
}
- INP_INFO_RUNLOCK(&tcbinfo);
+ INP_INFO_RUNLOCK(&V_tcbinfo);
}
}
@@ -846,7 +847,7 @@ tcp_notify(struct inpcb *inp, int error)
{
struct tcpcb *tp;
- INP_INFO_WLOCK_ASSERT(&tcbinfo);
+ INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
INP_WLOCK_ASSERT(inp);
if ((inp->inp_vflag & INP_TIMEWAIT) ||
@@ -899,7 +900,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
*/
if (req->oldptr == NULL) {
m = syncache_pcbcount();
- n = tcbinfo.ipi_count;
+ n = V_tcbinfo.ipi_count;
req->oldidx = 2 * (sizeof xig)
+ ((m + n) + n/8) * sizeof(struct xtcpcb);
return (0);
@@ -911,10 +912,10 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
/*
* OK, now we're committed to doing something.
*/
- INP_INFO_RLOCK(&tcbinfo);
- gencnt = tcbinfo.ipi_gencnt;
- n = tcbinfo.ipi_count;
- INP_INFO_RUNLOCK(&tcbinfo);
+ INP_INFO_RLOCK(&V_tcbinfo);
+ gencnt = V_tcbinfo.ipi_gencnt;
+ n = V_tcbinfo.ipi_count;
+ INP_INFO_RUNLOCK(&V_tcbinfo);
m = syncache_pcbcount();
@@ -939,8 +940,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
if (inp_list == NULL)
return (ENOMEM);
- INP_INFO_RLOCK(&tcbinfo);
- for (inp = LIST_FIRST(tcbinfo.ipi_listhead), i = 0; inp != NULL && i
+ INP_INFO_RLOCK(&V_tcbinfo);
+ for (inp = LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; inp != NULL && i
< n; inp = LIST_NEXT(inp, inp_list)) {
INP_RLOCK(inp);
if (inp->inp_gencnt <= gencnt) {
@@ -963,7 +964,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
}
INP_RUNLOCK(inp);
}
- INP_INFO_RUNLOCK(&tcbinfo);
+ INP_INFO_RUNLOCK(&V_tcbinfo);
n = i;
error = 0;
@@ -1007,11 +1008,11 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
* while we were processing this request, and it
* might be necessary to retry.
*/
- INP_INFO_RLOCK(&tcbinfo);
- xig.xig_gen = tcbinfo.ipi_gencnt;
+ INP_INFO_RLOCK(&V_tcbinfo);
+ xig.xig_gen = V_tcbinfo.ipi_gencnt;
xig.xig_sogen = so_gencnt;
- xig.xig_count = tcbinfo.ipi_count + pcb_count;
- INP_INFO_RUNLOCK(&tcbinfo);
+ xig.xig_count = V_tcbinfo.ipi_count + pcb_count;
+ INP_INFO_RUNLOCK(&V_tcbinfo);
error = SYSCTL_OUT(req, &xig, sizeof xig);
}
free(inp_list, M_TEMP);
@@ -1035,12 +1036,12 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
error = SYSCTL_IN(req, addrs, sizeof(addrs));
if (error)
return (error);
- INP_INFO_RLOCK(&tcbinfo);
- inp = in_pcblookup_hash(&tcbinfo, addrs[1].sin_addr, addrs[1].sin_port,
+ INP_INFO_RLOCK(&V_tcbinfo);
+ inp = in_pcblookup_hash(&V_tcbinfo, addrs[1].sin_addr, addrs[1].sin_port,
addrs[0].sin_addr, addrs[0].sin_port, 0, NULL);
if (inp != NULL) {
INP_RLOCK(inp);
- INP_INFO_RUNLOCK(&tcbinfo);
+ INP_INFO_RUNLOCK(&V_tcbinfo);
if (inp->inp_socket == NULL)
error = ENOENT;
if (error == 0)
@@ -1050,7 +1051,7 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
cru2x(inp->inp_socket->so_cred, &xuc);
INP_RUNLOCK(inp);
} else {
- INP_INFO_RUNLOCK(&tcbinfo);
+ INP_INFO_RUNLOCK(&V_tcbinfo);
error = ENOENT;
}
if (error == 0)
@@ -1077,8 +1078,8 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
error = SYSCTL_IN(req, addrs, sizeof(addrs));
if (error)
return (error);
- if ((error = sa6_embedscope(&addrs[0], ip6_use_defzone)) != 0 ||
- (error = sa6_embedscope(&addrs[1], ip6_use_defzone)) != 0) {
+ if ((error = sa6_embedscope(&addrs[0], V_ip6_use_defzone)) != 0 ||
+ (error = sa6_embedscope(&addrs[1], V_ip6_use_defzone)) != 0) {
return (error);
}
if (IN6_IS_ADDR_V4MAPPED(&addrs[0].sin6_addr)) {
@@ -1088,21 +1089,21 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
return (EINVAL);
}
- INP_INFO_RLOCK(&tcbinfo);
+ INP_INFO_RLOCK(&V_tcbinfo);
if (mapped == 1)
- inp = in_pcblookup_hash(&tcbinfo,
+ inp = in_pcblookup_hash(&V_tcbinfo,
*(struct in_addr *)&addrs[1].sin6_addr.s6_addr[12],
addrs[1].sin6_port,
*(struct in_addr *)&addrs[0].sin6_addr.s6_addr[12],
addrs[0].sin6_port,
0, NULL);
else
- inp = in6_pcblookup_hash(&tcbinfo,
+ inp = in6_pcblookup_hash(&V_tcbinfo,
&addrs[1].sin6_addr, addrs[1].sin6_port,
&addrs[0].sin6_addr, addrs[0].sin6_port, 0, NULL);
if (inp != NULL) {
INP_RLOCK(inp);
- INP_INFO_RUNLOCK(&tcbinfo);
+ INP_INFO_RUNLOCK(&V_tcbinfo);
if (inp->inp_socket == NULL)
error = ENOENT;
if (error == 0)
@@ -1112,7 +1113,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
cru2x(inp->inp_socket->so_cred, &xuc);
INP_RUNLOCK(inp);
} else {
- INP_INFO_RUNLOCK(&tcbinfo);
+ INP_INFO_RUNLOCK(&V_tcbinfo);
error = ENOENT;
}
if (error == 0)
@@ -1146,7 +1147,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
if (cmd == PRC_MSGSIZE)
notify = tcp_mtudisc;
- else if (icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB ||
+ else if (V_icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB ||
cmd == PRC_UNREACH_PORT || cmd == PRC_TIMXCEED_INTRANS) && ip)
notify = tcp_drop_syn_sent;
/*
@@ -1173,8 +1174,8 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
- offsetof(struct icmp, icmp_ip));
th = (struct tcphdr *)((caddr_t)ip
+ (ip->ip_hl << 2));
- INP_INFO_WLOCK(&tcbinfo);
- inp = in_pcblookup_hash(&tcbinfo, faddr, th->th_dport,
+ INP_INFO_WLOCK(&V_tcbinfo);
+ inp = in_pcblookup_hash(&V_tcbinfo, faddr, th->th_dport,
ip->ip_src, th->th_sport, 0, NULL);
if (inp != NULL) {
INP_WLOCK(inp);
@@ -1208,11 +1209,11 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
if (!mtu)
mtu = ip_next_mtu(ip->ip_len,
1);
- if (mtu < max(296, (tcp_minmss)
+ if (mtu < max(296, (V_tcp_minmss)
+ sizeof(struct tcpiphdr)))
mtu = 0;
if (!mtu)
- mtu = tcp_mssdflt
+ mtu = V_tcp_mssdflt
+ sizeof(struct tcpiphdr);
/*
* Only cache the the MTU if it
@@ -1239,9 +1240,9 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
#endif
syncache_unreach(&inc, th);
}
- INP_INFO_WUNLOCK(&tcbinfo);
+ INP_INFO_WUNLOCK(&V_tcbinfo);
} else
- in_pcbnotifyall(&tcbinfo, faddr, inetctlerrmap[cmd], notify);
+ in_pcbnotifyall(&V_tcbinfo, faddr, inetctlerrmap[cmd], notify);
}
#ifdef INET6
@@ -1301,7 +1302,7 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d)
bzero(&th, sizeof(th));
m_copydata(m, off, sizeof(*thp), (caddr_t)&th);
- in6_pcbnotify(&tcbinfo, sa, th.th_dport,
+ in6_pcbnotify(&V_tcbinfo, sa, th.th_dport,
(struct sockaddr *)ip6cp->ip6c_src,
th.th_sport, cmd, NULL, notify);
@@ -1310,11 +1311,11 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d)
inc.inc6_faddr = ((struct sockaddr_in6 *)sa)->sin6_addr;
inc.inc6_laddr = ip6cp->ip6c_src->sin6_addr;
inc.inc_isipv6 = 1;
- INP_INFO_WLOCK(&tcbinfo);
+ INP_INFO_WLOCK(&V_tcbinfo);
syncache_unreach(&inc, &th);
- INP_INFO_WUNLOCK(&tcbinfo);
+ INP_INFO_WUNLOCK(&V_tcbinfo);
} else
- in6_pcbnotify(&tcbinfo, sa, 0, (const struct sockaddr *)sa6_src,
+ in6_pcbnotify(&V_tcbinfo, sa, 0, (const struct sockaddr *)sa6_src,
0, cmd, NULL, notify);
}
#endif /* INET6 */
@@ -1383,37 +1384,37 @@ tcp_new_isn(struct tcpcb *tp)
ISN_LOCK();
/* Seed if this is the first use, reseed if requested. */
- if ((isn_last_reseed == 0) || ((tcp_isn_reseed_interval > 0) &&
- (((u_int)isn_last_reseed + (u_int)tcp_isn_reseed_interval*hz)
+ if ((V_isn_last_reseed == 0) || ((V_tcp_isn_reseed_interval > 0) &&
+ (((u_int)V_isn_last_reseed + (u_int)V_tcp_isn_reseed_interval*hz)
< (u_int)ticks))) {
- read_random(&isn_secret, sizeof(isn_secret));
- isn_last_reseed = ticks;
+ read_random(&V_isn_secret, sizeof(V_isn_secret));
+ V_isn_last_reseed = ticks;
}
/* Compute the md5 hash and return the ISN. */
- MD5Init(&isn_ctx);
- MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_fport, sizeof(u_short));
- MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_lport, sizeof(u_short));
+ MD5Init(&V_isn_ctx);
+ MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_fport, sizeof(u_short));
+ MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_lport, sizeof(u_short));
#ifdef INET6
if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) {
- MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->in6p_faddr,
+ MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->in6p_faddr,
sizeof(struct in6_addr));
- MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->in6p_laddr,
+ MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->in6p_laddr,
sizeof(struct in6_addr));
} else
#endif
{
- MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_faddr,
+ MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_faddr,
sizeof(struct in_addr));
- MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_laddr,
+ MD5Update(&V_isn_ctx, (u_char *) &tp->t_inpcb->inp_laddr,
sizeof(struct in_addr));
}
- MD5Update(&isn_ctx, (u_char *) &isn_secret, sizeof(isn_secret));
- MD5Final((u_char *) &md5_buffer, &isn_ctx);
+ MD5Update(&V_isn_ctx, (u_char *) &V_isn_secret, sizeof(V_isn_secret));
+ MD5Final((u_char *) &md5_buffer, &V_isn_ctx);
new_isn = (tcp_seq) md5_buffer[0];
- isn_offset += ISN_STATIC_INCREMENT +
+ V_isn_offset += ISN_STATIC_INCREMENT +
(arc4random() & ISN_RANDOM_INCREMENT);
- new_isn += isn_offset;
+ new_isn += V_isn_offset;
ISN_UNLOCK();
return (new_isn);
}
@@ -1429,12 +1430,12 @@ tcp_isn_tick(void *xtp)
u_int32_t projected_offset;
ISN_LOCK();
- projected_offset = isn_offset_old + ISN_BYTES_PER_SECOND / 100;
+ projected_offset = V_isn_offset_old + ISN_BYTES_PER_SECOND / 100;
- if (SEQ_GT(projected_offset, isn_offset))
- isn_offset = projected_offset;
+ if (SEQ_GT(projected_offset, V_isn_offset))
+ V_isn_offset = projected_offset;
- isn_offset_old = isn_offset;
+ V_isn_offset_old = V_isn_offset;
callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL);
ISN_UNLOCK();
}
@@ -1449,7 +1450,7 @@ tcp_drop_syn_sent(struct inpcb *inp, int errno)
{
struct tcpcb *tp;
- INP_INFO_WLOCK_ASSERT(&tcbinfo);
+ INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
INP_WLOCK_ASSERT(inp);
if ((inp->inp_vflag & INP_TIMEWAIT) ||
@@ -1509,9 +1510,9 @@ tcp_mtudisc(struct inpcb *inp, int errno)
if (!maxmtu) {
tp->t_maxopd = tp->t_maxseg =
#ifdef INET6
- isipv6 ? tcp_v6mssdflt :
+ isipv6 ? V_tcp_v6mssdflt :
#endif /* INET6 */
- tcp_mssdflt;
+ V_tcp_mssdflt;
return (inp);
}
mss = maxmtu -
@@ -1560,7 +1561,7 @@ tcp_mtudisc(struct inpcb *inp, int errno)
tp->t_maxseg = mss;
- tcpstat.tcps_mturesent++;
+ V_tcpstat.tcps_mturesent++;
tp->t_rtttime = 0;
tp->snd_nxt = tp->snd_una;
tcp_free_sackholes(tp);
@@ -1756,7 +1757,7 @@ tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq)
* If inflight_enable is disabled in the middle of a tcp connection,
* make sure snd_bwnd is effectively disabled.
*/
- if (tcp_inflight_enable == 0 || tp->t_rttlow < tcp_inflight_rttthresh) {
+ if (V_tcp_inflight_enable == 0 || tp->t_rttlow < V_tcp_inflight_rttthresh) {
tp->snd_bwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
tp->snd_bandwidth = 0;
return;
@@ -1816,7 +1817,7 @@ tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq)
* no other choice.
*/
#define USERTT ((tp->t_srtt + tp->t_rttbest) / 2)
- bwnd = (int64_t)bw * USERTT / (hz << TCP_RTT_SHIFT) + tcp_inflight_stab * tp->t_maxseg / 10;
+ bwnd = (int64_t)bw * USERTT / (hz << TCP_RTT_SHIFT) + V_tcp_inflight_stab * tp->t_maxseg / 10;
#undef USERTT
if (tcp_inflight_debug > 0) {
@@ -1832,10 +1833,10 @@ tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq)
);
}
}
- if ((long)bwnd < tcp_inflight_min)
- bwnd = tcp_inflight_min;
- if (bwnd > tcp_inflight_max)
- bwnd = tcp_inflight_max;
+ if ((long)bwnd < V_tcp_inflight_min)
+ bwnd = V_tcp_inflight_min;
+ if (bwnd > V_tcp_inflight_max)
+ bwnd = V_tcp_inflight_max;
if ((long)bwnd < tp->t_maxseg * 2)
bwnd = tp->t_maxseg * 2;
tp->snd_bwnd = bwnd;
@@ -2011,10 +2012,10 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
lin = (struct sockaddr_in *)&addrs[1];
break;
}
- error = sa6_embedscope(fin6, ip6_use_defzone);
+ error = sa6_embedscope(fin6, V_ip6_use_defzone);
if (error)
return (error);
- error = sa6_embedscope(lin6, ip6_use_defzone);
+ error = sa6_embedscope(lin6, V_ip6_use_defzone);
if (error)
return (error);
break;
@@ -2029,16 +2030,16 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
default:
return (EINVAL);
}
- INP_INFO_WLOCK(&tcbinfo);
+ INP_INFO_WLOCK(&V_tcbinfo);
switch (addrs[0].ss_family) {
#ifdef INET6
case AF_INET6:
- inp = in6_pcblookup_hash(&tcbinfo, &f6, fin6->sin6_port,
+ inp = in6_pcblookup_hash(&V_tcbinfo, &f6, fin6->sin6_port,
&l6, lin6->sin6_port, 0, NULL);
break;
#endif
case AF_INET:
- inp = in_pcblookup_hash(&tcbinfo, fin->sin_addr, fin->sin_port,
+ inp = in_pcblookup_hash(&V_tcbinfo, fin->sin_addr, fin->sin_port,
lin->sin_addr, lin->sin_port, 0, NULL);
break;
}
@@ -2066,7 +2067,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
INP_WUNLOCK(inp);
} else
error = ESRCH;
- INP_INFO_WUNLOCK(&tcbinfo);
+ INP_INFO_WUNLOCK(&V_tcbinfo);
return (error);
}
OpenPOWER on IntegriCloud