Message ID | 20081217231543.GA28459@gondor.apana.org.au |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Herbert Xu <herbert@gondor.apana.org.au> Date: Thu, 18 Dec 2008 10:15:43 +1100 > + if (between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF)) { > + th->urg_ptr = htons(tp->snd_up - tcb->seq); > + th->urg = 1; > + } else if (after(tcb->seq + 0xFFFF, tp->snd_nxt)) { > + th->urg_ptr = 0xFFFF; > + th->urg = 1; > + } What does this make happen for a jumbo frame where the urgent pointer is within this packet, yet is beyond the 0xffff offset limit? I think this can't be used. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Dec 17, 2008 at 03:21:18PM -0800, David Miller wrote: > From: Herbert Xu <herbert@gondor.apana.org.au> > Date: Thu, 18 Dec 2008 10:15:43 +1100 > > > + if (between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF)) { > > + th->urg_ptr = htons(tp->snd_up - tcb->seq); > > + th->urg = 1; > > + } else if (after(tcb->seq + 0xFFFF, tp->snd_nxt)) { > > + th->urg_ptr = 0xFFFF; > > + th->urg = 1; > > + } > > What does this make happen for a jumbo frame where the urgent pointer > is within this packet, yet is beyond the 0xffff offset limit? Just how on earth can we build such a packet when our skb is designed to carry 64K maximum? Cheers,
From: Herbert Xu <herbert@gondor.apana.org.au> Date: Thu, 18 Dec 2008 10:15:43 +1100 > tcp: Always set urgent pointer if it's beyond snd_nxt Ok, I've applied this for 2.6.29 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index fe3b4bd..e6e0319 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -663,10 +663,14 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, th->urg_ptr = 0; /* The urg_mode check is necessary during a below snd_una win probe */ - if (unlikely(tcp_urg_mode(tp) && - between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF))) { - th->urg_ptr = htons(tp->snd_up - tcb->seq); - th->urg = 1; + if (unlikely(tcp_urg_mode(tp))) { + if (between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF)) { + th->urg_ptr = htons(tp->snd_up - tcb->seq); + th->urg = 1; + } else if (after(tcb->seq + 0xFFFF, tp->snd_nxt)) { + th->urg_ptr = 0xFFFF; + th->urg = 1; + } } tcp_options_write((__be32 *)(th + 1), tp, &opts, &md5_hash_location);