summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_fragment.c
diff options
context:
space:
mode:
authorAlexander Drozdov2015-02-17 11:33:46 +0100
committerDavid S. Miller2015-02-20 21:22:38 +0100
commitfba04a9e0c869498889b6445fd06cbe7da9bb834 (patch)
tree99c9b8245ae17b6d8f6ff04e2c5f989de26b03f5 /net/ipv4/ip_fragment.c
parentusb: plusb: Add support for National Instruments host-to-host cable (diff)
downloadkernel-qcow2-linux-fba04a9e0c869498889b6445fd06cbe7da9bb834.tar.gz
kernel-qcow2-linux-fba04a9e0c869498889b6445fd06cbe7da9bb834.tar.xz
kernel-qcow2-linux-fba04a9e0c869498889b6445fd06cbe7da9bb834.zip
ipv4: ip_check_defrag should correctly check return value of skb_copy_bits
skb_copy_bits() returns zero on success and negative value on error, so it is needed to invert the condition in ip_check_defrag(). Fixes: 1bf3751ec90c ("ipv4: ip_check_defrag must not modify skb before unsharing") Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_fragment.c')
-rw-r--r--net/ipv4/ip_fragment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index e5b6d0ddcb58..2c8d98e728c0 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -664,7 +664,7 @@ struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user)
if (skb->protocol != htons(ETH_P_IP))
return skb;
- if (!skb_copy_bits(skb, 0, &iph, sizeof(iph)))
+ if (skb_copy_bits(skb, 0, &iph, sizeof(iph)) < 0)
return skb;
if (iph.ihl < 5 || iph.version != 4)