diff options
author | Herbert Xu ~{PmVHI~} <herbert@gondor.apana.org.au> | 2006-06-05 15:03:37 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-06-05 15:03:37 -0700 |
commit | f291196979ca80cdef199ca2b55e2758e8c23a0d (patch) | |
tree | b1dc4a5390d8bf2f2ab486b8b6a8e3a6297cf4e7 /drivers/net/netconsole.c | |
parent | 364212e0df05efee43d87270b476fc5c9ad2c651 (diff) | |
download | op-kernel-dev-f291196979ca80cdef199ca2b55e2758e8c23a0d.zip op-kernel-dev-f291196979ca80cdef199ca2b55e2758e8c23a0d.tar.gz |
[TCP]: Avoid skb_pull if possible when trimming head
Trimming the head of an skb by calling skb_pull can cause the packet
to become unaligned if the length pulled is odd. Since the length is
entirely arbitrary for a FIN packet carrying data, this is actually
quite common.
Unaligned data is not the end of the world, but we should avoid it if
it's easily done. In this case it is trivial. Since we're discarding
all of the head data it doesn't matter whether we move skb->data forward
or back.
However, it is still possible to have unaligned skb->data in general.
So network drivers should be prepared to handle it instead of crashing.
This patch also adds an unlikely marking on len < headlen since partial
ACKs on head data are extremely rare in the wild. As the return value
of __pskb_trim_head is no longer ever NULL that has been removed.
Signed-off-by: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netconsole.c')
0 files changed, 0 insertions, 0 deletions