]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/bridge/netfilter/ebt_arp.c
[NETFILTER]: ebtables: remove casts, use consts
[net-next-2.6.git] / net / bridge / netfilter / ebt_arp.c
index 18141392a9b4eb87a45afc11902ae89249c7e7ac..933433ede38f8be276bd10389b16e1a10ef01b54 100644 (file)
@@ -18,8 +18,9 @@
 static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in,
    const struct net_device *out, const void *data, unsigned int datalen)
 {
-       struct ebt_arp_info *info = (struct ebt_arp_info *)data;
-       struct arphdr _arph, *ah;
+       const struct ebt_arp_info *info = data;
+       const struct arphdr *ah;
+       struct arphdr _arph;
 
        ah = skb_header_pointer(skb, 0, sizeof(_arph), &_arph);
        if (ah == NULL)
@@ -35,7 +36,8 @@ static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in
                return EBT_NOMATCH;
 
        if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_GRAT)) {
-               __be32 saddr, daddr, *sap, *dap;
+               const __be32 *sap, *dap;
+               __be32 saddr, daddr;
 
                if (ah->ar_pln != sizeof(__be32) || ah->ar_pro != htons(ETH_P_IP))
                        return EBT_NOMATCH;
@@ -61,7 +63,8 @@ static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in
        }
 
        if (info->bitmask & (EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC)) {
-               unsigned char _mac[ETH_ALEN], *mp;
+               const unsigned char *mp;
+               unsigned char _mac[ETH_ALEN];
                uint8_t verdict, i;
 
                if (ah->ar_hln != ETH_ALEN || ah->ar_hrd != htons(ARPHRD_ETHER))
@@ -100,7 +103,7 @@ static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in
 static int ebt_arp_check(const char *tablename, unsigned int hookmask,
    const struct ebt_entry *e, void *data, unsigned int datalen)
 {
-       struct ebt_arp_info *info = (struct ebt_arp_info *)data;
+       const struct ebt_arp_info *info = data;
 
        if (datalen != EBT_ALIGN(sizeof(struct ebt_arp_info)))
                return -EINVAL;