aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/802/tr.c2
-rw-r--r--net/8021q/vlan.c7
-rw-r--r--net/atm/mpc.c7
-rw-r--r--net/ax25/af_ax25.c51
-rw-r--r--net/ax25/ax25_in.c2
-rw-r--r--net/bluetooth/hci_conn.c10
-rw-r--r--net/bluetooth/hci_sysfs.c1
-rw-r--r--net/bluetooth/rfcomm/tty.c22
-rw-r--r--net/bridge/br_netfilter.c45
-rw-r--r--net/compat.c2
-rw-r--r--net/core/dev.c10
-rw-r--r--net/core/rtnetlink.c5
-rw-r--r--net/core/scm.c2
-rw-r--r--net/core/skbuff.c11
-rw-r--r--net/dccp/ackvec.h2
-rw-r--r--net/dccp/ccids/ccid3.c2
-rw-r--r--net/decnet/dn_route.c6
-rw-r--r--net/ipv4/arp.c3
-rw-r--r--net/ipv4/devinet.c2
-rw-r--r--net/ipv4/fib_frontend.c9
-rw-r--r--net/ipv4/fib_hash.c23
-rw-r--r--net/ipv4/fib_trie.c3
-rw-r--r--net/ipv4/icmp.c1
-rw-r--r--net/ipv4/inet_lro.c16
-rw-r--r--net/ipv4/ip_gre.c2
-rw-r--r--net/ipv4/ipconfig.c27
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c3
-rw-r--r--net/ipv4/netfilter/nf_nat_sip.c2
-rw-r--r--net/ipv4/raw.c4
-rw-r--r--net/ipv4/route.c14
-rw-r--r--net/ipv4/tcp_input.c19
-rw-r--r--net/ipv6/datagram.c6
-rw-r--r--net/ipv6/icmp.c2
-rw-r--r--net/ipv6/inet6_hashtables.c2
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/ipv6/netfilter/ip6t_eui64.c2
-rw-r--r--net/ipv6/proc.c4
-rw-r--r--net/ipv6/route.c11
-rw-r--r--net/irda/af_irda.c32
-rw-r--r--net/irda/ircomm/ircomm_param.c2
-rw-r--r--net/irda/irlan/irlan_eth.c2
-rw-r--r--net/irda/irlap_frame.c2
-rw-r--r--net/irda/parameters.c12
-rw-r--r--net/irda/wrapper.c2
-rw-r--r--net/key/af_key.c30
-rw-r--r--net/mac80211/ieee80211.c1
-rw-r--r--net/mac80211/ieee80211_ioctl.c6
-rw-r--r--net/mac80211/ieee80211_rate.c2
-rw-r--r--net/mac80211/ieee80211_sta.c8
-rw-r--r--net/mac80211/rx.c13
-rw-r--r--net/mac80211/sta_info.c7
-rw-r--r--net/netfilter/nf_conntrack_core.c5
-rw-r--r--net/netfilter/nf_conntrack_sip.c4
-rw-r--r--net/netfilter/xt_helper.c4
-rw-r--r--net/netlabel/netlabel_mgmt.c2
-rw-r--r--net/netrom/nr_dev.c2
-rw-r--r--net/rfkill/rfkill.c5
-rw-r--r--net/sched/sch_hfsc.c2
-rw-r--r--net/sctp/sm_make_chunk.c14
-rw-r--r--net/sctp/sm_statefuns.c22
-rw-r--r--net/sctp/ulpevent.c2
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c2
-rw-r--r--net/x25/x25_forward.c5
-rw-r--r--net/xfrm/xfrm_policy.c4
-rw-r--r--net/xfrm/xfrm_state.c6
-rw-r--r--net/xfrm/xfrm_user.c17
66 files changed, 341 insertions, 218 deletions
diff --git a/net/802/tr.c b/net/802/tr.c
index a2bd0f2e3af8..1e115e5beab6 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -642,7 +642,7 @@ struct net_device *alloc_trdev(int sizeof_priv)
642static int __init rif_init(void) 642static int __init rif_init(void)
643{ 643{
644 init_timer(&rif_timer); 644 init_timer(&rif_timer);
645 rif_timer.expires = sysctl_tr_rif_timeout; 645 rif_timer.expires = jiffies + sysctl_tr_rif_timeout;
646 rif_timer.data = 0L; 646 rif_timer.data = 0L;
647 rif_timer.function = rif_check_expire; 647 rif_timer.function = rif_check_expire;
648 add_timer(&rif_timer); 648 add_timer(&rif_timer);
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 4add9bd4bc8d..032bf44eca5e 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -323,6 +323,7 @@ static const struct header_ops vlan_header_ops = {
323static int vlan_dev_init(struct net_device *dev) 323static int vlan_dev_init(struct net_device *dev)
324{ 324{
325 struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev; 325 struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
326 int subclass = 0;
326 327
327 /* IFF_BROADCAST|IFF_MULTICAST; ??? */ 328 /* IFF_BROADCAST|IFF_MULTICAST; ??? */
328 dev->flags = real_dev->flags & ~IFF_UP; 329 dev->flags = real_dev->flags & ~IFF_UP;
@@ -349,7 +350,11 @@ static int vlan_dev_init(struct net_device *dev)
349 dev->hard_start_xmit = vlan_dev_hard_start_xmit; 350 dev->hard_start_xmit = vlan_dev_hard_start_xmit;
350 } 351 }
351 352
352 lockdep_set_class(&dev->_xmit_lock, &vlan_netdev_xmit_lock_key); 353 if (real_dev->priv_flags & IFF_802_1Q_VLAN)
354 subclass = 1;
355
356 lockdep_set_class_and_subclass(&dev->_xmit_lock,
357 &vlan_netdev_xmit_lock_key, subclass);
353 return 0; 358 return 0;
354} 359}
355 360
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 2086396de177..9c7f712fc7e9 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -542,6 +542,13 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
542 if (eth->h_proto != htons(ETH_P_IP)) 542 if (eth->h_proto != htons(ETH_P_IP))
543 goto non_ip; /* Multi-Protocol Over ATM :-) */ 543 goto non_ip; /* Multi-Protocol Over ATM :-) */
544 544
545 /* Weed out funny packets (e.g., AF_PACKET or raw). */
546 if (skb->len < ETH_HLEN + sizeof(struct iphdr))
547 goto non_ip;
548 skb_set_network_header(skb, ETH_HLEN);
549 if (skb->len < ETH_HLEN + ip_hdr(skb)->ihl * 4 || ip_hdr(skb)->ihl < 5)
550 goto non_ip;
551
545 while (i < mpc->number_of_mps_macs) { 552 while (i < mpc->number_of_mps_macs) {
546 if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN))) 553 if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN)))
547 if ( send_via_shortcut(skb, mpc) == 0 ) /* try shortcut */ 554 if ( send_via_shortcut(skb, mpc) == 0 ) /* try shortcut */
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 8378afd54b30..b4725ff317c0 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -87,10 +87,22 @@ static void ax25_kill_by_device(struct net_device *dev)
87 return; 87 return;
88 88
89 spin_lock_bh(&ax25_list_lock); 89 spin_lock_bh(&ax25_list_lock);
90again:
90 ax25_for_each(s, node, &ax25_list) { 91 ax25_for_each(s, node, &ax25_list) {
91 if (s->ax25_dev == ax25_dev) { 92 if (s->ax25_dev == ax25_dev) {
92 s->ax25_dev = NULL; 93 s->ax25_dev = NULL;
94 spin_unlock_bh(&ax25_list_lock);
93 ax25_disconnect(s, ENETUNREACH); 95 ax25_disconnect(s, ENETUNREACH);
96 spin_lock_bh(&ax25_list_lock);
97
98 /* The entry could have been deleted from the
99 * list meanwhile and thus the next pointer is
100 * no longer valid. Play it safe and restart
101 * the scan. Forward progress is ensured
102 * because we set s->ax25_dev to NULL and we
103 * are never passed a NULL 'dev' argument.
104 */
105 goto again;
94 } 106 }
95 } 107 }
96 spin_unlock_bh(&ax25_list_lock); 108 spin_unlock_bh(&ax25_list_lock);
@@ -1109,21 +1121,19 @@ static int __must_check ax25_connect(struct socket *sock,
1109 * some sanity checks. code further down depends on this 1121 * some sanity checks. code further down depends on this
1110 */ 1122 */
1111 1123
1112 if (addr_len == sizeof(struct sockaddr_ax25)) { 1124 if (addr_len == sizeof(struct sockaddr_ax25))
1113 /* support for this will go away in early 2.5.x */ 1125 /* support for this will go away in early 2.5.x
1114 printk(KERN_WARNING "ax25_connect(): %s uses obsolete socket structure\n", 1126 * ax25_connect(): uses obsolete socket structure
1115 current->comm); 1127 */
1116 } 1128 ;
1117 else if (addr_len != sizeof(struct full_sockaddr_ax25)) { 1129 else if (addr_len != sizeof(struct full_sockaddr_ax25))
1118 /* support for old structure may go away some time */ 1130 /* support for old structure may go away some time
1131 * ax25_connect(): uses old (6 digipeater) socket structure.
1132 */
1119 if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) || 1133 if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
1120 (addr_len > sizeof(struct full_sockaddr_ax25))) { 1134 (addr_len > sizeof(struct full_sockaddr_ax25)))
1121 return -EINVAL; 1135 return -EINVAL;
1122 }
1123 1136
1124 printk(KERN_WARNING "ax25_connect(): %s uses old (6 digipeater) socket structure.\n",
1125 current->comm);
1126 }
1127 1137
1128 if (fsa->fsa_ax25.sax25_family != AF_AX25) 1138 if (fsa->fsa_ax25.sax25_family != AF_AX25)
1129 return -EINVAL; 1139 return -EINVAL;
@@ -1467,21 +1477,20 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
1467 goto out; 1477 goto out;
1468 } 1478 }
1469 1479
1470 if (addr_len == sizeof(struct sockaddr_ax25)) { 1480 if (addr_len == sizeof(struct sockaddr_ax25))
1471 printk(KERN_WARNING "ax25_sendmsg(): %s uses obsolete socket structure\n", 1481 /* ax25_sendmsg(): uses obsolete socket structure */
1472 current->comm); 1482 ;
1473 } 1483 else if (addr_len != sizeof(struct full_sockaddr_ax25))
1474 else if (addr_len != sizeof(struct full_sockaddr_ax25)) { 1484 /* support for old structure may go away some time
1475 /* support for old structure may go away some time */ 1485 * ax25_sendmsg(): uses old (6 digipeater)
1486 * socket structure.
1487 */
1476 if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) || 1488 if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
1477 (addr_len > sizeof(struct full_sockaddr_ax25))) { 1489 (addr_len > sizeof(struct full_sockaddr_ax25))) {
1478 err = -EINVAL; 1490 err = -EINVAL;
1479 goto out; 1491 goto out;
1480 } 1492 }
1481 1493
1482 printk(KERN_WARNING "ax25_sendmsg(): %s uses old (6 digipeater) socket structure.\n",
1483 current->comm);
1484 }
1485 1494
1486 if (addr_len > sizeof(struct sockaddr_ax25) && usax->sax25_ndigis != 0) { 1495 if (addr_len > sizeof(struct sockaddr_ax25) && usax->sax25_ndigis != 0) {
1487 int ct = 0; 1496 int ct = 0;
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index 3b7d1720c2ee..d1be080dcb25 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -124,7 +124,7 @@ int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb)
124 } 124 }
125 125
126 skb_pull(skb, 1); /* Remove PID */ 126 skb_pull(skb, 1); /* Remove PID */
127 skb_reset_mac_header(skb); 127 skb->mac_header = skb->network_header;
128 skb_reset_network_header(skb); 128 skb_reset_network_header(skb);
129 skb->dev = ax25->ax25_dev->dev; 129 skb->dev = ax25->ax25_dev->dev;
130 skb->pkt_type = PACKET_HOST; 130 skb->pkt_type = PACKET_HOST;
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 9483320f6dad..34d1a3c822bf 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -259,22 +259,14 @@ int hci_conn_del(struct hci_conn *conn)
259 } 259 }
260 260
261 tasklet_disable(&hdev->tx_task); 261 tasklet_disable(&hdev->tx_task);
262
263 hci_conn_del_sysfs(conn);
264
265 hci_conn_hash_del(hdev, conn); 262 hci_conn_hash_del(hdev, conn);
266 if (hdev->notify) 263 if (hdev->notify)
267 hdev->notify(hdev, HCI_NOTIFY_CONN_DEL); 264 hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);
268
269 tasklet_enable(&hdev->tx_task); 265 tasklet_enable(&hdev->tx_task);
270
271 skb_queue_purge(&conn->data_q); 266 skb_queue_purge(&conn->data_q);
272 267 hci_conn_del_sysfs(conn);
273 hci_dev_put(hdev); 268 hci_dev_put(hdev);
274 269
275 /* will free via device release */
276 put_device(&conn->dev);
277
278 return 0; 270 return 0;
279} 271}
280 272
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index cef1e3e1881c..cad510309dcf 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -320,6 +320,7 @@ static void del_conn(struct work_struct *work)
320{ 320{
321 struct hci_conn *conn = container_of(work, struct hci_conn, work); 321 struct hci_conn *conn = container_of(work, struct hci_conn, work);
322 device_del(&conn->dev); 322 device_del(&conn->dev);
323 put_device(&conn->dev);
323} 324}
324 325
325void hci_conn_del_sysfs(struct hci_conn *conn) 326void hci_conn_del_sysfs(struct hci_conn *conn)
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index e447651a2dbe..a6a758dd1f7d 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -95,9 +95,10 @@ static void rfcomm_dev_destruct(struct rfcomm_dev *dev)
95 95
96 BT_DBG("dev %p dlc %p", dev, dlc); 96 BT_DBG("dev %p dlc %p", dev, dlc);
97 97
98 write_lock_bh(&rfcomm_dev_lock); 98 /* Refcount should only hit zero when called from rfcomm_dev_del()
99 list_del_init(&dev->list); 99 which will have taken us off the list. Everything else are
100 write_unlock_bh(&rfcomm_dev_lock); 100 refcounting bugs. */
101 BUG_ON(!list_empty(&dev->list));
101 102
102 rfcomm_dlc_lock(dlc); 103 rfcomm_dlc_lock(dlc);
103 /* Detach DLC if it's owned by this dev */ 104 /* Detach DLC if it's owned by this dev */
@@ -109,11 +110,6 @@ static void rfcomm_dev_destruct(struct rfcomm_dev *dev)
109 110
110 tty_unregister_device(rfcomm_tty_driver, dev->id); 111 tty_unregister_device(rfcomm_tty_driver, dev->id);
111 112
112 /* Refcount should only hit zero when called from rfcomm_dev_del()
113 which will have taken us off the list. Everything else are
114 refcounting bugs. */
115 BUG_ON(!list_empty(&dev->list));
116
117 kfree(dev); 113 kfree(dev);
118 114
119 /* It's safe to call module_put() here because socket still 115 /* It's safe to call module_put() here because socket still
@@ -313,7 +309,15 @@ static void rfcomm_dev_del(struct rfcomm_dev *dev)
313{ 309{
314 BT_DBG("dev %p", dev); 310 BT_DBG("dev %p", dev);
315 311
316 set_bit(RFCOMM_TTY_RELEASED, &dev->flags); 312 if (test_bit(RFCOMM_TTY_RELEASED, &dev->flags))
313 BUG_ON(1);
314 else
315 set_bit(RFCOMM_TTY_RELEASED, &dev->flags);
316
317 write_lock_bh(&rfcomm_dev_lock);
318 list_del_init(&dev->list);
319 write_unlock_bh(&rfcomm_dev_lock);
320
317 rfcomm_dev_put(dev); 321 rfcomm_dev_put(dev);
318} 322}
319 323
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index c1757c79dfbb..9f78a69d6b8b 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -142,6 +142,23 @@ static inline struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
142 return skb->nf_bridge; 142 return skb->nf_bridge;
143} 143}
144 144
145static inline struct nf_bridge_info *nf_bridge_unshare(struct sk_buff *skb)
146{
147 struct nf_bridge_info *nf_bridge = skb->nf_bridge;
148
149 if (atomic_read(&nf_bridge->use) > 1) {
150 struct nf_bridge_info *tmp = nf_bridge_alloc(skb);
151
152 if (tmp) {
153 memcpy(tmp, nf_bridge, sizeof(struct nf_bridge_info));
154 atomic_set(&tmp->use, 1);
155 nf_bridge_put(nf_bridge);
156 }
157 nf_bridge = tmp;
158 }
159 return nf_bridge;
160}
161
145static inline void nf_bridge_push_encap_header(struct sk_buff *skb) 162static inline void nf_bridge_push_encap_header(struct sk_buff *skb)
146{ 163{
147 unsigned int len = nf_bridge_encap_header_len(skb); 164 unsigned int len = nf_bridge_encap_header_len(skb);
@@ -247,8 +264,9 @@ static void __br_dnat_complain(void)
247 * Let us first consider the case that ip_route_input() succeeds: 264 * Let us first consider the case that ip_route_input() succeeds:
248 * 265 *
249 * If skb->dst->dev equals the logical bridge device the packet 266 * If skb->dst->dev equals the logical bridge device the packet
250 * came in on, we can consider this bridging. We then call 267 * came in on, we can consider this bridging. The packet is passed
251 * skb->dst->output() which will make the packet enter br_nf_local_out() 268 * through the neighbour output function to build a new destination
269 * MAC address, which will make the packet enter br_nf_local_out()
252 * not much later. In that function it is assured that the iptables 270 * not much later. In that function it is assured that the iptables
253 * FORWARD chain is traversed for the packet. 271 * FORWARD chain is traversed for the packet.
254 * 272 *
@@ -285,12 +303,17 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
285 skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; 303 skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
286 304
287 skb->dev = bridge_parent(skb->dev); 305 skb->dev = bridge_parent(skb->dev);
288 if (!skb->dev) 306 if (skb->dev) {
289 kfree_skb(skb); 307 struct dst_entry *dst = skb->dst;
290 else { 308
291 nf_bridge_pull_encap_header(skb); 309 nf_bridge_pull_encap_header(skb);
292 skb->dst->output(skb); 310
311 if (dst->hh)
312 return neigh_hh_output(dst->hh, skb);
313 else if (dst->neighbour)
314 return dst->neighbour->output(skb);
293 } 315 }
316 kfree_skb(skb);
294 return 0; 317 return 0;
295} 318}
296 319
@@ -631,6 +654,11 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb,
631 if (!skb->nf_bridge) 654 if (!skb->nf_bridge)
632 return NF_ACCEPT; 655 return NF_ACCEPT;
633 656
657 /* Need exclusive nf_bridge_info since we might have multiple
658 * different physoutdevs. */
659 if (!nf_bridge_unshare(skb))
660 return NF_DROP;
661
634 parent = bridge_parent(out); 662 parent = bridge_parent(out);
635 if (!parent) 663 if (!parent)
636 return NF_DROP; 664 return NF_DROP;
@@ -712,6 +740,11 @@ static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff *skb,
712 if (!skb->nf_bridge) 740 if (!skb->nf_bridge)
713 return NF_ACCEPT; 741 return NF_ACCEPT;
714 742
743 /* Need exclusive nf_bridge_info since we might have multiple
744 * different physoutdevs. */
745 if (!nf_bridge_unshare(skb))
746 return NF_DROP;
747
715 nf_bridge = skb->nf_bridge; 748 nf_bridge = skb->nf_bridge;
716 if (!(nf_bridge->mask & BRNF_BRIDGED_DNAT)) 749 if (!(nf_bridge->mask & BRNF_BRIDGED_DNAT))
717 return NF_ACCEPT; 750 return NF_ACCEPT;
diff --git a/net/compat.c b/net/compat.c
index d74d82155d78..377e560ab5c9 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -254,6 +254,8 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
254 if (copy_to_user(CMSG_COMPAT_DATA(cm), data, cmlen - sizeof(struct compat_cmsghdr))) 254 if (copy_to_user(CMSG_COMPAT_DATA(cm), data, cmlen - sizeof(struct compat_cmsghdr)))
255 return -EFAULT; 255 return -EFAULT;
256 cmlen = CMSG_COMPAT_SPACE(len); 256 cmlen = CMSG_COMPAT_SPACE(len);
257 if (kmsg->msg_controllen < cmlen)
258 cmlen = kmsg->msg_controllen;
257 kmsg->msg_control += cmlen; 259 kmsg->msg_control += cmlen;
258 kmsg->msg_controllen -= cmlen; 260 kmsg->msg_controllen -= cmlen;
259 return 0; 261 return 0;
diff --git a/net/core/dev.c b/net/core/dev.c
index 26a3a3a15be0..0879f52115eb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2207,8 +2207,12 @@ static void net_rx_action(struct softirq_action *h)
2207 * still "owns" the NAPI instance and therefore can 2207 * still "owns" the NAPI instance and therefore can
2208 * move the instance around on the list at-will. 2208 * move the instance around on the list at-will.
2209 */ 2209 */
2210 if (unlikely(work == weight)) 2210 if (unlikely(work == weight)) {
2211 list_move_tail(&n->poll_list, list); 2211 if (unlikely(napi_disable_pending(n)))
2212 __napi_complete(n);
2213 else
2214 list_move_tail(&n->poll_list, list);
2215 }
2212 2216
2213 netpoll_poll_unlock(have); 2217 netpoll_poll_unlock(have);
2214 } 2218 }
@@ -2819,7 +2823,7 @@ void dev_set_allmulti(struct net_device *dev, int inc)
2819/* 2823/*
2820 * Upload unicast and multicast address lists to device and 2824 * Upload unicast and multicast address lists to device and
2821 * configure RX filtering. When the device doesn't support unicast 2825 * configure RX filtering. When the device doesn't support unicast
2822 * filtering it is put in promiscous mode while unicast addresses 2826 * filtering it is put in promiscuous mode while unicast addresses
2823 * are present. 2827 * are present.
2824 */ 2828 */
2825void __dev_set_rx_mode(struct net_device *dev) 2829void __dev_set_rx_mode(struct net_device *dev)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index e1ba26fb4bf2..fed95a323b28 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -308,9 +308,12 @@ void __rtnl_link_unregister(struct rtnl_link_ops *ops)
308 struct net *net; 308 struct net *net;
309 309
310 for_each_net(net) { 310 for_each_net(net) {
311restart:
311 for_each_netdev_safe(net, dev, n) { 312 for_each_netdev_safe(net, dev, n) {
312 if (dev->rtnl_link_ops == ops) 313 if (dev->rtnl_link_ops == ops) {
313 ops->dellink(dev); 314 ops->dellink(dev);
315 goto restart;
316 }
314 } 317 }
315 } 318 }
316 list_del(&ops->list); 319 list_del(&ops->list);
diff --git a/net/core/scm.c b/net/core/scm.c
index 100ba6d9d478..10f5c65f6a47 100644
--- a/net/core/scm.c
+++ b/net/core/scm.c
@@ -196,6 +196,8 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
196 if (copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr))) 196 if (copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr)))
197 goto out; 197 goto out;
198 cmlen = CMSG_SPACE(len); 198 cmlen = CMSG_SPACE(len);
199 if (msg->msg_controllen < cmlen)
200 cmlen = msg->msg_controllen;
199 msg->msg_control += cmlen; 201 msg->msg_control += cmlen;
200 msg->msg_controllen -= cmlen; 202 msg->msg_controllen -= cmlen;
201 err = 0; 203 err = 0;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 5b4ce9b4dd20..b6283779e93d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -416,16 +416,17 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
416 C(len); 416 C(len);
417 C(data_len); 417 C(data_len);
418 C(mac_len); 418 C(mac_len);
419 n->cloned = 1;
420 n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len; 419 n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len;
420 n->cloned = 1;
421 n->nohdr = 0; 421 n->nohdr = 0;
422 n->destructor = NULL; 422 n->destructor = NULL;
423 C(truesize); 423 C(iif);
424 atomic_set(&n->users, 1);
425 C(head);
426 C(data);
427 C(tail); 424 C(tail);
428 C(end); 425 C(end);
426 C(head);
427 C(data);
428 C(truesize);
429 atomic_set(&n->users, 1);
429 430
430 atomic_inc(&(skb_shinfo(skb)->dataref)); 431 atomic_inc(&(skb_shinfo(skb)->dataref));
431 skb->cloned = 1; 432 skb->cloned = 1;
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h
index 9ef0737043ee..9671ecd17e00 100644
--- a/net/dccp/ackvec.h
+++ b/net/dccp/ackvec.h
@@ -71,7 +71,7 @@ struct dccp_ackvec {
71 * @dccpavr_ack_ackno - sequence number being acknowledged 71 * @dccpavr_ack_ackno - sequence number being acknowledged
72 * @dccpavr_ack_ptr - pointer into dccpav_buf where this record starts 72 * @dccpavr_ack_ptr - pointer into dccpav_buf where this record starts
73 * @dccpavr_ack_nonce - dccpav_ack_nonce at the time this record was sent 73 * @dccpavr_ack_nonce - dccpav_ack_nonce at the time this record was sent
74 * @dccpavr_sent_len - lenght of the record in dccpav_buf 74 * @dccpavr_sent_len - length of the record in dccpav_buf
75 */ 75 */
76struct dccp_ackvec_record { 76struct dccp_ackvec_record {
77 struct list_head dccpavr_node; 77 struct list_head dccpavr_node;
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 19b33586333d..d133416d3970 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -239,7 +239,7 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
239 ccid3_tx_state_name(hctx->ccid3hctx_state), 239 ccid3_tx_state_name(hctx->ccid3hctx_state),
240 (unsigned)(hctx->ccid3hctx_x >> 6)); 240 (unsigned)(hctx->ccid3hctx_x >> 6));
241 /* The value of R is still undefined and so we can not recompute 241 /* The value of R is still undefined and so we can not recompute
242 * the timout value. Keep initial value as per [RFC 4342, 5]. */ 242 * the timeout value. Keep initial value as per [RFC 4342, 5]. */
243 t_nfb = TFRC_INITIAL_TIMEOUT; 243 t_nfb = TFRC_INITIAL_TIMEOUT;
244 ccid3_update_send_interval(hctx); 244 ccid3_update_send_interval(hctx);
245 break; 245 break;
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 66663e5d7acd..0e10ff21e292 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1665,12 +1665,12 @@ static struct dn_route *dn_rt_cache_get_first(struct seq_file *seq)
1665 break; 1665 break;
1666 rcu_read_unlock_bh(); 1666 rcu_read_unlock_bh();
1667 } 1667 }
1668 return rt; 1668 return rcu_dereference(rt);
1669} 1669}
1670 1670
1671static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct dn_route *rt) 1671static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct dn_route *rt)
1672{ 1672{
1673 struct dn_rt_cache_iter_state *s = rcu_dereference(seq->private); 1673 struct dn_rt_cache_iter_state *s = seq->private;
1674 1674
1675 rt = rt->u.dst.dn_next; 1675 rt = rt->u.dst.dn_next;
1676 while(!rt) { 1676 while(!rt) {
@@ -1680,7 +1680,7 @@ static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct dn_rou
1680 rcu_read_lock_bh(); 1680 rcu_read_lock_bh();
1681 rt = dn_rt_hash_table[s->bucket].chain; 1681 rt = dn_rt_hash_table[s->bucket].chain;
1682 } 1682 }
1683 return rt; 1683 return rcu_dereference(rt);
1684} 1684}
1685 1685
1686static void *dn_rt_cache_seq_start(struct seq_file *seq, loff_t *pos) 1686static void *dn_rt_cache_seq_start(struct seq_file *seq, loff_t *pos)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index b3f366a33a5c..08174a2aa878 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -706,7 +706,7 @@ static int arp_process(struct sk_buff *skb)
706 struct arphdr *arp; 706 struct arphdr *arp;
707 unsigned char *arp_ptr; 707 unsigned char *arp_ptr;
708 struct rtable *rt; 708 struct rtable *rt;
709 unsigned char *sha, *tha; 709 unsigned char *sha;
710 __be32 sip, tip; 710 __be32 sip, tip;
711 u16 dev_type = dev->type; 711 u16 dev_type = dev->type;
712 int addr_type; 712 int addr_type;
@@ -771,7 +771,6 @@ static int arp_process(struct sk_buff *skb)
771 arp_ptr += dev->addr_len; 771 arp_ptr += dev->addr_len;
772 memcpy(&sip, arp_ptr, 4); 772 memcpy(&sip, arp_ptr, 4);
773 arp_ptr += 4; 773 arp_ptr += 4;
774 tha = arp_ptr;
775 arp_ptr += dev->addr_len; 774 arp_ptr += dev->addr_len;
776 memcpy(&tip, arp_ptr, 4); 775 memcpy(&tip, arp_ptr, 4);
777/* 776/*
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 3168c3de4919..b42f74617bac 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1027,7 +1027,7 @@ static void inetdev_changename(struct net_device *dev, struct in_device *in_dev)
1027 memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); 1027 memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
1028 if (named++ == 0) 1028 if (named++ == 0)
1029 continue; 1029 continue;
1030 dot = strchr(ifa->ifa_label, ':'); 1030 dot = strchr(old, ':');
1031 if (dot == NULL) { 1031 if (dot == NULL) {
1032 sprintf(old, ":%d", named); 1032 sprintf(old, ":%d", named);
1033 dot = old; 1033 dot = old;
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 732d8f088b13..97abf934d185 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -804,10 +804,13 @@ static void nl_fib_input(struct sk_buff *skb)
804 804
805 nlh = nlmsg_hdr(skb); 805 nlh = nlmsg_hdr(skb);
806 if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len || 806 if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len ||
807 nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) { 807 nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn)))
808 kfree_skb(skb);
809 return; 808 return;
810 } 809
810 skb = skb_clone(skb, GFP_KERNEL);
811 if (skb == NULL)
812 return;
813 nlh = nlmsg_hdr(skb);
811 814
812 frn = (struct fib_result_nl *) NLMSG_DATA(nlh); 815 frn = (struct fib_result_nl *) NLMSG_DATA(nlh);
813 tb = fib_get_table(frn->tb_id_in); 816 tb = fib_get_table(frn->tb_id_in);
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 527a6e0af5b6..0dfee27cfbcd 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -444,6 +444,9 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
444 struct fib_info *fi_drop; 444 struct fib_info *fi_drop;
445 u8 state; 445 u8 state;
446 446
447 if (fi->fib_treeref > 1)
448 goto out;
449
447 write_lock_bh(&fib_hash_lock); 450 write_lock_bh(&fib_hash_lock);
448 fi_drop = fa->fa_info; 451 fi_drop = fa->fa_info;
449 fa->fa_info = fi; 452 fa->fa_info = fi;
@@ -718,19 +721,18 @@ fn_hash_dump_zone(struct sk_buff *skb, struct netlink_callback *cb,
718{ 721{
719 int h, s_h; 722 int h, s_h;
720 723
724 if (fz->fz_hash == NULL)
725 return skb->len;
721 s_h = cb->args[3]; 726 s_h = cb->args[3];
722 for (h=0; h < fz->fz_divisor; h++) { 727 for (h = s_h; h < fz->fz_divisor; h++) {
723 if (h < s_h) continue; 728 if (hlist_empty(&fz->fz_hash[h]))
724 if (h > s_h)
725 memset(&cb->args[4], 0,
726 sizeof(cb->args) - 4*sizeof(cb->args[0]));
727 if (fz->fz_hash == NULL ||
728 hlist_empty(&fz->fz_hash[h]))
729 continue; 729 continue;
730 if (fn_hash_dump_bucket(skb, cb, tb, fz, &fz->fz_hash[h])<0) { 730 if (fn_hash_dump_bucket(skb, cb, tb, fz, &fz->fz_hash[h]) < 0) {
731 cb->args[3] = h; 731 cb->args[3] = h;
732 return -1; 732 return -1;
733 } 733 }
734 memset(&cb->args[4], 0,
735 sizeof(cb->args) - 4*sizeof(cb->args[0]));
734 } 736 }
735 cb->args[3] = h; 737 cb->args[3] = h;
736 return skb->len; 738 return skb->len;
@@ -746,14 +748,13 @@ static int fn_hash_dump(struct fib_table *tb, struct sk_buff *skb, struct netlin
746 read_lock(&fib_hash_lock); 748 read_lock(&fib_hash_lock);
747 for (fz = table->fn_zone_list, m=0; fz; fz = fz->fz_next, m++) { 749 for (fz = table->fn_zone_list, m=0; fz; fz = fz->fz_next, m++) {
748 if (m < s_m) continue; 750 if (m < s_m) continue;
749 if (m > s_m)
750 memset(&cb->args[3], 0,
751 sizeof(cb->args) - 3*sizeof(cb->args[0]));
752 if (fn_hash_dump_zone(skb, cb, tb, fz) < 0) { 751 if (fn_hash_dump_zone(skb, cb, tb, fz) < 0) {
753 cb->args[2] = m; 752 cb->args[2] = m;
754 read_unlock(&fib_hash_lock); 753 read_unlock(&fib_hash_lock);
755 return -1; 754 return -1;
756 } 755 }
756 memset(&cb->args[3], 0,
757 sizeof(cb->args) - 3*sizeof(cb->args[0]));
757 } 758 }
758 read_unlock(&fib_hash_lock); 759 read_unlock(&fib_hash_lock);
759 cb->args[2] = m; 760 cb->args[2] = m;
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 8d8c2915e064..1010b469d7d3 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1214,6 +1214,9 @@ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg)
1214 struct fib_info *fi_drop; 1214 struct fib_info *fi_drop;
1215 u8 state; 1215 u8 state;
1216 1216
1217 if (fi->fib_treeref > 1)
1218 goto out;
1219
1217 err = -ENOBUFS; 1220 err = -ENOBUFS;
1218 new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL); 1221 new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL);
1219 if (new_fa == NULL) 1222 if (new_fa == NULL)
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 233de0634298..82baea026484 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -540,7 +540,6 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
540 icmp_param.data.icmph.checksum = 0; 540 icmp_param.data.icmph.checksum = 0;
541 icmp_param.skb = skb_in; 541 icmp_param.skb = skb_in;
542 icmp_param.offset = skb_network_offset(skb_in); 542 icmp_param.offset = skb_network_offset(skb_in);
543 icmp_out_count(icmp_param.data.icmph.type);
544 inet_sk(icmp_socket->sk)->tos = tos; 543 inet_sk(icmp_socket->sk)->tos = tos;
545 ipc.addr = iph->saddr; 544 ipc.addr = iph->saddr;
546 ipc.opt = &icmp_param.replyopts; 545 ipc.opt = &icmp_param.replyopts;
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index 9a96c277393d..4a4d49fca1f2 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -310,7 +310,7 @@ static void lro_flush(struct net_lro_mgr *lro_mgr,
310 skb_shinfo(lro_desc->parent)->gso_size = lro_desc->mss; 310 skb_shinfo(lro_desc->parent)->gso_size = lro_desc->mss;
311 311
312 if (lro_desc->vgrp) { 312 if (lro_desc->vgrp) {
313 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 313 if (lro_mgr->features & LRO_F_NAPI)
314 vlan_hwaccel_receive_skb(lro_desc->parent, 314 vlan_hwaccel_receive_skb(lro_desc->parent,
315 lro_desc->vgrp, 315 lro_desc->vgrp,
316 lro_desc->vlan_tag); 316 lro_desc->vlan_tag);
@@ -320,7 +320,7 @@ static void lro_flush(struct net_lro_mgr *lro_mgr,
320 lro_desc->vlan_tag); 320 lro_desc->vlan_tag);
321 321
322 } else { 322 } else {
323 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 323 if (lro_mgr->features & LRO_F_NAPI)
324 netif_receive_skb(lro_desc->parent); 324 netif_receive_skb(lro_desc->parent);
325 else 325 else
326 netif_rx(lro_desc->parent); 326 netif_rx(lro_desc->parent);
@@ -352,7 +352,7 @@ static int __lro_proc_skb(struct net_lro_mgr *lro_mgr, struct sk_buff *skb,
352 goto out; 352 goto out;
353 353
354 if ((skb->protocol == htons(ETH_P_8021Q)) 354 if ((skb->protocol == htons(ETH_P_8021Q))
355 && !test_bit(LRO_F_EXTRACT_VLAN_ID, &lro_mgr->features)) 355 && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
356 vlan_hdr_len = VLAN_HLEN; 356 vlan_hdr_len = VLAN_HLEN;
357 357
358 if (!lro_desc->active) { /* start new lro session */ 358 if (!lro_desc->active) { /* start new lro session */
@@ -474,7 +474,7 @@ static struct sk_buff *__lro_proc_segment(struct net_lro_mgr *lro_mgr,
474 goto out; 474 goto out;
475 475
476 if ((skb->protocol == htons(ETH_P_8021Q)) 476 if ((skb->protocol == htons(ETH_P_8021Q))
477 && !test_bit(LRO_F_EXTRACT_VLAN_ID, &lro_mgr->features)) 477 && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
478 vlan_hdr_len = VLAN_HLEN; 478 vlan_hdr_len = VLAN_HLEN;
479 479
480 iph = (void *)(skb->data + vlan_hdr_len); 480 iph = (void *)(skb->data + vlan_hdr_len);
@@ -516,7 +516,7 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr,
516 void *priv) 516 void *priv)
517{ 517{
518 if (__lro_proc_skb(lro_mgr, skb, NULL, 0, priv)) { 518 if (__lro_proc_skb(lro_mgr, skb, NULL, 0, priv)) {
519 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 519 if (lro_mgr->features & LRO_F_NAPI)
520 netif_receive_skb(skb); 520 netif_receive_skb(skb);
521 else 521 else
522 netif_rx(skb); 522 netif_rx(skb);
@@ -531,7 +531,7 @@ void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr *lro_mgr,
531 void *priv) 531 void *priv)
532{ 532{
533 if (__lro_proc_skb(lro_mgr, skb, vgrp, vlan_tag, priv)) { 533 if (__lro_proc_skb(lro_mgr, skb, vgrp, vlan_tag, priv)) {
534 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 534 if (lro_mgr->features & LRO_F_NAPI)
535 vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag); 535 vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
536 else 536 else
537 vlan_hwaccel_rx(skb, vgrp, vlan_tag); 537 vlan_hwaccel_rx(skb, vgrp, vlan_tag);
@@ -550,7 +550,7 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr,
550 if (!skb) 550 if (!skb)
551 return; 551 return;
552 552
553 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 553 if (lro_mgr->features & LRO_F_NAPI)
554 netif_receive_skb(skb); 554 netif_receive_skb(skb);
555 else 555 else
556 netif_rx(skb); 556 netif_rx(skb);
@@ -570,7 +570,7 @@ void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr *lro_mgr,
570 if (!skb) 570 if (!skb)
571 return; 571 return;
572 572
573 if (test_bit(LRO_F_NAPI, &lro_mgr->features)) 573 if (lro_mgr->features & LRO_F_NAPI)
574 vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag); 574 vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
575 else 575 else
576 vlan_hwaccel_rx(skb, vgrp, vlan_tag); 576 vlan_hwaccel_rx(skb, vgrp, vlan_tag);
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 02b02a8d681c..4b93f32de10d 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -613,7 +613,7 @@ static int ipgre_rcv(struct sk_buff *skb)
613 offset += 4; 613 offset += 4;
614 } 614 }
615 615
616 skb_reset_mac_header(skb); 616 skb->mac_header = skb->network_header;
617 __pskb_pull(skb, offset); 617 __pskb_pull(skb, offset);
618 skb_reset_network_header(skb); 618 skb_reset_network_header(skb);
619 skb_postpull_rcsum(skb, skb_transport_header(skb), offset); 619 skb_postpull_rcsum(skb, skb_transport_header(skb), offset);
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 96400b0bd08a..b8f7763b2261 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1403,6 +1403,9 @@ static int __init ic_proto_name(char *name)
1403 if (!strcmp(name, "on") || !strcmp(name, "any")) { 1403 if (!strcmp(name, "on") || !strcmp(name, "any")) {
1404 return 1; 1404 return 1;
1405 } 1405 }
1406 if (!strcmp(name, "off") || !strcmp(name, "none")) {
1407 return 0;
1408 }
1406#ifdef CONFIG_IP_PNP_DHCP 1409#ifdef CONFIG_IP_PNP_DHCP
1407 else if (!strcmp(name, "dhcp")) { 1410 else if (!strcmp(name, "dhcp")) {
1408 ic_proto_enabled &= ~IC_RARP; 1411 ic_proto_enabled &= ~IC_RARP;
@@ -1436,17 +1439,24 @@ static int __init ip_auto_config_setup(char *addrs)
1436 int num = 0; 1439 int num = 0;
1437 1440
1438 ic_set_manually = 1; 1441 ic_set_manually = 1;
1442 ic_enable = 1;
1439 1443
1440 ic_enable = (*addrs && 1444 /*
1441 (strcmp(addrs, "off") != 0) && 1445 * If any dhcp, bootp etc options are set, leave autoconfig on
1442 (strcmp(addrs, "none") != 0)); 1446 * and skip the below static IP processing.
1443 if (!ic_enable) 1447 */
1448 if (ic_proto_name(addrs))
1444 return 1; 1449 return 1;
1445 1450
1446 if (ic_proto_name(addrs)) 1451 /* If no static IP is given, turn off autoconfig and bail. */
1452 if (*addrs == 0 ||
1453 strcmp(addrs, "off") == 0 ||
1454 strcmp(addrs, "none") == 0) {
1455 ic_enable = 0;
1447 return 1; 1456 return 1;
1457 }
1448 1458
1449 /* Parse the whole string */ 1459 /* Parse string for static IP assignment. */
1450 ip = addrs; 1460 ip = addrs;
1451 while (ip && *ip) { 1461 while (ip && *ip) {
1452 if ((cp = strchr(ip, ':'))) 1462 if ((cp = strchr(ip, ':')))
@@ -1484,7 +1494,10 @@ static int __init ip_auto_config_setup(char *addrs)
1484 strlcpy(user_dev_name, ip, sizeof(user_dev_name)); 1494 strlcpy(user_dev_name, ip, sizeof(user_dev_name));
1485 break; 1495 break;
1486 case 6: 1496 case 6:
1487 ic_proto_name(ip); 1497 if (ic_proto_name(ip) == 0 &&
1498 ic_myaddr == NONE) {
1499 ic_enable = 0;
1500 }
1488 break; 1501 break;
1489 } 1502 }
1490 } 1503 }
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 831e9b29806d..910dae732a0f 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -419,6 +419,9 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = {
419 .me = THIS_MODULE, 419 .me = THIS_MODULE,
420}; 420};
421 421
422module_param_call(hashsize, nf_conntrack_set_hashsize, param_get_uint,
423 &nf_conntrack_htable_size, 0600);
424
422MODULE_ALIAS("nf_conntrack-" __stringify(AF_INET)); 425MODULE_ALIAS("nf_conntrack-" __stringify(AF_INET));
423MODULE_ALIAS("ip_conntrack"); 426MODULE_ALIAS("ip_conntrack");
424MODULE_LICENSE("GPL"); 427MODULE_LICENSE("GPL");
diff --git a/net/ipv4/netfilter/nf_nat_sip.c b/net/ipv4/netfilter/nf_nat_sip.c
index 3ca98971a1e9..8996ccb757db 100644
--- a/net/ipv4/netfilter/nf_nat_sip.c
+++ b/net/ipv4/netfilter/nf_nat_sip.c
@@ -165,7 +165,7 @@ static int mangle_content_len(struct sk_buff *skb,
165 165
166 dataoff = ip_hdrlen(skb) + sizeof(struct udphdr); 166 dataoff = ip_hdrlen(skb) + sizeof(struct udphdr);
167 167
168 /* Get actual SDP lenght */ 168 /* Get actual SDP length */
169 if (ct_sip_get_info(ct, dptr, skb->len - dataoff, &matchoff, 169 if (ct_sip_get_info(ct, dptr, skb->len - dataoff, &matchoff,
170 &matchlen, POS_SDP_HEADER) > 0) { 170 &matchlen, POS_SDP_HEADER) > 0) {
171 171
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 66b42f547bf9..e7050f8eabeb 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -271,6 +271,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
271 int hh_len; 271 int hh_len;
272 struct iphdr *iph; 272 struct iphdr *iph;
273 struct sk_buff *skb; 273 struct sk_buff *skb;
274 unsigned int iphlen;
274 int err; 275 int err;
275 276
276 if (length > rt->u.dst.dev->mtu) { 277 if (length > rt->u.dst.dev->mtu) {
@@ -304,7 +305,8 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
304 goto error_fault; 305 goto error_fault;
305 306
306 /* We don't modify invalid header */ 307 /* We don't modify invalid header */
307 if (length >= sizeof(*iph) && iph->ihl * 4U <= length) { 308 iphlen = iph->ihl * 4;
309 if (iphlen >= sizeof(*iph) && iphlen <= length) {
308 if (!iph->saddr) 310 if (!iph->saddr)
309 iph->saddr = rt->rt_src; 311 iph->saddr = rt->rt_src;
310 iph->check = 0; 312 iph->check = 0;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d2bc6148a737..28484f396b04 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -283,12 +283,12 @@ static struct rtable *rt_cache_get_first(struct seq_file *seq)
283 break; 283 break;
284 rcu_read_unlock_bh(); 284 rcu_read_unlock_bh();
285 } 285 }
286 return r; 286 return rcu_dereference(r);
287} 287}
288 288
289static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r) 289static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r)
290{ 290{
291 struct rt_cache_iter_state *st = rcu_dereference(seq->private); 291 struct rt_cache_iter_state *st = seq->private;
292 292
293 r = r->u.dst.rt_next; 293 r = r->u.dst.rt_next;
294 while (!r) { 294 while (!r) {
@@ -298,7 +298,7 @@ static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r)
298 rcu_read_lock_bh(); 298 rcu_read_lock_bh();
299 r = rt_hash_table[st->bucket].chain; 299 r = rt_hash_table[st->bucket].chain;
300 } 300 }
301 return r; 301 return rcu_dereference(r);
302} 302}
303 303
304static struct rtable *rt_cache_get_idx(struct seq_file *seq, loff_t pos) 304static struct rtable *rt_cache_get_idx(struct seq_file *seq, loff_t pos)
@@ -2626,11 +2626,10 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
2626 int idx, s_idx; 2626 int idx, s_idx;
2627 2627
2628 s_h = cb->args[0]; 2628 s_h = cb->args[0];
2629 if (s_h < 0)
2630 s_h = 0;
2629 s_idx = idx = cb->args[1]; 2631 s_idx = idx = cb->args[1];
2630 for (h = 0; h <= rt_hash_mask; h++) { 2632 for (h = s_h; h <= rt_hash_mask; h++) {
2631 if (h < s_h) continue;
2632 if (h > s_h)
2633 s_idx = 0;
2634 rcu_read_lock_bh(); 2633 rcu_read_lock_bh();
2635 for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt; 2634 for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt;
2636 rt = rcu_dereference(rt->u.dst.rt_next), idx++) { 2635 rt = rcu_dereference(rt->u.dst.rt_next), idx++) {
@@ -2647,6 +2646,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
2647 dst_release(xchg(&skb->dst, NULL)); 2646 dst_release(xchg(&skb->dst, NULL));
2648 } 2647 }
2649 rcu_read_unlock_bh(); 2648 rcu_read_unlock_bh();
2649 s_idx = 0;
2650 } 2650 }
2651 2651
2652done: 2652done:
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 889c89362bfc..b39f0d86e44c 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2651,6 +2651,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
2651 u32 cnt = 0; 2651 u32 cnt = 0;
2652 u32 reord = tp->packets_out; 2652 u32 reord = tp->packets_out;
2653 s32 seq_rtt = -1; 2653 s32 seq_rtt = -1;
2654 s32 ca_seq_rtt = -1;
2654 ktime_t last_ackt = net_invalid_timestamp(); 2655 ktime_t last_ackt = net_invalid_timestamp();
2655 2656
2656 while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) { 2657 while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) {
@@ -2659,6 +2660,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
2659 u32 packets_acked; 2660 u32 packets_acked;
2660 u8 sacked = scb->sacked; 2661 u8 sacked = scb->sacked;
2661 2662
2663 /* Determine how many packets and what bytes were acked, tso and else */
2662 if (after(scb->end_seq, tp->snd_una)) { 2664 if (after(scb->end_seq, tp->snd_una)) {
2663 if (tcp_skb_pcount(skb) == 1 || 2665 if (tcp_skb_pcount(skb) == 1 ||
2664 !after(tp->snd_una, scb->seq)) 2666 !after(tp->snd_una, scb->seq))
@@ -2686,15 +2688,16 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
2686 if (sacked & TCPCB_SACKED_RETRANS) 2688 if (sacked & TCPCB_SACKED_RETRANS)
2687 tp->retrans_out -= packets_acked; 2689 tp->retrans_out -= packets_acked;
2688 flag |= FLAG_RETRANS_DATA_ACKED; 2690 flag |= FLAG_RETRANS_DATA_ACKED;
2691 ca_seq_rtt = -1;
2689 seq_rtt = -1; 2692 seq_rtt = -1;
2690 if ((flag & FLAG_DATA_ACKED) || 2693 if ((flag & FLAG_DATA_ACKED) ||
2691 (packets_acked > 1)) 2694 (packets_acked > 1))
2692 flag |= FLAG_NONHEAD_RETRANS_ACKED; 2695 flag |= FLAG_NONHEAD_RETRANS_ACKED;
2693 } else { 2696 } else {
2697 ca_seq_rtt = now - scb->when;
2698 last_ackt = skb->tstamp;
2694 if (seq_rtt < 0) { 2699 if (seq_rtt < 0) {
2695 seq_rtt = now - scb->when; 2700 seq_rtt = ca_seq_rtt;
2696 if (fully_acked)
2697 last_ackt = skb->tstamp;
2698 } 2701 }
2699 if (!(sacked & TCPCB_SACKED_ACKED)) 2702 if (!(sacked & TCPCB_SACKED_ACKED))
2700 reord = min(cnt, reord); 2703 reord = min(cnt, reord);
@@ -2709,10 +2712,10 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
2709 !before(end_seq, tp->snd_up)) 2712 !before(end_seq, tp->snd_up))
2710 tp->urg_mode = 0; 2713 tp->urg_mode = 0;
2711 } else { 2714 } else {
2715 ca_seq_rtt = now - scb->when;
2716 last_ackt = skb->tstamp;
2712 if (seq_rtt < 0) { 2717 if (seq_rtt < 0) {
2713 seq_rtt = now - scb->when; 2718 seq_rtt = ca_seq_rtt;
2714 if (fully_acked)
2715 last_ackt = skb->tstamp;
2716 } 2719 }
2717 reord = min(cnt, reord); 2720 reord = min(cnt, reord);
2718 } 2721 }
@@ -2772,8 +2775,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
2772 net_invalid_timestamp())) 2775 net_invalid_timestamp()))
2773 rtt_us = ktime_us_delta(ktime_get_real(), 2776 rtt_us = ktime_us_delta(ktime_get_real(),
2774 last_ackt); 2777 last_ackt);
2775 else if (seq_rtt > 0) 2778 else if (ca_seq_rtt > 0)
2776 rtt_us = jiffies_to_usecs(seq_rtt); 2779 rtt_us = jiffies_to_usecs(ca_seq_rtt);
2777 } 2780 }
2778 2781
2779 ca_ops->pkts_acked(sk, pkts_acked, rtt_us); 2782 ca_ops->pkts_acked(sk, pkts_acked, rtt_us);
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 2ed689ac449e..5d4245ab4183 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -123,11 +123,11 @@ ipv4_connected:
123 goto out; 123 goto out;
124 } 124 }
125 sk->sk_bound_dev_if = usin->sin6_scope_id; 125 sk->sk_bound_dev_if = usin->sin6_scope_id;
126 if (!sk->sk_bound_dev_if &&
127 (addr_type & IPV6_ADDR_MULTICAST))
128 fl.oif = np->mcast_oif;
129 } 126 }
130 127
128 if (!sk->sk_bound_dev_if && (addr_type & IPV6_ADDR_MULTICAST))
129 sk->sk_bound_dev_if = np->mcast_oif;
130
131 /* Connect to link-local address requires an interface */ 131 /* Connect to link-local address requires an interface */
132 if (!sk->sk_bound_dev_if) { 132 if (!sk->sk_bound_dev_if) {
133 err = -EINVAL; 133 err = -EINVAL;
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 9bb031fa1c2f..f1240688dc58 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -458,8 +458,6 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
458 } 458 }
459 err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr)); 459 err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr));
460 460
461 ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
462
463out_put: 461out_put:
464 if (likely(idev != NULL)) 462 if (likely(idev != NULL))
465 in6_dev_put(idev); 463 in6_dev_put(idev);
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index adc73adadfae..0765d8bd380f 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -193,7 +193,7 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row,
193 sk2->sk_family == PF_INET6 && 193 sk2->sk_family == PF_INET6 &&
194 ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) && 194 ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) &&
195 ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) && 195 ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) &&
196 sk2->sk_bound_dev_if == sk->sk_bound_dev_if) { 196 (!sk2->sk_bound_dev_if || sk2->sk_bound_dev_if == dif)) {
197 if (twsk_unique(sk, sk2, twp)) 197 if (twsk_unique(sk, sk2, twp))
198 goto unique; 198 goto unique;
199 else 199 else
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 67997a74ddce..777ed733b2d7 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -612,7 +612,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
612 * optimistic addresses, but we may send the solicitation 612 * optimistic addresses, but we may send the solicitation
613 * if we don't include the sllao. So here we check 613 * if we don't include the sllao. So here we check
614 * if our address is optimistic, and if so, we 614 * if our address is optimistic, and if so, we
615 * supress the inclusion of the sllao. 615 * suppress the inclusion of the sllao.
616 */ 616 */
617 if (send_sllao) { 617 if (send_sllao) {
618 struct inet6_ifaddr *ifp = ipv6_get_ifaddr(saddr, dev, 1); 618 struct inet6_ifaddr *ifp = ipv6_get_ifaddr(saddr, dev, 1);
diff --git a/net/ipv6/netfilter/ip6t_eui64.c b/net/ipv6/netfilter/ip6t_eui64.c
index 34ba150bfe5d..41df9a578c7a 100644
--- a/net/ipv6/netfilter/ip6t_eui64.c
+++ b/net/ipv6/netfilter/ip6t_eui64.c
@@ -47,7 +47,7 @@ match(const struct sk_buff *skb,
47 memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3); 47 memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3);
48 eui64[3] = 0xff; 48 eui64[3] = 0xff;
49 eui64[4] = 0xfe; 49 eui64[4] = 0xfe;
50 eui64[0] |= 0x02; 50 eui64[0] ^= 0x02;
51 51
52 i = 0; 52 i = 0;
53 while (ipv6_hdr(skb)->saddr.s6_addr[8 + i] == eui64[i] 53 while (ipv6_hdr(skb)->saddr.s6_addr[8 + i] == eui64[i]
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 8631ed7fe8a9..44937616057e 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -88,7 +88,7 @@ static char *icmp6type2name[256] = {
88 [ICMPV6_PKT_TOOBIG] = "PktTooBigs", 88 [ICMPV6_PKT_TOOBIG] = "PktTooBigs",
89 [ICMPV6_TIME_EXCEED] = "TimeExcds", 89 [ICMPV6_TIME_EXCEED] = "TimeExcds",
90 [ICMPV6_PARAMPROB] = "ParmProblems", 90 [ICMPV6_PARAMPROB] = "ParmProblems",
91 [ICMPV6_ECHO_REQUEST] = "EchoRequest", 91 [ICMPV6_ECHO_REQUEST] = "Echos",
92 [ICMPV6_ECHO_REPLY] = "EchoReplies", 92 [ICMPV6_ECHO_REPLY] = "EchoReplies",
93 [ICMPV6_MGM_QUERY] = "GroupMembQueries", 93 [ICMPV6_MGM_QUERY] = "GroupMembQueries",
94 [ICMPV6_MGM_REPORT] = "GroupMembResponses", 94 [ICMPV6_MGM_REPORT] = "GroupMembResponses",
@@ -98,7 +98,7 @@ static char *icmp6type2name[256] = {
98 [NDISC_ROUTER_SOLICITATION] = "RouterSolicits", 98 [NDISC_ROUTER_SOLICITATION] = "RouterSolicits",
99 [NDISC_NEIGHBOUR_ADVERTISEMENT] = "NeighborAdvertisements", 99 [NDISC_NEIGHBOUR_ADVERTISEMENT] = "NeighborAdvertisements",
100 [NDISC_NEIGHBOUR_SOLICITATION] = "NeighborSolicits", 100 [NDISC_NEIGHBOUR_SOLICITATION] = "NeighborSolicits",
101 [NDISC_REDIRECT] = "NeighborRedirects", 101 [NDISC_REDIRECT] = "Redirects",
102}; 102};
103 103
104 104
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6ecb5e6fae2e..20083e0d3995 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -329,7 +329,7 @@ static inline int rt6_check_dev(struct rt6_info *rt, int oif)
329static inline int rt6_check_neigh(struct rt6_info *rt) 329static inline int rt6_check_neigh(struct rt6_info *rt)
330{ 330{
331 struct neighbour *neigh = rt->rt6i_nexthop; 331 struct neighbour *neigh = rt->rt6i_nexthop;
332 int m = 0; 332 int m;
333 if (rt->rt6i_flags & RTF_NONEXTHOP || 333 if (rt->rt6i_flags & RTF_NONEXTHOP ||
334 !(rt->rt6i_flags & RTF_GATEWAY)) 334 !(rt->rt6i_flags & RTF_GATEWAY))
335 m = 1; 335 m = 1;
@@ -337,10 +337,15 @@ static inline int rt6_check_neigh(struct rt6_info *rt)
337 read_lock_bh(&neigh->lock); 337 read_lock_bh(&neigh->lock);
338 if (neigh->nud_state & NUD_VALID) 338 if (neigh->nud_state & NUD_VALID)
339 m = 2; 339 m = 2;
340 else if (!(neigh->nud_state & NUD_FAILED)) 340#ifdef CONFIG_IPV6_ROUTER_PREF
341 else if (neigh->nud_state & NUD_FAILED)
342 m = 0;
343#endif
344 else
341 m = 1; 345 m = 1;
342 read_unlock_bh(&neigh->lock); 346 read_unlock_bh(&neigh->lock);
343 } 347 } else
348 m = 0;
344 return m; 349 return m;
345} 350}
346 351
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 48ce59a6e026..07dfa7fdd2a0 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -802,12 +802,18 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
802 } 802 }
803#endif /* CONFIG_IRDA_ULTRA */ 803#endif /* CONFIG_IRDA_ULTRA */
804 804
805 self->ias_obj = irias_new_object(addr->sir_name, jiffies);
806 if (self->ias_obj == NULL)
807 return -ENOMEM;
808
805 err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name); 809 err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name);
806 if (err < 0) 810 if (err < 0) {
811 kfree(self->ias_obj->name);
812 kfree(self->ias_obj);
807 return err; 813 return err;
814 }
808 815
809 /* Register with LM-IAS */ 816 /* Register with LM-IAS */
810 self->ias_obj = irias_new_object(addr->sir_name, jiffies);
811 irias_add_integer_attrib(self->ias_obj, "IrDA:TinyTP:LsapSel", 817 irias_add_integer_attrib(self->ias_obj, "IrDA:TinyTP:LsapSel",
812 self->stsap_sel, IAS_KERNEL_ATTR); 818 self->stsap_sel, IAS_KERNEL_ATTR);
813 irias_insert_object(self->ias_obj); 819 irias_insert_object(self->ias_obj);
@@ -1118,8 +1124,6 @@ static int irda_create(struct net *net, struct socket *sock, int protocol)
1118 self->max_sdu_size_rx = TTP_SAR_UNBOUND; 1124 self->max_sdu_size_rx = TTP_SAR_UNBOUND;
1119 break; 1125 break;
1120 default: 1126 default:
1121 IRDA_ERROR("%s: protocol not supported!\n",
1122 __FUNCTION__);
1123 return -ESOCKTNOSUPPORT; 1127 return -ESOCKTNOSUPPORT;
1124 } 1128 }
1125 break; 1129 break;
@@ -1827,7 +1831,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
1827 struct irda_ias_set *ias_opt; 1831 struct irda_ias_set *ias_opt;
1828 struct ias_object *ias_obj; 1832 struct ias_object *ias_obj;
1829 struct ias_attrib * ias_attr; /* Attribute in IAS object */ 1833 struct ias_attrib * ias_attr; /* Attribute in IAS object */
1830 int opt; 1834 int opt, free_ias = 0;
1831 1835
1832 IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); 1836 IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
1833 1837
@@ -1883,11 +1887,20 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
1883 /* Create a new object */ 1887 /* Create a new object */
1884 ias_obj = irias_new_object(ias_opt->irda_class_name, 1888 ias_obj = irias_new_object(ias_opt->irda_class_name,
1885 jiffies); 1889 jiffies);
1890 if (ias_obj == NULL) {
1891 kfree(ias_opt);
1892 return -ENOMEM;
1893 }
1894 free_ias = 1;
1886 } 1895 }
1887 1896
1888 /* Do we have the attribute already ? */ 1897 /* Do we have the attribute already ? */
1889 if(irias_find_attrib(ias_obj, ias_opt->irda_attrib_name)) { 1898 if(irias_find_attrib(ias_obj, ias_opt->irda_attrib_name)) {
1890 kfree(ias_opt); 1899 kfree(ias_opt);
1900 if (free_ias) {
1901 kfree(ias_obj->name);
1902 kfree(ias_obj);
1903 }
1891 return -EINVAL; 1904 return -EINVAL;
1892 } 1905 }
1893 1906
@@ -1906,6 +1919,11 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
1906 if(ias_opt->attribute.irda_attrib_octet_seq.len > 1919 if(ias_opt->attribute.irda_attrib_octet_seq.len >
1907 IAS_MAX_OCTET_STRING) { 1920 IAS_MAX_OCTET_STRING) {
1908 kfree(ias_opt); 1921 kfree(ias_opt);
1922 if (free_ias) {
1923 kfree(ias_obj->name);
1924 kfree(ias_obj);
1925 }
1926
1909 return -EINVAL; 1927 return -EINVAL;
1910 } 1928 }
1911 /* Add an octet sequence attribute */ 1929 /* Add an octet sequence attribute */
@@ -1934,6 +1952,10 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
1934 break; 1952 break;
1935 default : 1953 default :
1936 kfree(ias_opt); 1954 kfree(ias_opt);
1955 if (free_ias) {
1956 kfree(ias_obj->name);
1957 kfree(ias_obj);
1958 }
1937 return -EINVAL; 1959 return -EINVAL;
1938 } 1960 }
1939 irias_insert_object(ias_obj); 1961 irias_insert_object(ias_obj);
diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c
index e5e4792a0314..598dcbe4a501 100644
--- a/net/irda/ircomm/ircomm_param.c
+++ b/net/irda/ircomm/ircomm_param.c
@@ -496,7 +496,7 @@ static int ircomm_param_poll(void *instance, irda_param_t *param, int get)
496 IRDA_ASSERT(self != NULL, return -1;); 496 IRDA_ASSERT(self != NULL, return -1;);
497 IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); 497 IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
498 498
499 /* Poll parameters are always of lenght 0 (just a signal) */ 499 /* Poll parameters are always of length 0 (just a signal) */
500 if (!get) { 500 if (!get) {
501 /* Respond with DTE line settings */ 501 /* Respond with DTE line settings */
502 ircomm_param_request(self, IRCOMM_DTE, TRUE); 502 ircomm_param_request(self, IRCOMM_DTE, TRUE);
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c
index c68220773d28..1ab91f787cc1 100644
--- a/net/irda/irlan/irlan_eth.c
+++ b/net/irda/irlan/irlan_eth.c
@@ -342,7 +342,7 @@ static void irlan_eth_set_multicast_list(struct net_device *dev)
342 342
343 if (dev->flags & IFF_PROMISC) { 343 if (dev->flags & IFF_PROMISC) {
344 /* Enable promiscuous mode */ 344 /* Enable promiscuous mode */
345 IRDA_WARNING("Promiscous mode not implemented by IrLAN!\n"); 345 IRDA_WARNING("Promiscuous mode not implemented by IrLAN!\n");
346 } 346 }
347 else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS) { 347 else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS) {
348 /* Disable promiscuous mode, use normal mode. */ 348 /* Disable promiscuous mode, use normal mode. */
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index 4f3764546b2f..7c132d6342af 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -144,7 +144,7 @@ void irlap_send_snrm_frame(struct irlap_cb *self, struct qos_info *qos)
144 frame->control = SNRM_CMD | PF_BIT; 144 frame->control = SNRM_CMD | PF_BIT;
145 145
146 /* 146 /*
147 * If we are establishing a connection then insert QoS paramerters 147 * If we are establishing a connection then insert QoS parameters
148 */ 148 */
149 if (qos) { 149 if (qos) {
150 skb_put(tx_skb, 9); /* 25 left */ 150 skb_put(tx_skb, 9); /* 25 left */
diff --git a/net/irda/parameters.c b/net/irda/parameters.c
index 7183e9ef7996..722bbe044d9c 100644
--- a/net/irda/parameters.c
+++ b/net/irda/parameters.c
@@ -133,7 +133,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
133 int err; 133 int err;
134 134
135 p.pi = pi; /* In case handler needs to know */ 135 p.pi = pi; /* In case handler needs to know */
136 p.pl = type & PV_MASK; /* The integer type codes the lenght as well */ 136 p.pl = type & PV_MASK; /* The integer type codes the length as well */
137 p.pv.i = 0; /* Clear value */ 137 p.pv.i = 0; /* Clear value */
138 138
139 /* Call handler for this parameter */ 139 /* Call handler for this parameter */
@@ -142,7 +142,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
142 return err; 142 return err;
143 143
144 /* 144 /*
145 * If parameter lenght is still 0, then (1) this is an any length 145 * If parameter length is still 0, then (1) this is an any length
146 * integer, and (2) the handler function does not care which length 146 * integer, and (2) the handler function does not care which length
147 * we choose to use, so we pick the one the gives the fewest bytes. 147 * we choose to use, so we pick the one the gives the fewest bytes.
148 */ 148 */
@@ -206,11 +206,11 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
206{ 206{
207 irda_param_t p; 207 irda_param_t p;
208 int n = 0; 208 int n = 0;
209 int extract_len; /* Real lenght we extract */ 209 int extract_len; /* Real length we extract */
210 int err; 210 int err;
211 211
212 p.pi = pi; /* In case handler needs to know */ 212 p.pi = pi; /* In case handler needs to know */
213 p.pl = buf[1]; /* Extract lenght of value */ 213 p.pl = buf[1]; /* Extract length of value */
214 p.pv.i = 0; /* Clear value */ 214 p.pv.i = 0; /* Clear value */
215 extract_len = p.pl; /* Default : extract all */ 215 extract_len = p.pl; /* Default : extract all */
216 216
@@ -297,7 +297,7 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
297 IRDA_DEBUG(2, "%s()\n", __FUNCTION__); 297 IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
298 298
299 p.pi = pi; /* In case handler needs to know */ 299 p.pi = pi; /* In case handler needs to know */
300 p.pl = buf[1]; /* Extract lenght of value */ 300 p.pl = buf[1]; /* Extract length of value */
301 301
302 IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d\n", __FUNCTION__, 302 IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d\n", __FUNCTION__,
303 p.pi, p.pl); 303 p.pi, p.pl);
@@ -339,7 +339,7 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi,
339 irda_param_t p; 339 irda_param_t p;
340 340
341 p.pi = pi; /* In case handler needs to know */ 341 p.pi = pi; /* In case handler needs to know */
342 p.pl = buf[1]; /* Extract lenght of value */ 342 p.pl = buf[1]; /* Extract length of value */
343 343
344 /* Check if buffer is long enough for parsing */ 344 /* Check if buffer is long enough for parsing */
345 if (len < (2+p.pl)) { 345 if (len < (2+p.pl)) {
diff --git a/net/irda/wrapper.c b/net/irda/wrapper.c
index e71286768a48..c246983308b8 100644
--- a/net/irda/wrapper.c
+++ b/net/irda/wrapper.c
@@ -238,7 +238,7 @@ async_bump(struct net_device *dev,
238 skb_reserve(newskb, 1); 238 skb_reserve(newskb, 1);
239 239
240 if(docopy) { 240 if(docopy) {
241 /* Copy data without CRC (lenght already checked) */ 241 /* Copy data without CRC (length already checked) */
242 skb_copy_to_linear_data(newskb, rx_buff->data, 242 skb_copy_to_linear_data(newskb, rx_buff->data,
243 rx_buff->len - 2); 243 rx_buff->len - 2);
244 /* Deliver this skb */ 244 /* Deliver this skb */
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 878039b9557d..76dcd882f87b 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2784,12 +2784,22 @@ static struct sadb_msg *pfkey_get_base_msg(struct sk_buff *skb, int *errp)
2784 2784
2785static inline int aalg_tmpl_set(struct xfrm_tmpl *t, struct xfrm_algo_desc *d) 2785static inline int aalg_tmpl_set(struct xfrm_tmpl *t, struct xfrm_algo_desc *d)
2786{ 2786{
2787 return t->aalgos & (1 << d->desc.sadb_alg_id); 2787 unsigned int id = d->desc.sadb_alg_id;
2788
2789 if (id >= sizeof(t->aalgos) * 8)
2790 return 0;
2791
2792 return (t->aalgos >> id) & 1;
2788} 2793}
2789 2794
2790static inline int ealg_tmpl_set(struct xfrm_tmpl *t, struct xfrm_algo_desc *d) 2795static inline int ealg_tmpl_set(struct xfrm_tmpl *t, struct xfrm_algo_desc *d)
2791{ 2796{
2792 return t->ealgos & (1 << d->desc.sadb_alg_id); 2797 unsigned int id = d->desc.sadb_alg_id;
2798
2799 if (id >= sizeof(t->ealgos) * 8)
2800 return 0;
2801
2802 return (t->ealgos >> id) & 1;
2793} 2803}
2794 2804
2795static int count_ah_combs(struct xfrm_tmpl *t) 2805static int count_ah_combs(struct xfrm_tmpl *t)
@@ -3583,27 +3593,29 @@ static int pfkey_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
3583 /* old ipsecrequest */ 3593 /* old ipsecrequest */
3584 int mode = pfkey_mode_from_xfrm(mp->mode); 3594 int mode = pfkey_mode_from_xfrm(mp->mode);
3585 if (mode < 0) 3595 if (mode < 0)
3586 return -EINVAL; 3596 goto err;
3587 if (set_ipsecrequest(skb, mp->proto, mode, 3597 if (set_ipsecrequest(skb, mp->proto, mode,
3588 (mp->reqid ? IPSEC_LEVEL_UNIQUE : IPSEC_LEVEL_REQUIRE), 3598 (mp->reqid ? IPSEC_LEVEL_UNIQUE : IPSEC_LEVEL_REQUIRE),
3589 mp->reqid, mp->old_family, 3599 mp->reqid, mp->old_family,
3590 &mp->old_saddr, &mp->old_daddr) < 0) { 3600 &mp->old_saddr, &mp->old_daddr) < 0)
3591 return -EINVAL; 3601 goto err;
3592 }
3593 3602
3594 /* new ipsecrequest */ 3603 /* new ipsecrequest */
3595 if (set_ipsecrequest(skb, mp->proto, mode, 3604 if (set_ipsecrequest(skb, mp->proto, mode,
3596 (mp->reqid ? IPSEC_LEVEL_UNIQUE : IPSEC_LEVEL_REQUIRE), 3605 (mp->reqid ? IPSEC_LEVEL_UNIQUE : IPSEC_LEVEL_REQUIRE),
3597 mp->reqid, mp->new_family, 3606 mp->reqid, mp->new_family,
3598 &mp->new_saddr, &mp->new_daddr) < 0) { 3607 &mp->new_saddr, &mp->new_daddr) < 0)
3599 return -EINVAL; 3608 goto err;
3600 }
3601 } 3609 }
3602 3610
3603 /* broadcast migrate message to sockets */ 3611 /* broadcast migrate message to sockets */
3604 pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL); 3612 pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL);
3605 3613
3606 return 0; 3614 return 0;
3615
3616err:
3617 kfree_skb(skb);
3618 return -EINVAL;
3607} 3619}
3608#else 3620#else
3609static int pfkey_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type, 3621static int pfkey_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 505af1f067ab..6378850d8580 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -427,7 +427,6 @@ static const struct header_ops ieee80211_header_ops = {
427void ieee80211_if_setup(struct net_device *dev) 427void ieee80211_if_setup(struct net_device *dev)
428{ 428{
429 ether_setup(dev); 429 ether_setup(dev);
430 dev->header_ops = &ieee80211_header_ops;
431 dev->hard_start_xmit = ieee80211_subif_start_xmit; 430 dev->hard_start_xmit = ieee80211_subif_start_xmit;
432 dev->wireless_handlers = &ieee80211_iw_handler_def; 431 dev->wireless_handlers = &ieee80211_iw_handler_def;
433 dev->set_multicast_list = ieee80211_set_multicast_list; 432 dev->set_multicast_list = ieee80211_set_multicast_list;
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 7027eed4d4ae..308bbe4a1333 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -591,7 +591,7 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
591 sdata->bss->force_unicast_rateidx = -1; 591 sdata->bss->force_unicast_rateidx = -1;
592 if (rate->value < 0) 592 if (rate->value < 0)
593 return 0; 593 return 0;
594 for (i=0; i< mode->num_rates; i++) { 594 for (i=0; i < mode->num_rates; i++) {
595 struct ieee80211_rate *rates = &mode->rates[i]; 595 struct ieee80211_rate *rates = &mode->rates[i];
596 int this_rate = rates->rate; 596 int this_rate = rates->rate;
597 597
@@ -599,10 +599,10 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
599 sdata->bss->max_ratectrl_rateidx = i; 599 sdata->bss->max_ratectrl_rateidx = i;
600 if (rate->fixed) 600 if (rate->fixed)
601 sdata->bss->force_unicast_rateidx = i; 601 sdata->bss->force_unicast_rateidx = i;
602 break; 602 return 0;
603 } 603 }
604 } 604 }
605 return 0; 605 return -EINVAL;
606} 606}
607 607
608static int ieee80211_ioctl_giwrate(struct net_device *dev, 608static int ieee80211_ioctl_giwrate(struct net_device *dev,
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c
index 3260a4a0ecc5..c3f278393741 100644
--- a/net/mac80211/ieee80211_rate.c
+++ b/net/mac80211/ieee80211_rate.c
@@ -60,11 +60,11 @@ void ieee80211_rate_control_unregister(struct rate_control_ops *ops)
60 list_for_each_entry(alg, &rate_ctrl_algs, list) { 60 list_for_each_entry(alg, &rate_ctrl_algs, list) {
61 if (alg->ops == ops) { 61 if (alg->ops == ops) {
62 list_del(&alg->list); 62 list_del(&alg->list);
63 kfree(alg);
63 break; 64 break;
64 } 65 }
65 } 66 }
66 mutex_unlock(&rate_ctrl_mutex); 67 mutex_unlock(&rate_ctrl_mutex);
67 kfree(alg);
68} 68}
69EXPORT_SYMBOL(ieee80211_rate_control_unregister); 69EXPORT_SYMBOL(ieee80211_rate_control_unregister);
70 70
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 16afd24d4f6b..bee8080f2249 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -808,12 +808,8 @@ static void ieee80211_associated(struct net_device *dev,
808 sta_info_put(sta); 808 sta_info_put(sta);
809 } 809 }
810 if (disassoc) { 810 if (disassoc) {
811 union iwreq_data wrqu; 811 ifsta->state = IEEE80211_DISABLED;
812 memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); 812 ieee80211_set_associated(dev, ifsta, 0);
813 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
814 wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
815 mod_timer(&ifsta->timer, jiffies +
816 IEEE80211_MONITORING_INTERVAL + 30 * HZ);
817 } else { 813 } else {
818 mod_timer(&ifsta->timer, jiffies + 814 mod_timer(&ifsta->timer, jiffies +
819 IEEE80211_MONITORING_INTERVAL); 815 IEEE80211_MONITORING_INTERVAL);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 00f908d9275e..a7263fc476bd 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1443,6 +1443,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1443 struct ieee80211_sub_if_data *prev = NULL; 1443 struct ieee80211_sub_if_data *prev = NULL;
1444 struct sk_buff *skb_new; 1444 struct sk_buff *skb_new;
1445 u8 *bssid; 1445 u8 *bssid;
1446 int hdrlen;
1446 1447
1447 /* 1448 /*
1448 * key references and virtual interfaces are protected using RCU 1449 * key references and virtual interfaces are protected using RCU
@@ -1472,6 +1473,18 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1472 rx.fc = le16_to_cpu(hdr->frame_control); 1473 rx.fc = le16_to_cpu(hdr->frame_control);
1473 type = rx.fc & IEEE80211_FCTL_FTYPE; 1474 type = rx.fc & IEEE80211_FCTL_FTYPE;
1474 1475
1476 /*
1477 * Drivers are required to align the payload data to a four-byte
1478 * boundary, so the last two bits of the address where it starts
1479 * may not be set. The header is required to be directly before
1480 * the payload data, padding like atheros hardware adds which is
1481 * inbetween the 802.11 header and the payload is not supported,
1482 * the driver is required to move the 802.11 header further back
1483 * in that case.
1484 */
1485 hdrlen = ieee80211_get_hdrlen(rx.fc);
1486 WARN_ON_ONCE(((unsigned long)(skb->data + hdrlen)) & 3);
1487
1475 if (type == IEEE80211_FTYPE_DATA || type == IEEE80211_FTYPE_MGMT) 1488 if (type == IEEE80211_FTYPE_DATA || type == IEEE80211_FTYPE_MGMT)
1476 local->dot11ReceivedFragmentCount++; 1489 local->dot11ReceivedFragmentCount++;
1477 1490
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index e8491554a5dc..cfd8ee9adad0 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -14,6 +14,7 @@
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/skbuff.h> 15#include <linux/skbuff.h>
16#include <linux/if_arp.h> 16#include <linux/if_arp.h>
17#include <linux/timer.h>
17 18
18#include <net/mac80211.h> 19#include <net/mac80211.h>
19#include "ieee80211_i.h" 20#include "ieee80211_i.h"
@@ -306,7 +307,8 @@ static void sta_info_cleanup(unsigned long data)
306 } 307 }
307 read_unlock_bh(&local->sta_lock); 308 read_unlock_bh(&local->sta_lock);
308 309
309 local->sta_cleanup.expires = jiffies + STA_INFO_CLEANUP_INTERVAL; 310 local->sta_cleanup.expires =
311 round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL);
310 add_timer(&local->sta_cleanup); 312 add_timer(&local->sta_cleanup);
311} 313}
312 314
@@ -345,7 +347,8 @@ void sta_info_init(struct ieee80211_local *local)
345 INIT_LIST_HEAD(&local->sta_list); 347 INIT_LIST_HEAD(&local->sta_list);
346 348
347 init_timer(&local->sta_cleanup); 349 init_timer(&local->sta_cleanup);
348 local->sta_cleanup.expires = jiffies + STA_INFO_CLEANUP_INTERVAL; 350 local->sta_cleanup.expires =
351 round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL);
349 local->sta_cleanup.data = (unsigned long) local; 352 local->sta_cleanup.data = (unsigned long) local;
350 local->sta_cleanup.function = sta_info_cleanup; 353 local->sta_cleanup.function = sta_info_cleanup;
351 354
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 000c2fb462d0..a4d5cdeb0110 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1016,7 +1016,7 @@ struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced)
1016} 1016}
1017EXPORT_SYMBOL_GPL(nf_ct_alloc_hashtable); 1017EXPORT_SYMBOL_GPL(nf_ct_alloc_hashtable);
1018 1018
1019int set_hashsize(const char *val, struct kernel_param *kp) 1019int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp)
1020{ 1020{
1021 int i, bucket, hashsize, vmalloced; 1021 int i, bucket, hashsize, vmalloced;
1022 int old_vmalloced, old_size; 1022 int old_vmalloced, old_size;
@@ -1063,8 +1063,9 @@ int set_hashsize(const char *val, struct kernel_param *kp)
1063 nf_ct_free_hashtable(old_hash, old_vmalloced, old_size); 1063 nf_ct_free_hashtable(old_hash, old_vmalloced, old_size);
1064 return 0; 1064 return 0;
1065} 1065}
1066EXPORT_SYMBOL_GPL(nf_conntrack_set_hashsize);
1066 1067
1067module_param_call(hashsize, set_hashsize, param_get_uint, 1068module_param_call(hashsize, nf_conntrack_set_hashsize, param_get_uint,
1068 &nf_conntrack_htable_size, 0600); 1069 &nf_conntrack_htable_size, 0600);
1069 1070
1070int __init nf_conntrack_init(void) 1071int __init nf_conntrack_init(void)
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 8f8b5a48df38..515abffc4a09 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -187,7 +187,7 @@ static const struct sip_header_nfo ct_sip_hdrs[] = {
187 } 187 }
188}; 188};
189 189
190/* get line lenght until first CR or LF seen. */ 190/* get line length until first CR or LF seen. */
191int ct_sip_lnlen(const char *line, const char *limit) 191int ct_sip_lnlen(const char *line, const char *limit)
192{ 192{
193 const char *k = line; 193 const char *k = line;
@@ -236,7 +236,7 @@ static int digits_len(struct nf_conn *ct, const char *dptr,
236 return len; 236 return len;
237} 237}
238 238
239/* get digits lenght, skiping blank spaces. */ 239/* get digits length, skipping blank spaces. */
240static int skp_digits_len(struct nf_conn *ct, const char *dptr, 240static int skp_digits_len(struct nf_conn *ct, const char *dptr,
241 const char *limit, int *shift) 241 const char *limit, int *shift)
242{ 242{
diff --git a/net/netfilter/xt_helper.c b/net/netfilter/xt_helper.c
index 0a1f4c6bcdef..d842c4a6d63f 100644
--- a/net/netfilter/xt_helper.c
+++ b/net/netfilter/xt_helper.c
@@ -56,8 +56,8 @@ match(const struct sk_buff *skb,
56 if (info->name[0] == '\0') 56 if (info->name[0] == '\0')
57 ret = !ret; 57 ret = !ret;
58 else 58 else
59 ret ^= !strncmp(master_help->helper->name, info->name, 59 ret ^= !strncmp(helper->name, info->name,
60 strlen(master_help->helper->name)); 60 strlen(helper->name));
61 return ret; 61 return ret;
62} 62}
63 63
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c
index 56483377997a..9c41464d58d1 100644
--- a/net/netlabel/netlabel_mgmt.c
+++ b/net/netlabel/netlabel_mgmt.c
@@ -71,7 +71,7 @@ static const struct nla_policy netlbl_mgmt_genl_policy[NLBL_MGMT_A_MAX + 1] = {
71}; 71};
72 72
73/* 73/*
74 * NetLabel Misc Managment Functions 74 * NetLabel Misc Management Functions
75 */ 75 */
76 76
77/** 77/**
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c
index 8c68da5ef0a1..6caf459665f2 100644
--- a/net/netrom/nr_dev.c
+++ b/net/netrom/nr_dev.c
@@ -56,7 +56,7 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev)
56 56
57 /* Spoof incoming device */ 57 /* Spoof incoming device */
58 skb->dev = dev; 58 skb->dev = dev;
59 skb_reset_mac_header(skb); 59 skb->mac_header = skb->network_header;
60 skb_reset_network_header(skb); 60 skb_reset_network_header(skb);
61 skb->pkt_type = PACKET_HOST; 61 skb->pkt_type = PACKET_HOST;
62 62
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index 4469a7be006c..d06d338812e9 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -392,11 +392,14 @@ int rfkill_register(struct rfkill *rfkill)
392 rfkill_led_trigger_register(rfkill); 392 rfkill_led_trigger_register(rfkill);
393 393
394 error = rfkill_add_switch(rfkill); 394 error = rfkill_add_switch(rfkill);
395 if (error) 395 if (error) {
396 rfkill_led_trigger_unregister(rfkill);
396 return error; 397 return error;
398 }
397 399
398 error = device_add(dev); 400 error = device_add(dev);
399 if (error) { 401 if (error) {
402 rfkill_led_trigger_unregister(rfkill);
400 rfkill_remove_switch(rfkill); 403 rfkill_remove_switch(rfkill);
401 return error; 404 return error;
402 } 405 }
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 55e7e4530f43..a6ad491e434b 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -160,7 +160,7 @@ struct hfsc_class
160 u64 cl_vtoff; /* inter-period cumulative vt offset */ 160 u64 cl_vtoff; /* inter-period cumulative vt offset */
161 u64 cl_cvtmax; /* max child's vt in the last period */ 161 u64 cl_cvtmax; /* max child's vt in the last period */
162 u64 cl_cvtoff; /* cumulative cvtmax of all periods */ 162 u64 cl_cvtoff; /* cumulative cvtmax of all periods */
163 u64 cl_pcvtoff; /* parent's cvtoff at initalization 163 u64 cl_pcvtoff; /* parent's cvtoff at initialization
164 time */ 164 time */
165 165
166 struct internal_sc cl_rsc; /* internal real-time service curve */ 166 struct internal_sc cl_rsc; /* internal real-time service curve */
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index f4876291bb5e..3cc629d3c9ff 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -210,6 +210,9 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
210 chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types); 210 chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types);
211 chunksize += sizeof(ecap_param); 211 chunksize += sizeof(ecap_param);
212 212
213 if (sctp_prsctp_enable)
214 chunksize += sizeof(prsctp_param);
215
213 /* ADDIP: Section 4.2.7: 216 /* ADDIP: Section 4.2.7:
214 * An implementation supporting this extension [ADDIP] MUST list 217 * An implementation supporting this extension [ADDIP] MUST list
215 * the ASCONF,the ASCONF-ACK, and the AUTH chunks in its INIT and 218 * the ASCONF,the ASCONF-ACK, and the AUTH chunks in its INIT and
@@ -286,7 +289,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
286 289
287 sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param); 290 sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param);
288 291
289 /* Add the supported extensions paramter. Be nice and add this 292 /* Add the supported extensions parameter. Be nice and add this
290 * fist before addiding the parameters for the extensions themselves 293 * fist before addiding the parameters for the extensions themselves
291 */ 294 */
292 if (num_ext) { 295 if (num_ext) {
@@ -369,6 +372,9 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
369 if (asoc->peer.ecn_capable) 372 if (asoc->peer.ecn_capable)
370 chunksize += sizeof(ecap_param); 373 chunksize += sizeof(ecap_param);
371 374
375 if (sctp_prsctp_enable)
376 chunksize += sizeof(prsctp_param);
377
372 if (sctp_addip_enable) { 378 if (sctp_addip_enable) {
373 extensions[num_ext] = SCTP_CID_ASCONF; 379 extensions[num_ext] = SCTP_CID_ASCONF;
374 extensions[num_ext+1] = SCTP_CID_ASCONF_ACK; 380 extensions[num_ext+1] = SCTP_CID_ASCONF_ACK;
@@ -2859,7 +2865,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
2859 chunk_len -= length; 2865 chunk_len -= length;
2860 2866
2861 /* Skip the address parameter and store a pointer to the first 2867 /* Skip the address parameter and store a pointer to the first
2862 * asconf paramter. 2868 * asconf parameter.
2863 */ 2869 */
2864 length = ntohs(addr_param->v4.param_hdr.length); 2870 length = ntohs(addr_param->v4.param_hdr.length);
2865 asconf_param = (sctp_addip_param_t *)((void *)addr_param + length); 2871 asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
@@ -2868,7 +2874,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
2868 /* create an ASCONF_ACK chunk. 2874 /* create an ASCONF_ACK chunk.
2869 * Based on the definitions of parameters, we know that the size of 2875 * Based on the definitions of parameters, we know that the size of
2870 * ASCONF_ACK parameters are less than or equal to the twice of ASCONF 2876 * ASCONF_ACK parameters are less than or equal to the twice of ASCONF
2871 * paramters. 2877 * parameters.
2872 */ 2878 */
2873 asconf_ack = sctp_make_asconf_ack(asoc, serial, chunk_len * 2); 2879 asconf_ack = sctp_make_asconf_ack(asoc, serial, chunk_len * 2);
2874 if (!asconf_ack) 2880 if (!asconf_ack)
@@ -3062,7 +3068,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
3062 asconf_len -= length; 3068 asconf_len -= length;
3063 3069
3064 /* Skip the address parameter in the last asconf sent and store a 3070 /* Skip the address parameter in the last asconf sent and store a
3065 * pointer to the first asconf paramter. 3071 * pointer to the first asconf parameter.
3066 */ 3072 */
3067 length = ntohs(addr_param->v4.param_hdr.length); 3073 length = ntohs(addr_param->v4.param_hdr.length);
3068 asconf_param = (sctp_addip_param_t *)((void *)addr_param + length); 3074 asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 5fb84778846d..d247ed4ee423 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1309,26 +1309,6 @@ static void sctp_tietags_populate(struct sctp_association *new_asoc,
1309 new_asoc->c.initial_tsn = asoc->c.initial_tsn; 1309 new_asoc->c.initial_tsn = asoc->c.initial_tsn;
1310} 1310}
1311 1311
1312static void sctp_auth_params_populate(struct sctp_association *new_asoc,
1313 const struct sctp_association *asoc)
1314{
1315 /* Only perform this if AUTH extension is enabled */
1316 if (!sctp_auth_enable)
1317 return;
1318
1319 /* We need to provide the same parameter information as
1320 * was in the original INIT. This means that we need to copy
1321 * the HMACS, CHUNKS, and RANDOM parameter from the original
1322 * assocaition.
1323 */
1324 memcpy(new_asoc->c.auth_random, asoc->c.auth_random,
1325 sizeof(asoc->c.auth_random));
1326 memcpy(new_asoc->c.auth_hmacs, asoc->c.auth_hmacs,
1327 sizeof(asoc->c.auth_hmacs));
1328 memcpy(new_asoc->c.auth_chunks, asoc->c.auth_chunks,
1329 sizeof(asoc->c.auth_chunks));
1330}
1331
1332/* 1312/*
1333 * Compare vtag/tietag values to determine unexpected COOKIE-ECHO 1313 * Compare vtag/tietag values to determine unexpected COOKIE-ECHO
1334 * handling action. 1314 * handling action.
@@ -1486,8 +1466,6 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
1486 1466
1487 sctp_tietags_populate(new_asoc, asoc); 1467 sctp_tietags_populate(new_asoc, asoc);
1488 1468
1489 sctp_auth_params_populate(new_asoc, asoc);
1490
1491 /* B) "Z" shall respond immediately with an INIT ACK chunk. */ 1469 /* B) "Z" shall respond immediately with an INIT ACK chunk. */
1492 1470
1493 /* If there are errors need to be reported for unknown parameters, 1471 /* If there are errors need to be reported for unknown parameters,
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index 2c17c7efad46..307314356e16 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -830,7 +830,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_authkey(
830 ak = (struct sctp_authkey_event *) 830 ak = (struct sctp_authkey_event *)
831 skb_put(skb, sizeof(struct sctp_authkey_event)); 831 skb_put(skb, sizeof(struct sctp_authkey_event));
832 832
833 ak->auth_type = SCTP_AUTHENTICATION_EVENT; 833 ak->auth_type = SCTP_AUTHENTICATION_INDICATION;
834 ak->auth_flags = 0; 834 ak->auth_flags = 0;
835 ak->auth_length = sizeof(struct sctp_authkey_event); 835 ak->auth_length = sizeof(struct sctp_authkey_event);
836 836
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index a6e57d1c2eb6..1f2d85e869c0 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -625,7 +625,7 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
625 err = -EINVAL; 625 err = -EINVAL;
626 gss_auth->mech = gss_mech_get_by_pseudoflavor(flavor); 626 gss_auth->mech = gss_mech_get_by_pseudoflavor(flavor);
627 if (!gss_auth->mech) { 627 if (!gss_auth->mech) {
628 printk(KERN_WARNING "%s: Pseudoflavor %d not found!", 628 printk(KERN_WARNING "%s: Pseudoflavor %d not found!\n",
629 __FUNCTION__, flavor); 629 __FUNCTION__, flavor);
630 goto err_free; 630 goto err_free;
631 } 631 }
diff --git a/net/x25/x25_forward.c b/net/x25/x25_forward.c
index 8738ec7ce693..34478035e05e 100644
--- a/net/x25/x25_forward.c
+++ b/net/x25/x25_forward.c
@@ -118,13 +118,14 @@ int x25_forward_data(int lci, struct x25_neigh *from, struct sk_buff *skb) {
118 goto out; 118 goto out;
119 119
120 if ( (skbn = pskb_copy(skb, GFP_ATOMIC)) == NULL){ 120 if ( (skbn = pskb_copy(skb, GFP_ATOMIC)) == NULL){
121 goto out; 121 goto output;
122 122
123 } 123 }
124 x25_transmit_link(skbn, nb); 124 x25_transmit_link(skbn, nb);
125 125
126 x25_neigh_put(nb);
127 rc = 1; 126 rc = 1;
127output:
128 x25_neigh_put(nb);
128out: 129out:
129 return rc; 130 return rc;
130} 131}
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index b91b16671c1e..26b846e11bfb 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2162,7 +2162,7 @@ xfrm_audit_policy_add(struct xfrm_policy *xp, int result, u32 auid, u32 sid)
2162 2162
2163 if (audit_enabled == 0) 2163 if (audit_enabled == 0)
2164 return; 2164 return;
2165 audit_buf = xfrm_audit_start(sid, auid); 2165 audit_buf = xfrm_audit_start(auid, sid);
2166 if (audit_buf == NULL) 2166 if (audit_buf == NULL)
2167 return; 2167 return;
2168 audit_log_format(audit_buf, " op=SPD-add res=%u", result); 2168 audit_log_format(audit_buf, " op=SPD-add res=%u", result);
@@ -2179,7 +2179,7 @@ xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, u32 auid, u32 sid)
2179 2179
2180 if (audit_enabled == 0) 2180 if (audit_enabled == 0)
2181 return; 2181 return;
2182 audit_buf = xfrm_audit_start(sid, auid); 2182 audit_buf = xfrm_audit_start(auid, sid);
2183 if (audit_buf == NULL) 2183 if (audit_buf == NULL)
2184 return; 2184 return;
2185 audit_log_format(audit_buf, " op=SPD-delete res=%u", result); 2185 audit_log_format(audit_buf, " op=SPD-delete res=%u", result);
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 1af522bf12ca..f26aaaca1fae 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1749,6 +1749,7 @@ void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid)
1749} 1749}
1750EXPORT_SYMBOL(km_policy_expired); 1750EXPORT_SYMBOL(km_policy_expired);
1751 1751
1752#ifdef CONFIG_XFRM_MIGRATE
1752int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type, 1753int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1753 struct xfrm_migrate *m, int num_migrate) 1754 struct xfrm_migrate *m, int num_migrate)
1754{ 1755{
@@ -1768,6 +1769,7 @@ int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1768 return err; 1769 return err;
1769} 1770}
1770EXPORT_SYMBOL(km_migrate); 1771EXPORT_SYMBOL(km_migrate);
1772#endif
1771 1773
1772int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr) 1774int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr)
1773{ 1775{
@@ -2033,7 +2035,7 @@ xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid)
2033 2035
2034 if (audit_enabled == 0) 2036 if (audit_enabled == 0)
2035 return; 2037 return;
2036 audit_buf = xfrm_audit_start(sid, auid); 2038 audit_buf = xfrm_audit_start(auid, sid);
2037 if (audit_buf == NULL) 2039 if (audit_buf == NULL)
2038 return; 2040 return;
2039 audit_log_format(audit_buf, " op=SAD-add res=%u",result); 2041 audit_log_format(audit_buf, " op=SAD-add res=%u",result);
@@ -2053,7 +2055,7 @@ xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid)
2053 2055
2054 if (audit_enabled == 0) 2056 if (audit_enabled == 0)
2055 return; 2057 return;
2056 audit_buf = xfrm_audit_start(sid, auid); 2058 audit_buf = xfrm_audit_start(auid, sid);
2057 if (audit_buf == NULL) 2059 if (audit_buf == NULL)
2058 return; 2060 return;
2059 audit_log_format(audit_buf, " op=SAD-delete res=%u",result); 2061 audit_log_format(audit_buf, " op=SAD-delete res=%u",result);
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index e75dbdcb08a4..c4f6419b1769 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -31,11 +31,6 @@
31#include <linux/in6.h> 31#include <linux/in6.h>
32#endif 32#endif
33 33
34static inline int alg_len(struct xfrm_algo *alg)
35{
36 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
37}
38
39static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type) 34static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
40{ 35{
41 struct nlattr *rt = attrs[type]; 36 struct nlattr *rt = attrs[type];
@@ -45,7 +40,7 @@ static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
45 return 0; 40 return 0;
46 41
47 algp = nla_data(rt); 42 algp = nla_data(rt);
48 if (nla_len(rt) < alg_len(algp)) 43 if (nla_len(rt) < xfrm_alg_len(algp))
49 return -EINVAL; 44 return -EINVAL;
50 45
51 switch (type) { 46 switch (type) {
@@ -204,7 +199,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
204 return -ENOSYS; 199 return -ENOSYS;
205 *props = algo->desc.sadb_alg_id; 200 *props = algo->desc.sadb_alg_id;
206 201
207 p = kmemdup(ualg, alg_len(ualg), GFP_KERNEL); 202 p = kmemdup(ualg, xfrm_alg_len(ualg), GFP_KERNEL);
208 if (!p) 203 if (!p)
209 return -ENOMEM; 204 return -ENOMEM;
210 205
@@ -516,9 +511,9 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
516 NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused); 511 NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused);
517 512
518 if (x->aalg) 513 if (x->aalg)
519 NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg); 514 NLA_PUT(skb, XFRMA_ALG_AUTH, xfrm_alg_len(x->aalg), x->aalg);
520 if (x->ealg) 515 if (x->ealg)
521 NLA_PUT(skb, XFRMA_ALG_CRYPT, alg_len(x->ealg), x->ealg); 516 NLA_PUT(skb, XFRMA_ALG_CRYPT, xfrm_alg_len(x->ealg), x->ealg);
522 if (x->calg) 517 if (x->calg)
523 NLA_PUT(skb, XFRMA_ALG_COMP, sizeof(*(x->calg)), x->calg); 518 NLA_PUT(skb, XFRMA_ALG_COMP, sizeof(*(x->calg)), x->calg);
524 519
@@ -1978,9 +1973,9 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x)
1978{ 1973{
1979 size_t l = 0; 1974 size_t l = 0;
1980 if (x->aalg) 1975 if (x->aalg)
1981 l += nla_total_size(alg_len(x->aalg)); 1976 l += nla_total_size(xfrm_alg_len(x->aalg));
1982 if (x->ealg) 1977 if (x->ealg)
1983 l += nla_total_size(alg_len(x->ealg)); 1978 l += nla_total_size(xfrm_alg_len(x->ealg));
1984 if (x->calg) 1979 if (x->calg)
1985 l += nla_total_size(sizeof(*x->calg)); 1980 l += nla_total_size(sizeof(*x->calg));
1986 if (x->encap) 1981 if (x->encap)