*** ../../vanilla3.0/tcp_subr.c Tue Apr 28 10:28:02 1998 --- tcp_subr.c Tue Sep 15 15:59:14 1998 *************** *** 12,18 **** */ /* ! * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 12,18 ---- */ /* ! * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995, 1998 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 77,82 **** --- 77,85 ---- extern int tcp_mssdflt; extern int tcp_rttdflt; extern int tcp_do_rfc1323; + #ifdef SACK + extern int tcp_do_sack; + #endif extern struct inpcb *tcp_last_inpcb; *************** *** 234,239 **** --- 237,248 ---- tp->seg_next = tp->seg_prev = (struct tcpiphdr *)tp; tp->t_maxseg = tcp_mssdflt; tp->t_peermaxseg = tcp_mssdflt; + #ifdef SACK + if (tcp_do_sack) + tp->sack_disable = 0; + else + tp->sack_disable = 1; + #endif tp->t_flags = tcp_do_rfc1323 ? (TF_USE_SCALE|TF_SEND_TSTMP) : 0; tp->t_inpcb = inp; *************** *** 292,297 **** --- 301,309 ---- struct inpcb *inp = tp->t_inpcb; struct socket *so = inp->inp_socket; register struct mbuf *m; + #ifdef SACK + struct sackhole *p, *q; + #endif #ifdef RTV_RTT register struct rtentry *rt; *************** *** 370,375 **** --- 382,398 ---- remque(t->ti_prev); m_freem(m); } + #ifdef SACK + /* + * Free SACK holes. + */ + q = p = tp->snd_holes; + while (p != 0) { + q = p->next; + free(p, M_PCB); + p = q; + } + #endif if (tp->t_template) (void) m_free(dtom(tp->t_template)); tcp_delack_done(tp); /* just in case */