X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=net%2Fipv4%2Fnetfilter%2Farp_tables.c;fp=net%2Fipv4%2Fnetfilter%2Farp_tables.c;h=35c5f6a5cb7c8ee4dad9ad56eba517727ffefbc5;hb=01e6de64d9c8d0e75dca3bb4cf898db73abe00d4;hp=4f454ce9a602da8a6a6492cf5e4c0753ec3166fa;hpb=d271e8bd8c60ce059ee36d836ba063cfc61c3e21;p=linux-2.6-omap-h63xx.git diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index 4f454ce9a60..35c5f6a5cb7 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -76,6 +76,7 @@ static inline int arp_devaddr_compare(const struct arpt_devaddr_info *ap, /* * Unfortunatly, _b and _mask are not aligned to an int (or long int) * Some arches dont care, unrolling the loop is a win on them. + * For other arches, we only have a 16bit alignement. */ static unsigned long ifname_compare(const char *_a, const char *_b, const char *_mask) { @@ -83,10 +84,13 @@ static unsigned long ifname_compare(const char *_a, const char *_b, const char * unsigned long ret = ifname_compare_aligned(_a, _b, _mask); #else unsigned long ret = 0; + const u16 *a = (const u16 *)_a; + const u16 *b = (const u16 *)_b; + const u16 *mask = (const u16 *)_mask; int i; - for (i = 0; i < IFNAMSIZ; i++) - ret |= (_a[i] ^ _b[i]) & _mask[i]; + for (i = 0; i < IFNAMSIZ/sizeof(u16); i++) + ret |= (a[i] ^ b[i]) & mask[i]; #endif return ret; }