Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[NETFILTER] arp_tables: Fix unaligned accesses.
[IPV6] SNMP: Fix {In,Out}NoRoutes statistics.
[IPSEC] XFRM_USER: kernel panic when large security contexts in ACQUIRE
[VLAN]: Allow VLAN interface on top of bridge interface
[PKTGEN]: Add try_to_freeze()
[NETFILTER]: ipt_ULOG: use put_unaligned

+35 -24
+3
net/8021q/vlan_dev.c
··· 380 380 } else { 381 381 vhdr->h_vlan_encapsulated_proto = htons(len); 382 382 } 383 + 384 + skb->protocol = htons(ETH_P_8021Q); 385 + skb->nh.raw = skb->data; 383 386 } 384 387 385 388 /* Before delegating work to the lower layer, enter our MAC-address */
+3
net/core/pktgen.c
··· 129 129 #include <linux/ioport.h> 130 130 #include <linux/interrupt.h> 131 131 #include <linux/capability.h> 132 + #include <linux/freezer.h> 132 133 #include <linux/delay.h> 133 134 #include <linux/timer.h> 134 135 #include <linux/list.h> ··· 3333 3332 pktgen_rem_one_if(t); 3334 3333 t->control &= ~(T_REMDEV); 3335 3334 } 3335 + 3336 + try_to_freeze(); 3336 3337 3337 3338 set_current_state(TASK_INTERRUPTIBLE); 3338 3339 }
+3 -7
net/ipv4/netfilter/arp_tables.c
··· 166 166 return 0; 167 167 } 168 168 169 - for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) { 170 - unsigned long odev; 171 - memcpy(&odev, outdev + i*sizeof(unsigned long), 172 - sizeof(unsigned long)); 173 - ret |= (odev 174 - ^ ((const unsigned long *)arpinfo->outiface)[i]) 175 - & ((const unsigned long *)arpinfo->outiface_mask)[i]; 169 + for (i = 0, ret = 0; i < IFNAMSIZ; i++) { 170 + ret |= (outdev[i] ^ arpinfo->outiface[i]) 171 + & arpinfo->outiface_mask[i]; 176 172 } 177 173 178 174 if (FWINV(ret != 0, ARPT_INV_VIA_OUT)) {
+4 -3
net/ipv4/netfilter/ipt_ULOG.c
··· 61 61 #include <linux/netfilter_ipv4/ipt_ULOG.h> 62 62 #include <net/sock.h> 63 63 #include <linux/bitops.h> 64 + #include <asm/unaligned.h> 64 65 65 66 MODULE_LICENSE("GPL"); 66 67 MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>"); ··· 237 236 238 237 /* copy hook, prefix, timestamp, payload, etc. */ 239 238 pm->data_len = copy_len; 240 - pm->timestamp_sec = skb->tstamp.off_sec; 241 - pm->timestamp_usec = skb->tstamp.off_usec; 242 - pm->mark = skb->mark; 239 + put_unaligned(skb->tstamp.off_sec, &pm->timestamp_sec); 240 + put_unaligned(skb->tstamp.off_usec, &pm->timestamp_usec); 241 + put_unaligned(skb->mark, &pm->mark); 243 242 pm->hook = hooknum; 244 243 if (prefix != NULL) 245 244 strncpy(pm->prefix, prefix, sizeof(pm->prefix));
+19 -10
net/ipv6/route.c
··· 1766 1766 * Drop the packet on the floor 1767 1767 */ 1768 1768 1769 - static inline int ip6_pkt_drop(struct sk_buff *skb, int code) 1769 + static inline int ip6_pkt_drop(struct sk_buff *skb, int code, 1770 + int ipstats_mib_noroutes) 1770 1771 { 1771 - int type = ipv6_addr_type(&skb->nh.ipv6h->daddr); 1772 - if (type == IPV6_ADDR_ANY || type == IPV6_ADDR_RESERVED) 1773 - IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INADDRERRORS); 1774 - 1775 - IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_OUTNOROUTES); 1772 + int type; 1773 + switch (ipstats_mib_noroutes) { 1774 + case IPSTATS_MIB_INNOROUTES: 1775 + type = ipv6_addr_type(&skb->nh.ipv6h->daddr); 1776 + if (type == IPV6_ADDR_ANY || type == IPV6_ADDR_RESERVED) { 1777 + IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INADDRERRORS); 1778 + break; 1779 + } 1780 + /* FALLTHROUGH */ 1781 + case IPSTATS_MIB_OUTNOROUTES: 1782 + IP6_INC_STATS(ip6_dst_idev(skb->dst), ipstats_mib_noroutes); 1783 + break; 1784 + } 1776 1785 icmpv6_send(skb, ICMPV6_DEST_UNREACH, code, 0, skb->dev); 1777 1786 kfree_skb(skb); 1778 1787 return 0; ··· 1789 1780 1790 1781 static int ip6_pkt_discard(struct sk_buff *skb) 1791 1782 { 1792 - return ip6_pkt_drop(skb, ICMPV6_NOROUTE); 1783 + return ip6_pkt_drop(skb, ICMPV6_NOROUTE, IPSTATS_MIB_INNOROUTES); 1793 1784 } 1794 1785 1795 1786 static int ip6_pkt_discard_out(struct sk_buff *skb) 1796 1787 { 1797 1788 skb->dev = skb->dst->dev; 1798 - return ip6_pkt_discard(skb); 1789 + return ip6_pkt_drop(skb, ICMPV6_NOROUTE, IPSTATS_MIB_OUTNOROUTES); 1799 1790 } 1800 1791 1801 1792 #ifdef CONFIG_IPV6_MULTIPLE_TABLES 1802 1793 1803 1794 static int ip6_pkt_prohibit(struct sk_buff *skb) 1804 1795 { 1805 - return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED); 1796 + return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_INNOROUTES); 1806 1797 } 1807 1798 1808 1799 static int ip6_pkt_prohibit_out(struct sk_buff *skb) 1809 1800 { 1810 1801 skb->dev = skb->dst->dev; 1811 - return ip6_pkt_prohibit(skb); 1802 + return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); 1812 1803 } 1813 1804 1814 1805 static int ip6_pkt_blk_hole(struct sk_buff *skb)
+3 -4
net/xfrm/xfrm_user.c
··· 272 272 } 273 273 274 274 275 - static inline int xfrm_user_sec_ctx_size(struct xfrm_policy *xp) 275 + static inline int xfrm_user_sec_ctx_size(struct xfrm_sec_ctx *xfrm_ctx) 276 276 { 277 - struct xfrm_sec_ctx *xfrm_ctx = xp->security; 278 277 int len = 0; 279 278 280 279 if (xfrm_ctx) { ··· 2169 2170 2170 2171 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); 2171 2172 len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire)); 2172 - len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); 2173 + len += RTA_SPACE(xfrm_user_sec_ctx_size(x->security)); 2173 2174 #ifdef CONFIG_XFRM_SUB_POLICY 2174 2175 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); 2175 2176 #endif ··· 2279 2280 2280 2281 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); 2281 2282 len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire)); 2282 - len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); 2283 + len += RTA_SPACE(xfrm_user_sec_ctx_size(xp->security)); 2283 2284 #ifdef CONFIG_XFRM_SUB_POLICY 2284 2285 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); 2285 2286 #endif