ipv4: ip_check_defrag should correctly check return value of skb_copy_bits
authorAlexander Drozdov <al.drozdov@gmail.com>
Tue, 17 Feb 2015 10:33:46 +0000 (13:33 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:19 +0000 (23:16 +0100)
commitaafdaa379ae3fb58acefa092b8edc3a64c929bb9
tree35089fa970c830419ea1d7c857d4414c7c070c49
parentffd8b8a4fa7e264cd458096ebbb80c398721a67a
ipv4: ip_check_defrag should correctly check return value of skb_copy_bits

commit fba04a9e0c869498889b6445fd06cbe7da9bb834 upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/ipv4/ip_fragment.c