PERFORCE change 166475 for review
Andre Oppermann
andre at FreeBSD.org
Thu Jul 23 20:53:26 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166475
Change 166475 by andre at andre_t61 on 2009/07/23 20:52:38
Pass length directly to tcp_reass(). The pointer juggling is no longer necessary
as the receiver SACK blocks are generated directly out of the reassembly queue.
Affected files ...
.. //depot/projects/tcp_reass/netinet/tcp_input.c#15 edit
.. //depot/projects/tcp_reass/netinet/tcp_reass.c#42 edit
.. //depot/projects/tcp_reass/netinet/tcp_var.h#21 edit
Differences ...
==== //depot/projects/tcp_reass/netinet/tcp_input.c#15 (text+ko) ====
@@ -1999,8 +1999,7 @@
* later; if not, do so now to pass queued data to user.
*/
if (tlen == 0 && (thflags & TH_FIN) == 0)
- (void) tcp_reass(tp, (struct tcphdr *)0, 0,
- (struct mbuf *)0);
+ (void)tcp_reass(tp, NULL, 0, NULL);
tp->snd_wl1 = th->th_seq - 1;
/* FALLTHROUGH */
@@ -2592,7 +2591,7 @@
/*
* NB: tcp_reass() always consumes the mbuf chain.
*/
- thflags = tcp_reass(tp, th, &tlen, m);
+ thflags = tcp_reass(tp, th, tlen, m);
tp->t_flags |= TF_ACKNOW;
}
#ifdef INVARIANTS
==== //depot/projects/tcp_reass/netinet/tcp_reass.c#42 (text+ko) ====
@@ -277,7 +277,7 @@
* the queue or by freeing it.
*/
int
-tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
+tcp_reass(struct tcpcb *tp, struct tcphdr *th, int len, struct mbuf *m)
{
int thflags = 0;
tcp_seq th_seq;
@@ -303,9 +303,8 @@
}
KASSERT(th != NULL, ("%s: th is NULL", __func__));
- KASSERT(tlenp != NULL, ("%s: tlenp is NULL", __func__));
KASSERT(m != NULL, ("%s: m is NULL", __func__));
- KASSERT(*tlenp == m_length(m, NULL),
+ KASSERT(len == m_length(m, NULL),
("%s: tlen != mbuf length", __func__));
/*
@@ -375,7 +374,7 @@
tcp_timer_activate(tp, TT_REASS, 0);
return (thflags);
}
- } else if (*tlenp == 0)
+ } else if (len == 0)
goto done;
else
thflags &= ~TH_FIN;
@@ -394,7 +393,7 @@
/* Set up search structure. */
trbs.trb_seqs = th_seq;
- trbs.trb_seqe = th_seq + *tlenp;
+ trbs.trb_seqe = th_seq + len;
trbs.trb_m = m;
trbs.trb_mt = m_last(m);
@@ -496,7 +495,6 @@
done:
m_freem(m);
- *tlenp = 0;
return (0);
}
==== //depot/projects/tcp_reass/netinet/tcp_var.h#21 (text+ko) ====
@@ -652,7 +652,7 @@
void tcp_fini(void *);
char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *,
const void *);
-int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *);
+int tcp_reass(struct tcpcb *, struct tcphdr *, int, struct mbuf *);
void tcp_reass_init(void);
int tcp_reass_sack(struct tcpcb *, u_char *, int);
void tcp_reass_flush(struct tcpcb *);
More information about the p4-projects
mailing list