ipv4: udp: fix short packet and bad checksum logging
authorBjørn Mork <bjorn@mork.no>
Thu, 6 May 2010 03:44:34 +0000 (03:44 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 26 May 2010 21:29:13 +0000 (14:29 -0700)
commit5f4213d39b4965791875f6e10f6f7268ba8dfc2c
tree48025ac2e430aa59b84eb306d6739b5ddd299927
parent1cd8211f07663ebeac04b19ac849de7ed5eef969
ipv4: udp: fix short packet and bad checksum logging

commit ccc2d97cb7c798e785c9f198de243e2b59f7073b upstream.

commit 2783ef23 moved the initialisation of saddr and daddr after
pskb_may_pull() to avoid a potential data corruption.  Unfortunately
also placing it after the short packet and bad checksum error paths,
where these variables are used for logging.  The result is bogus
output like

[92238.389505] UDP: short packet: From 2.0.0.0:65535 23715/178 to 0.0.0.0:65535

Moving the saddr and daddr initialisation above the error paths, while still
keeping it after the pskb_may_pull() to keep the fix from commit 2783ef23.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/udp.c