netfilter: nf_nat: fix crash in nf_nat_csum
authorJulian Anastasov <ja@ssi.bg>
Sun, 29 May 2011 20:42:29 +0000 (23:42 +0300)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 5 Jun 2011 23:36:46 +0000 (01:36 +0200)
commitd9be76f38526dccf84062e3ac3ed3a6a97698565
treecc819ad8ffd4f11bf916d624010863d978874b30
parentb48e3c5c323fea08c12a340cbb8dcc8ca2431d5b
netfilter: nf_nat: fix crash in nf_nat_csum

Fix crash in nf_nat_csum when mangling packets
in OUTPUT hook where skb->dev is not defined, it is set
later before POSTROUTING. Problem happens for CHECKSUM_NONE.
We can check device from rt but using CHECKSUM_PARTIAL
should be safe (skb_checksum_help).

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nf_nat_helper.c