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