]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/arp_tables.c
[NETFILTER]: nf_conntrack_ipv4: fix "Frag of proto ..." messages
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / arp_tables.c
index 5170f5c75f9d1742e4f47cfdc693543b744cfe10..d1149aba93515abf2a7d2f7629a16b8999e78788 100644 (file)
@@ -166,13 +166,9 @@ static inline int arp_packet_match(const struct arphdr *arphdr,
                return 0;
        }
 
-       for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-               unsigned long odev;
-               memcpy(&odev, outdev + i*sizeof(unsigned long),
-                      sizeof(unsigned long));
-               ret |= (odev
-                       ^ ((const unsigned long *)arpinfo->outiface)[i])
-                       & ((const unsigned long *)arpinfo->outiface_mask)[i];
+       for (i = 0, ret = 0; i < IFNAMSIZ; i++) {
+               ret |= (outdev[i] ^ arpinfo->outiface[i])
+                       & arpinfo->outiface_mask[i];
        }
 
        if (FWINV(ret != 0, ARPT_INV_VIA_OUT)) {
@@ -228,7 +224,7 @@ unsigned int arpt_do_table(struct sk_buff **pskb,
        static const char nulldevname[IFNAMSIZ];
        unsigned int verdict = NF_DROP;
        struct arphdr *arp;
-       int hotdrop = 0;
+       bool hotdrop = false;
        struct arpt_entry *e, *back;
        const char *indev, *outdev;
        void *table_base;
@@ -249,7 +245,7 @@ unsigned int arpt_do_table(struct sk_buff **pskb,
        e = get_entry(table_base, private->hook_entry[hook]);
        back = get_entry(table_base, private->underflow[hook]);
 
-       arp = (*pskb)->nh.arph;
+       arp = arp_hdr(*pskb);
        do {
                if (arp_packet_match(arp, (*pskb)->dev, indev, outdev, &e->arp)) {
                        struct arpt_entry_target *t;
@@ -301,7 +297,7 @@ unsigned int arpt_do_table(struct sk_buff **pskb,
                                                                     t->data);
 
                                /* Target might have changed stuff. */
-                               arp = (*pskb)->nh.arph;
+                               arp = arp_hdr(*pskb);
 
                                if (verdict == ARPT_CONTINUE)
                                        e = (void *)e + e->next_offset;
@@ -1144,13 +1140,13 @@ void arpt_unregister_table(struct arpt_table *table)
 }
 
 /* The built-in targets: standard (NULL) and error. */
-static struct arpt_target arpt_standard_target = {
+static struct arpt_target arpt_standard_target __read_mostly = {
        .name           = ARPT_STANDARD_TARGET,
        .targetsize     = sizeof(int),
        .family         = NF_ARP,
 };
 
-static struct arpt_target arpt_error_target = {
+static struct arpt_target arpt_error_target __read_mostly = {
        .name           = ARPT_ERROR_TARGET,
        .target         = arpt_error,
        .targetsize     = ARPT_FUNCTION_MAXNAMELEN,
@@ -1188,7 +1184,7 @@ static int __init arp_tables_init(void)
        if (ret < 0)
                goto err4;
 
-       printk("arp_tables: (C) 2002 David S. Miller\n");
+       printk(KERN_INFO "arp_tables: (C) 2002 David S. Miller\n");
        return 0;
 
 err4: