Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224981
b: refs/heads/master
c: deef4b5
h: refs/heads/master
i:
  224979: 5c89072
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Dec 11, 2010
1 parent 72e2c25 commit 144366d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c053fd96d0d3d18c721f880b8fdd0b925894d9c4
refs/heads/master: deef4b522b814593407cfd56216840c2b75e9f15
25 changes: 9 additions & 16 deletions trunk/net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,26 +562,26 @@ static unsigned int br_nf_pre_routing_ipv6(unsigned int hook,
u32 pkt_len;

if (skb->len < sizeof(struct ipv6hdr))
goto inhdr_error;
return NF_DROP;

if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
goto inhdr_error;
return NF_DROP;

hdr = ipv6_hdr(skb);

if (hdr->version != 6)
goto inhdr_error;
return NF_DROP;

pkt_len = ntohs(hdr->payload_len);

if (pkt_len || hdr->nexthdr != NEXTHDR_HOP) {
if (pkt_len + sizeof(struct ipv6hdr) > skb->len)
goto inhdr_error;
return NF_DROP;
if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr)))
goto inhdr_error;
return NF_DROP;
}
if (hdr->nexthdr == NEXTHDR_HOP && check_hbh_len(skb))
goto inhdr_error;
return NF_DROP;

nf_bridge_put(skb->nf_bridge);
if (!nf_bridge_alloc(skb))
Expand All @@ -594,9 +594,6 @@ static unsigned int br_nf_pre_routing_ipv6(unsigned int hook,
br_nf_pre_routing_finish_ipv6);

return NF_STOLEN;

inhdr_error:
return NF_DROP;
}

/* Direct IPv6 traffic to br_nf_pre_routing_ipv6.
Expand All @@ -615,11 +612,11 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff *skb,
__u32 len = nf_bridge_encap_header_len(skb);

if (unlikely(!pskb_may_pull(skb, len)))
goto out;
return NF_DROP;

p = br_port_get_rcu(in);
if (p == NULL)
goto out;
return NF_DROP;
br = p->br;

if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) ||
Expand All @@ -641,8 +638,7 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff *skb,
nf_bridge_pull_encap_header_rcsum(skb);

if (br_parse_ip_options(skb))
/* Drop invalid packet */
goto out;
return NF_DROP;

nf_bridge_put(skb->nf_bridge);
if (!nf_bridge_alloc(skb))
Expand All @@ -656,9 +652,6 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff *skb,
br_nf_pre_routing_finish);

return NF_STOLEN;

out:
return NF_DROP;
}


Expand Down

0 comments on commit 144366d

Please sign in to comment.