Commit eb1197bc authored by Joonwoo Park's avatar Joonwoo Park Committed by David S. Miller

[NETFILTER]: Fix incorrect use of skb_make_writable

http://bugzilla.kernel.org/show_bug.cgi?id=9920
The function skb_make_writable returns true or false.
Signed-off-by: default avatarJoonwoo Park <joonwpark81@gmail.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f449b3b5
...@@ -20,7 +20,7 @@ static int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr, ...@@ -20,7 +20,7 @@ static int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr,
{ {
const struct ebt_nat_info *info = data; const struct ebt_nat_info *info = data;
if (skb_make_writable(skb, 0)) if (!skb_make_writable(skb, 0))
return NF_DROP; return NF_DROP;
memcpy(eth_hdr(skb)->h_dest, info->mac, ETH_ALEN); memcpy(eth_hdr(skb)->h_dest, info->mac, ETH_ALEN);
......
...@@ -21,7 +21,7 @@ static int ebt_target_redirect(struct sk_buff *skb, unsigned int hooknr, ...@@ -21,7 +21,7 @@ static int ebt_target_redirect(struct sk_buff *skb, unsigned int hooknr,
{ {
const struct ebt_redirect_info *info = data; const struct ebt_redirect_info *info = data;
if (skb_make_writable(skb, 0)) if (!skb_make_writable(skb, 0))
return NF_DROP; return NF_DROP;
if (hooknr != NF_BR_BROUTING) if (hooknr != NF_BR_BROUTING)
......
...@@ -22,7 +22,7 @@ static int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr, ...@@ -22,7 +22,7 @@ static int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr,
{ {
const struct ebt_nat_info *info = data; const struct ebt_nat_info *info = data;
if (skb_make_writable(skb, 0)) if (!skb_make_writable(skb, 0))
return NF_DROP; return NF_DROP;
memcpy(eth_hdr(skb)->h_source, info->mac, ETH_ALEN); memcpy(eth_hdr(skb)->h_source, info->mac, ETH_ALEN);
......
...@@ -19,7 +19,7 @@ target(struct sk_buff *skb, ...@@ -19,7 +19,7 @@ target(struct sk_buff *skb,
unsigned char *arpptr; unsigned char *arpptr;
int pln, hln; int pln, hln;
if (skb_make_writable(skb, skb->len)) if (!skb_make_writable(skb, skb->len))
return NF_DROP; return NF_DROP;
arp = arp_hdr(skb); arp = arp_hdr(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment