aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorAlban Crequy <alban.crequy@collabora.co.uk>2012-05-13 23:56:36 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2012-06-07 08:58:42 -0400
commitaa740f46fbf3b1121a25d77c019e1ed3cc1260db (patch)
tree743f3d3b36d2e60a7c2d04c52baab6f7a50aa0d4 /net/bridge
parent3d33bf2bd83b27707f4bd31ba988bd4d4b92c7ad (diff)
netfilter: bridge: switch hook PFs to nfproto
This patch is a cleanup. Use NFPROTO_* for consistency with other netfilter code. Signed-off-by: Alban Crequy <alban.crequy@collabora.co.uk> Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Vincent Sanders <vincent.sanders@collabora.co.uk> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_netfilter.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index e41456bd3cc6..20fa719889ee 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -764,9 +764,9 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb,
764 return NF_DROP; 764 return NF_DROP;
765 765
766 if (IS_IP(skb) || IS_VLAN_IP(skb) || IS_PPPOE_IP(skb)) 766 if (IS_IP(skb) || IS_VLAN_IP(skb) || IS_PPPOE_IP(skb))
767 pf = PF_INET; 767 pf = NFPROTO_IPV4;
768 else if (IS_IPV6(skb) || IS_VLAN_IPV6(skb) || IS_PPPOE_IPV6(skb)) 768 else if (IS_IPV6(skb) || IS_VLAN_IPV6(skb) || IS_PPPOE_IPV6(skb))
769 pf = PF_INET6; 769 pf = NFPROTO_IPV6;
770 else 770 else
771 return NF_ACCEPT; 771 return NF_ACCEPT;
772 772
@@ -778,13 +778,13 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb,
778 nf_bridge->mask |= BRNF_PKT_TYPE; 778 nf_bridge->mask |= BRNF_PKT_TYPE;
779 } 779 }
780 780
781 if (pf == PF_INET && br_parse_ip_options(skb)) 781 if (pf == NFPROTO_IPV4 && br_parse_ip_options(skb))
782 return NF_DROP; 782 return NF_DROP;
783 783
784 /* The physdev module checks on this */ 784 /* The physdev module checks on this */
785 nf_bridge->mask |= BRNF_BRIDGED; 785 nf_bridge->mask |= BRNF_BRIDGED;
786 nf_bridge->physoutdev = skb->dev; 786 nf_bridge->physoutdev = skb->dev;
787 if (pf == PF_INET) 787 if (pf == NFPROTO_IPV4)
788 skb->protocol = htons(ETH_P_IP); 788 skb->protocol = htons(ETH_P_IP);
789 else 789 else
790 skb->protocol = htons(ETH_P_IPV6); 790 skb->protocol = htons(ETH_P_IPV6);
@@ -871,9 +871,9 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff *skb,
871 return NF_DROP; 871 return NF_DROP;
872 872
873 if (IS_IP(skb) || IS_VLAN_IP(skb) || IS_PPPOE_IP(skb)) 873 if (IS_IP(skb) || IS_VLAN_IP(skb) || IS_PPPOE_IP(skb))
874 pf = PF_INET; 874 pf = NFPROTO_IPV4;
875 else if (IS_IPV6(skb) || IS_VLAN_IPV6(skb) || IS_PPPOE_IPV6(skb)) 875 else if (IS_IPV6(skb) || IS_VLAN_IPV6(skb) || IS_PPPOE_IPV6(skb))
876 pf = PF_INET6; 876 pf = NFPROTO_IPV6;
877 else 877 else
878 return NF_ACCEPT; 878 return NF_ACCEPT;
879 879
@@ -886,7 +886,7 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff *skb,
886 886
887 nf_bridge_pull_encap_header(skb); 887 nf_bridge_pull_encap_header(skb);
888 nf_bridge_save_header(skb); 888 nf_bridge_save_header(skb);
889 if (pf == PF_INET) 889 if (pf == NFPROTO_IPV4)
890 skb->protocol = htons(ETH_P_IP); 890 skb->protocol = htons(ETH_P_IP);
891 else 891 else
892 skb->protocol = htons(ETH_P_IPV6); 892 skb->protocol = htons(ETH_P_IPV6);
@@ -919,49 +919,49 @@ static struct nf_hook_ops br_nf_ops[] __read_mostly = {
919 { 919 {
920 .hook = br_nf_pre_routing, 920 .hook = br_nf_pre_routing,
921 .owner = THIS_MODULE, 921 .owner = THIS_MODULE,
922 .pf = PF_BRIDGE, 922 .pf = NFPROTO_BRIDGE,
923 .hooknum = NF_BR_PRE_ROUTING, 923 .hooknum = NF_BR_PRE_ROUTING,
924 .priority = NF_BR_PRI_BRNF, 924 .priority = NF_BR_PRI_BRNF,
925 }, 925 },
926 { 926 {
927 .hook = br_nf_local_in, 927 .hook = br_nf_local_in,
928 .owner = THIS_MODULE, 928 .owner = THIS_MODULE,
929 .pf = PF_BRIDGE, 929 .pf = NFPROTO_BRIDGE,
930 .hooknum = NF_BR_LOCAL_IN, 930 .hooknum = NF_BR_LOCAL_IN,
931 .priority = NF_BR_PRI_BRNF, 931 .priority = NF_BR_PRI_BRNF,
932 }, 932 },
933 { 933 {
934 .hook = br_nf_forward_ip, 934 .hook = br_nf_forward_ip,
935 .owner = THIS_MODULE, 935 .owner = THIS_MODULE,
936 .pf = PF_BRIDGE, 936 .pf = NFPROTO_BRIDGE,
937 .hooknum = NF_BR_FORWARD, 937 .hooknum = NF_BR_FORWARD,
938 .priority = NF_BR_PRI_BRNF - 1, 938 .priority = NF_BR_PRI_BRNF - 1,
939 }, 939 },
940 { 940 {
941 .hook = br_nf_forward_arp, 941 .hook = br_nf_forward_arp,
942 .owner = THIS_MODULE, 942 .owner = THIS_MODULE,
943 .pf = PF_BRIDGE, 943 .pf = NFPROTO_BRIDGE,
944 .hooknum = NF_BR_FORWARD, 944 .hooknum = NF_BR_FORWARD,
945 .priority = NF_BR_PRI_BRNF, 945 .priority = NF_BR_PRI_BRNF,
946 }, 946 },
947 { 947 {
948 .hook = br_nf_post_routing, 948 .hook = br_nf_post_routing,
949 .owner = THIS_MODULE, 949 .owner = THIS_MODULE,
950 .pf = PF_BRIDGE, 950 .pf = NFPROTO_BRIDGE,
951 .hooknum = NF_BR_POST_ROUTING, 951 .hooknum = NF_BR_POST_ROUTING,
952 .priority = NF_BR_PRI_LAST, 952 .priority = NF_BR_PRI_LAST,
953 }, 953 },
954 { 954 {
955 .hook = ip_sabotage_in, 955 .hook = ip_sabotage_in,
956 .owner = THIS_MODULE, 956 .owner = THIS_MODULE,
957 .pf = PF_INET, 957 .pf = NFPROTO_IPV4,
958 .hooknum = NF_INET_PRE_ROUTING, 958 .hooknum = NF_INET_PRE_ROUTING,
959 .priority = NF_IP_PRI_FIRST, 959 .priority = NF_IP_PRI_FIRST,
960 }, 960 },
961 { 961 {
962 .hook = ip_sabotage_in, 962 .hook = ip_sabotage_in,
963 .owner = THIS_MODULE, 963 .owner = THIS_MODULE,
964 .pf = PF_INET6, 964 .pf = NFPROTO_IPV6,
965 .hooknum = NF_INET_PRE_ROUTING, 965 .hooknum = NF_INET_PRE_ROUTING,
966 .priority = NF_IP6_PRI_FIRST, 966 .priority = NF_IP6_PRI_FIRST,
967 }, 967 },