diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-01-11 19:06:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-13 00:18:33 -0500 |
commit | a2bd40ad3151d4d346fd167e01fb84b06f7247fc (patch) | |
tree | f5d703c8bcc2b91f23bc2e2310a2ef1f77d74f19 /net/bridge | |
parent | 88843104a19d5896bf67ab6bd685e976240dd04a (diff) |
netfilter 02/09: bridge: Fix handling of non-IP packets in FORWARD/POST_ROUTING
Currently the bridge FORWARD/POST_ROUTING chains treats all
non-IPv4 packets as IPv6. This packet fixes that by returning
NF_ACCEPT on non-IP packets instead, just as is done in PRE_ROUTING.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_netfilter.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index a65e43a17fbb..9a1cd757ec4e 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -686,8 +686,11 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb, | |||
686 | if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) || | 686 | if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) || |
687 | IS_PPPOE_IP(skb)) | 687 | IS_PPPOE_IP(skb)) |
688 | pf = PF_INET; | 688 | pf = PF_INET; |
689 | else | 689 | else if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) || |
690 | IS_PPPOE_IPV6(skb)) | ||
690 | pf = PF_INET6; | 691 | pf = PF_INET6; |
692 | else | ||
693 | return NF_ACCEPT; | ||
691 | 694 | ||
692 | nf_bridge_pull_encap_header(skb); | 695 | nf_bridge_pull_encap_header(skb); |
693 | 696 | ||
@@ -828,8 +831,11 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff *skb, | |||
828 | if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) || | 831 | if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) || |
829 | IS_PPPOE_IP(skb)) | 832 | IS_PPPOE_IP(skb)) |
830 | pf = PF_INET; | 833 | pf = PF_INET; |
831 | else | 834 | else if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) || |
835 | IS_PPPOE_IPV6(skb)) | ||
832 | pf = PF_INET6; | 836 | pf = PF_INET6; |
837 | else | ||
838 | return NF_ACCEPT; | ||
833 | 839 | ||
834 | #ifdef CONFIG_NETFILTER_DEBUG | 840 | #ifdef CONFIG_NETFILTER_DEBUG |
835 | if (skb->dst == NULL) { | 841 | if (skb->dst == NULL) { |