diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-02 10:46:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-02 10:46:18 -0400 |
commit | 2f819ae8816990aaad46dd6d1748a096d136df68 (patch) | |
tree | 65891bf45d2d0e4e7884c4cc69beb9c27b67be95 /net | |
parent | d40c2f29f3b0f5937bace575722598dac474c478 (diff) | |
parent | 802fb176d8c635ae42da31b80841c26e8c7338a0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (45 commits)
[VLAN]: Proc entry is not renamed when vlan device name changes.
[IPV6]: Fix ICMP relookup error path dst leak
[ATM] drivers/atm/iphase.c: compilation warning fix
IPv6: do not create temporary adresses with too short preferred lifetime
IPv6: only update the lifetime of the relevant temporary address
bluetooth : __rfcomm_dlc_close lock fix
bluetooth : use lockdep sub-classes for diffrent bluetooth protocol
[ROSE/AX25] af_rose: rose_release() fix
mac80211: correct use_short_preamble handling
b43: Fix PCMCIA IRQ routing
b43: Add DMA mapping failure messages
mac80211: trigger ieee80211_sta_work after opening interface
[LLC]: skb allocation size for responses
[IP] UDP: Use SEQ_START_TOKEN.
[NET]: Remove Documentation/networking/sk98lin.txt
[ATM] atm/idt77252.c: Make 2 functions static
[ATM]: Make atm/he.c:read_prom_byte() static
[IPV6] MCAST: Ensure to check multicast listener(s).
[LLC]: Kill llc_station_mac_sa symbol export.
forcedeth: fix locking bug with netconsole
...
Diffstat (limited to 'net')
42 files changed, 250 insertions, 135 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index dbc81b965096..b33410abfd6b 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -374,17 +374,35 @@ static void vlan_sync_address(struct net_device *dev, | |||
374 | memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN); | 374 | memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN); |
375 | } | 375 | } |
376 | 376 | ||
377 | static void __vlan_device_event(struct net_device *dev, unsigned long event) | ||
378 | { | ||
379 | switch (event) { | ||
380 | case NETDEV_CHANGENAME: | ||
381 | vlan_proc_rem_dev(dev); | ||
382 | if (vlan_proc_add_dev(dev) < 0) | ||
383 | pr_warning("8021q: failed to change proc name for %s\n", | ||
384 | dev->name); | ||
385 | break; | ||
386 | } | ||
387 | } | ||
388 | |||
377 | static int vlan_device_event(struct notifier_block *unused, unsigned long event, | 389 | static int vlan_device_event(struct notifier_block *unused, unsigned long event, |
378 | void *ptr) | 390 | void *ptr) |
379 | { | 391 | { |
380 | struct net_device *dev = ptr; | 392 | struct net_device *dev = ptr; |
381 | struct vlan_group *grp = __vlan_find_group(dev->ifindex); | 393 | struct vlan_group *grp; |
382 | int i, flgs; | 394 | int i, flgs; |
383 | struct net_device *vlandev; | 395 | struct net_device *vlandev; |
384 | 396 | ||
385 | if (dev->nd_net != &init_net) | 397 | if (dev->nd_net != &init_net) |
386 | return NOTIFY_DONE; | 398 | return NOTIFY_DONE; |
387 | 399 | ||
400 | if (is_vlan_dev(dev)) { | ||
401 | __vlan_device_event(dev, event); | ||
402 | goto out; | ||
403 | } | ||
404 | |||
405 | grp = __vlan_find_group(dev->ifindex); | ||
388 | if (!grp) | 406 | if (!grp) |
389 | goto out; | 407 | goto out; |
390 | 408 | ||
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h index 73efcc715ccb..51271aea402b 100644 --- a/net/8021q/vlan.h +++ b/net/8021q/vlan.h | |||
@@ -45,4 +45,9 @@ void vlan_netlink_fini(void); | |||
45 | 45 | ||
46 | extern struct rtnl_link_ops vlan_link_ops; | 46 | extern struct rtnl_link_ops vlan_link_ops; |
47 | 47 | ||
48 | static inline int is_vlan_dev(struct net_device *dev) | ||
49 | { | ||
50 | return dev->priv_flags & IFF_802_1Q_VLAN; | ||
51 | } | ||
52 | |||
48 | #endif /* !(__BEN_VLAN_802_1Q_INC__) */ | 53 | #endif /* !(__BEN_VLAN_802_1Q_INC__) */ |
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 146cfb0e9882..9671aa51af2c 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -210,11 +210,6 @@ int vlan_proc_rem_dev(struct net_device *vlandev) | |||
210 | * The following few functions build the content of /proc/net/vlan/config | 210 | * The following few functions build the content of /proc/net/vlan/config |
211 | */ | 211 | */ |
212 | 212 | ||
213 | static inline int is_vlan_dev(struct net_device *dev) | ||
214 | { | ||
215 | return dev->priv_flags & IFF_802_1Q_VLAN; | ||
216 | } | ||
217 | |||
218 | /* start read of /proc/net/vlan/config */ | 213 | /* start read of /proc/net/vlan/config */ |
219 | static void *vlan_seq_start(struct seq_file *seq, loff_t *pos) | 214 | static void *vlan_seq_start(struct seq_file *seq, loff_t *pos) |
220 | __acquires(dev_base_lock) | 215 | __acquires(dev_base_lock) |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 1220d8a41eb5..d366423c8392 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -53,6 +53,30 @@ | |||
53 | /* Bluetooth sockets */ | 53 | /* Bluetooth sockets */ |
54 | #define BT_MAX_PROTO 8 | 54 | #define BT_MAX_PROTO 8 |
55 | static struct net_proto_family *bt_proto[BT_MAX_PROTO]; | 55 | static struct net_proto_family *bt_proto[BT_MAX_PROTO]; |
56 | |||
57 | static struct lock_class_key bt_slock_key[BT_MAX_PROTO]; | ||
58 | static struct lock_class_key bt_lock_key[BT_MAX_PROTO]; | ||
59 | static const char *bt_key_strings[BT_MAX_PROTO] = { | ||
60 | "sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP", | ||
61 | "sk_lock-AF_BLUETOOTH-BTPROTO_HCI", | ||
62 | "sk_lock-AF_BLUETOOTH-BTPROTO_SCO", | ||
63 | "sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM", | ||
64 | "sk_lock-AF_BLUETOOTH-BTPROTO_BNEP", | ||
65 | "sk_lock-AF_BLUETOOTH-BTPROTO_CMTP", | ||
66 | "sk_lock-AF_BLUETOOTH-BTPROTO_HIDP", | ||
67 | "sk_lock-AF_BLUETOOTH-BTPROTO_AVDTP", | ||
68 | }; | ||
69 | |||
70 | static const char *bt_slock_key_strings[BT_MAX_PROTO] = { | ||
71 | "slock-AF_BLUETOOTH-BTPROTO_L2CAP", | ||
72 | "slock-AF_BLUETOOTH-BTPROTO_HCI", | ||
73 | "slock-AF_BLUETOOTH-BTPROTO_SCO", | ||
74 | "slock-AF_BLUETOOTH-BTPROTO_RFCOMM", | ||
75 | "slock-AF_BLUETOOTH-BTPROTO_BNEP", | ||
76 | "slock-AF_BLUETOOTH-BTPROTO_CMTP", | ||
77 | "slock-AF_BLUETOOTH-BTPROTO_HIDP", | ||
78 | "slock-AF_BLUETOOTH-BTPROTO_AVDTP", | ||
79 | }; | ||
56 | static DEFINE_RWLOCK(bt_proto_lock); | 80 | static DEFINE_RWLOCK(bt_proto_lock); |
57 | 81 | ||
58 | int bt_sock_register(int proto, struct net_proto_family *ops) | 82 | int bt_sock_register(int proto, struct net_proto_family *ops) |
@@ -95,6 +119,21 @@ int bt_sock_unregister(int proto) | |||
95 | } | 119 | } |
96 | EXPORT_SYMBOL(bt_sock_unregister); | 120 | EXPORT_SYMBOL(bt_sock_unregister); |
97 | 121 | ||
122 | static void bt_reclassify_sock_lock(struct socket *sock, int proto) | ||
123 | { | ||
124 | struct sock *sk = sock->sk; | ||
125 | |||
126 | if (!sk) | ||
127 | return; | ||
128 | BUG_ON(sock_owned_by_user(sk)); | ||
129 | |||
130 | sock_lock_init_class_and_name(sk, | ||
131 | bt_slock_key_strings[proto], | ||
132 | &bt_slock_key[proto], | ||
133 | bt_key_strings[proto], | ||
134 | &bt_lock_key[proto]); | ||
135 | } | ||
136 | |||
98 | static int bt_sock_create(struct net *net, struct socket *sock, int proto) | 137 | static int bt_sock_create(struct net *net, struct socket *sock, int proto) |
99 | { | 138 | { |
100 | int err; | 139 | int err; |
@@ -117,6 +156,7 @@ static int bt_sock_create(struct net *net, struct socket *sock, int proto) | |||
117 | 156 | ||
118 | if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { | 157 | if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { |
119 | err = bt_proto[proto]->create(net, sock, proto); | 158 | err = bt_proto[proto]->create(net, sock, proto); |
159 | bt_reclassify_sock_lock(sock, proto); | ||
120 | module_put(bt_proto[proto]->owner); | 160 | module_put(bt_proto[proto]->owner); |
121 | } | 161 | } |
122 | 162 | ||
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index b5d4019d3572..1d36c093523b 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -84,7 +84,7 @@ static struct hci_sec_filter hci_sec_filter = { | |||
84 | }; | 84 | }; |
85 | 85 | ||
86 | static struct bt_sock_list hci_sk_list = { | 86 | static struct bt_sock_list hci_sk_list = { |
87 | .lock = RW_LOCK_UNLOCKED | 87 | .lock = __RW_LOCK_UNLOCKED(hci_sk_list.lock) |
88 | }; | 88 | }; |
89 | 89 | ||
90 | /* Send frame to RAW socket */ | 90 | /* Send frame to RAW socket */ |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 34f8bf98bc05..2957df4b6c0b 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -62,7 +62,7 @@ static u32 l2cap_feat_mask = 0x0000; | |||
62 | static const struct proto_ops l2cap_sock_ops; | 62 | static const struct proto_ops l2cap_sock_ops; |
63 | 63 | ||
64 | static struct bt_sock_list l2cap_sk_list = { | 64 | static struct bt_sock_list l2cap_sk_list = { |
65 | .lock = RW_LOCK_UNLOCKED | 65 | .lock = __RW_LOCK_UNLOCKED(l2cap_sk_list.lock) |
66 | }; | 66 | }; |
67 | 67 | ||
68 | static void __l2cap_sock_close(struct sock *sk, int reason); | 68 | static void __l2cap_sock_close(struct sock *sk, int reason); |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 0c2c93735e93..eb62558e9b09 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -423,8 +423,8 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err) | |||
423 | 423 | ||
424 | rfcomm_dlc_lock(d); | 424 | rfcomm_dlc_lock(d); |
425 | d->state = BT_CLOSED; | 425 | d->state = BT_CLOSED; |
426 | d->state_change(d, err); | ||
427 | rfcomm_dlc_unlock(d); | 426 | rfcomm_dlc_unlock(d); |
427 | d->state_change(d, err); | ||
428 | 428 | ||
429 | skb_queue_purge(&d->tx_queue); | 429 | skb_queue_purge(&d->tx_queue); |
430 | rfcomm_dlc_unlink(d); | 430 | rfcomm_dlc_unlink(d); |
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index c46d51035e77..af4e3934ee84 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -60,7 +60,7 @@ | |||
60 | static const struct proto_ops rfcomm_sock_ops; | 60 | static const struct proto_ops rfcomm_sock_ops; |
61 | 61 | ||
62 | static struct bt_sock_list rfcomm_sk_list = { | 62 | static struct bt_sock_list rfcomm_sk_list = { |
63 | .lock = RW_LOCK_UNLOCKED | 63 | .lock = __RW_LOCK_UNLOCKED(rfcomm_sk_list.lock) |
64 | }; | 64 | }; |
65 | 65 | ||
66 | static void rfcomm_sock_close(struct sock *sk); | 66 | static void rfcomm_sock_close(struct sock *sk); |
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index e4c779bb8d76..c3f749abb2d0 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -570,12 +570,7 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) | |||
570 | return; | 570 | return; |
571 | 571 | ||
572 | rfcomm_dev_del(dev); | 572 | rfcomm_dev_del(dev); |
573 | /* We have to drop DLC lock here, otherwise | ||
574 | rfcomm_dev_put() will dead lock if it's | ||
575 | the last reference. */ | ||
576 | rfcomm_dlc_unlock(dlc); | ||
577 | rfcomm_dev_put(dev); | 573 | rfcomm_dev_put(dev); |
578 | rfcomm_dlc_lock(dlc); | ||
579 | } | 574 | } |
580 | } else | 575 | } else |
581 | tty_hangup(dev->tty); | 576 | tty_hangup(dev->tty); |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index b91d3c81a73c..cd887cdca426 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -58,7 +58,7 @@ | |||
58 | static const struct proto_ops sco_sock_ops; | 58 | static const struct proto_ops sco_sock_ops; |
59 | 59 | ||
60 | static struct bt_sock_list sco_sk_list = { | 60 | static struct bt_sock_list sco_sk_list = { |
61 | .lock = RW_LOCK_UNLOCKED | 61 | .lock = __RW_LOCK_UNLOCKED(sco_sk_list.lock) |
62 | }; | 62 | }; |
63 | 63 | ||
64 | static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *parent); | 64 | static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *parent); |
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index f3ceca31aa45..4e73e5708e70 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
@@ -336,7 +336,7 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb) | |||
336 | struct scatterlist *asg; | 336 | struct scatterlist *asg; |
337 | int err = -EINVAL; | 337 | int err = -EINVAL; |
338 | 338 | ||
339 | if (!pskb_may_pull(skb, sizeof(*esph))) | 339 | if (!pskb_may_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead))) |
340 | goto out; | 340 | goto out; |
341 | 341 | ||
342 | if (elen <= 0) | 342 | if (elen <= 0) |
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 724d69aed031..a0a3c78cb5e0 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c | |||
@@ -86,7 +86,10 @@ EXPORT_SYMBOL(inet_frags_fini); | |||
86 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f) | 86 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f) |
87 | { | 87 | { |
88 | nf->low_thresh = 0; | 88 | nf->low_thresh = 0; |
89 | |||
90 | local_bh_disable(); | ||
89 | inet_frag_evictor(nf, f); | 91 | inet_frag_evictor(nf, f); |
92 | local_bh_enable(); | ||
90 | } | 93 | } |
91 | EXPORT_SYMBOL(inet_frags_exit_net); | 94 | EXPORT_SYMBOL(inet_frags_exit_net); |
92 | 95 | ||
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index 0b3b328d82db..a4506c8cfef0 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c | |||
@@ -85,7 +85,7 @@ int ip_forward(struct sk_buff *skb) | |||
85 | if (opt->is_strictroute && rt->rt_dst != rt->rt_gateway) | 85 | if (opt->is_strictroute && rt->rt_dst != rt->rt_gateway) |
86 | goto sr_failed; | 86 | goto sr_failed; |
87 | 87 | ||
88 | if (unlikely(skb->len > dst_mtu(&rt->u.dst) && | 88 | if (unlikely(skb->len > dst_mtu(&rt->u.dst) && !skb_is_gso(skb) && |
89 | (ip_hdr(skb)->frag_off & htons(IP_DF))) && !skb->local_df) { | 89 | (ip_hdr(skb)->frag_off & htons(IP_DF))) && !skb->local_df) { |
90 | IP_INC_STATS(IPSTATS_MIB_FRAGFAILS); | 90 | IP_INC_STATS(IPSTATS_MIB_FRAGFAILS); |
91 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, | 91 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index fe05da41d6ba..4dc162894cb2 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -588,11 +588,9 @@ static int __init ip_queue_init(void) | |||
588 | } | 588 | } |
589 | 589 | ||
590 | #ifdef CONFIG_PROC_FS | 590 | #ifdef CONFIG_PROC_FS |
591 | proc = create_proc_entry(IPQ_PROC_FS_NAME, 0, init_net.proc_net); | 591 | proc = proc_create(IPQ_PROC_FS_NAME, 0, init_net.proc_net, |
592 | if (proc) { | 592 | &ip_queue_proc_fops); |
593 | proc->owner = THIS_MODULE; | 593 | if (!proc) { |
594 | proc->proc_fops = &ip_queue_proc_fops; | ||
595 | } else { | ||
596 | printk(KERN_ERR "ip_queue: failed to create proc entry\n"); | 594 | printk(KERN_ERR "ip_queue: failed to create proc entry\n"); |
597 | goto cleanup_ipqnl; | 595 | goto cleanup_ipqnl; |
598 | } | 596 | } |
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index c6cf84c77611..52926c8e3cc1 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -167,14 +167,13 @@ clusterip_config_init(struct ipt_clusterip_tgt_info *i, __be32 ip, | |||
167 | 167 | ||
168 | /* create proc dir entry */ | 168 | /* create proc dir entry */ |
169 | sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); | 169 | sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); |
170 | c->pde = create_proc_entry(buffer, S_IWUSR|S_IRUSR, | 170 | c->pde = proc_create(buffer, S_IWUSR|S_IRUSR, |
171 | clusterip_procdir); | 171 | clusterip_procdir, &clusterip_proc_fops); |
172 | if (!c->pde) { | 172 | if (!c->pde) { |
173 | kfree(c); | 173 | kfree(c); |
174 | return NULL; | 174 | return NULL; |
175 | } | 175 | } |
176 | } | 176 | } |
177 | c->pde->proc_fops = &clusterip_proc_fops; | ||
178 | c->pde->data = c; | 177 | c->pde->data = c; |
179 | #endif | 178 | #endif |
180 | 179 | ||
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c index 8e8f0425a8ed..50e06690eb5b 100644 --- a/net/ipv4/netfilter/ipt_recent.c +++ b/net/ipv4/netfilter/ipt_recent.c | |||
@@ -276,12 +276,11 @@ recent_mt_check(const char *tablename, const void *ip, | |||
276 | for (i = 0; i < ip_list_hash_size; i++) | 276 | for (i = 0; i < ip_list_hash_size; i++) |
277 | INIT_LIST_HEAD(&t->iphash[i]); | 277 | INIT_LIST_HEAD(&t->iphash[i]); |
278 | #ifdef CONFIG_PROC_FS | 278 | #ifdef CONFIG_PROC_FS |
279 | t->proc = create_proc_entry(t->name, ip_list_perms, proc_dir); | 279 | t->proc = proc_create(t->name, ip_list_perms, proc_dir, &recent_fops); |
280 | if (t->proc == NULL) { | 280 | if (t->proc == NULL) { |
281 | kfree(t); | 281 | kfree(t); |
282 | goto out; | 282 | goto out; |
283 | } | 283 | } |
284 | t->proc->proc_fops = &recent_fops; | ||
285 | t->proc->uid = ip_list_uid; | 284 | t->proc->uid = ip_list_uid; |
286 | t->proc->gid = ip_list_gid; | 285 | t->proc->gid = ip_list_gid; |
287 | t->proc->data = t; | 286 | t->proc->data = t; |
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c index 089252e82c01..f500b0fdaef4 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c | |||
@@ -395,13 +395,10 @@ int __init nf_conntrack_ipv4_compat_init(void) | |||
395 | if (!proc_exp) | 395 | if (!proc_exp) |
396 | goto err2; | 396 | goto err2; |
397 | 397 | ||
398 | proc_stat = create_proc_entry("ip_conntrack", S_IRUGO, init_net.proc_net_stat); | 398 | proc_stat = proc_create("ip_conntrack", S_IRUGO, |
399 | init_net.proc_net_stat, &ct_cpu_seq_fops); | ||
399 | if (!proc_stat) | 400 | if (!proc_stat) |
400 | goto err3; | 401 | goto err3; |
401 | |||
402 | proc_stat->proc_fops = &ct_cpu_seq_fops; | ||
403 | proc_stat->owner = THIS_MODULE; | ||
404 | |||
405 | return 0; | 402 | return 0; |
406 | 403 | ||
407 | err3: | 404 | err3: |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 7ea1b67b6de1..1704c1474ea1 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1556,14 +1556,14 @@ static void *udp_seq_start(struct seq_file *seq, loff_t *pos) | |||
1556 | __acquires(udp_hash_lock) | 1556 | __acquires(udp_hash_lock) |
1557 | { | 1557 | { |
1558 | read_lock(&udp_hash_lock); | 1558 | read_lock(&udp_hash_lock); |
1559 | return *pos ? udp_get_idx(seq, *pos-1) : (void *)1; | 1559 | return *pos ? udp_get_idx(seq, *pos-1) : SEQ_START_TOKEN; |
1560 | } | 1560 | } |
1561 | 1561 | ||
1562 | static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 1562 | static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
1563 | { | 1563 | { |
1564 | struct sock *sk; | 1564 | struct sock *sk; |
1565 | 1565 | ||
1566 | if (v == (void *)1) | 1566 | if (v == SEQ_START_TOKEN) |
1567 | sk = udp_get_idx(seq, 0); | 1567 | sk = udp_get_idx(seq, 0); |
1568 | else | 1568 | else |
1569 | sk = udp_get_next(seq, v); | 1569 | sk = udp_get_next(seq, v); |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 101e0e70ba27..e7a1882db048 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -776,6 +776,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, struct inet6_ifaddr *i | |||
776 | struct inet6_dev *idev = ifp->idev; | 776 | struct inet6_dev *idev = ifp->idev; |
777 | struct in6_addr addr, *tmpaddr; | 777 | struct in6_addr addr, *tmpaddr; |
778 | unsigned long tmp_prefered_lft, tmp_valid_lft, tmp_cstamp, tmp_tstamp; | 778 | unsigned long tmp_prefered_lft, tmp_valid_lft, tmp_cstamp, tmp_tstamp; |
779 | unsigned long regen_advance; | ||
779 | int tmp_plen; | 780 | int tmp_plen; |
780 | int ret = 0; | 781 | int ret = 0; |
781 | int max_addresses; | 782 | int max_addresses; |
@@ -836,8 +837,23 @@ retry: | |||
836 | tmp_tstamp = ifp->tstamp; | 837 | tmp_tstamp = ifp->tstamp; |
837 | spin_unlock_bh(&ifp->lock); | 838 | spin_unlock_bh(&ifp->lock); |
838 | 839 | ||
840 | regen_advance = idev->cnf.regen_max_retry * | ||
841 | idev->cnf.dad_transmits * | ||
842 | idev->nd_parms->retrans_time / HZ; | ||
839 | write_unlock(&idev->lock); | 843 | write_unlock(&idev->lock); |
840 | 844 | ||
845 | /* A temporary address is created only if this calculated Preferred | ||
846 | * Lifetime is greater than REGEN_ADVANCE time units. In particular, | ||
847 | * an implementation must not create a temporary address with a zero | ||
848 | * Preferred Lifetime. | ||
849 | */ | ||
850 | if (tmp_prefered_lft <= regen_advance) { | ||
851 | in6_ifa_put(ifp); | ||
852 | in6_dev_put(idev); | ||
853 | ret = -1; | ||
854 | goto out; | ||
855 | } | ||
856 | |||
841 | addr_flags = IFA_F_TEMPORARY; | 857 | addr_flags = IFA_F_TEMPORARY; |
842 | /* set in addrconf_prefix_rcv() */ | 858 | /* set in addrconf_prefix_rcv() */ |
843 | if (ifp->flags & IFA_F_OPTIMISTIC) | 859 | if (ifp->flags & IFA_F_OPTIMISTIC) |
@@ -1831,6 +1847,9 @@ ok: | |||
1831 | * lifetimes of an existing temporary address | 1847 | * lifetimes of an existing temporary address |
1832 | * when processing a Prefix Information Option. | 1848 | * when processing a Prefix Information Option. |
1833 | */ | 1849 | */ |
1850 | if (ifp != ift->ifpub) | ||
1851 | continue; | ||
1852 | |||
1834 | spin_lock(&ift->lock); | 1853 | spin_lock(&ift->lock); |
1835 | flags = ift->flags; | 1854 | flags = ift->flags; |
1836 | if (ift->valid_lft > valid_lft && | 1855 | if (ift->valid_lft > valid_lft && |
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 0ec1402320ea..c6bb4c6d24b3 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
@@ -282,7 +282,7 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb) | |||
282 | struct scatterlist *sg; | 282 | struct scatterlist *sg; |
283 | struct scatterlist *asg; | 283 | struct scatterlist *asg; |
284 | 284 | ||
285 | if (!pskb_may_pull(skb, sizeof(*esph))) { | 285 | if (!pskb_may_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead))) { |
286 | ret = -EINVAL; | 286 | ret = -EINVAL; |
287 | goto out; | 287 | goto out; |
288 | } | 288 | } |
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 121d517bf91c..f204a7275a0d 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -436,10 +436,10 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, | |||
436 | } | 436 | } |
437 | 437 | ||
438 | if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6)) | 438 | if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6)) |
439 | goto out; | 439 | goto out_dst_release; |
440 | 440 | ||
441 | if (ip6_dst_lookup(sk, &dst2, &fl)) | 441 | if (ip6_dst_lookup(sk, &dst2, &fl)) |
442 | goto out; | 442 | goto out_dst_release; |
443 | 443 | ||
444 | err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP); | 444 | err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP); |
445 | if (err == -ENOENT) { | 445 | if (err == -ENOENT) { |
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 178aebc0427a..98ab4f459905 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
@@ -239,8 +239,7 @@ int ip6_mc_input(struct sk_buff *skb) | |||
239 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INMCASTPKTS); | 239 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INMCASTPKTS); |
240 | 240 | ||
241 | hdr = ipv6_hdr(skb); | 241 | hdr = ipv6_hdr(skb); |
242 | deliver = unlikely(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) || | 242 | deliver = ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); |
243 | ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); | ||
244 | 243 | ||
245 | /* | 244 | /* |
246 | * IPv6 multicast router mode isnt currently supported. | 245 | * IPv6 multicast router mode isnt currently supported. |
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index cc2f9afcf808..8d366f7f2a9a 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
@@ -591,11 +591,9 @@ static int __init ip6_queue_init(void) | |||
591 | } | 591 | } |
592 | 592 | ||
593 | #ifdef CONFIG_PROC_FS | 593 | #ifdef CONFIG_PROC_FS |
594 | proc = create_proc_entry(IPQ_PROC_FS_NAME, 0, init_net.proc_net); | 594 | proc = proc_create(IPQ_PROC_FS_NAME, 0, init_net.proc_net, |
595 | if (proc) { | 595 | &ip6_queue_proc_fops); |
596 | proc->owner = THIS_MODULE; | 596 | if (!proc) { |
597 | proc->proc_fops = &ip6_queue_proc_fops; | ||
598 | } else { | ||
599 | printk(KERN_ERR "ip6_queue: failed to create proc entry\n"); | 597 | printk(KERN_ERR "ip6_queue: failed to create proc entry\n"); |
600 | goto cleanup_ipqnl; | 598 | goto cleanup_ipqnl; |
601 | } | 599 | } |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 2a0d698b24d5..24c0d03095bf 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -171,7 +171,9 @@ static __inline__ void fq_kill(struct nf_ct_frag6_queue *fq) | |||
171 | 171 | ||
172 | static void nf_ct_frag6_evictor(void) | 172 | static void nf_ct_frag6_evictor(void) |
173 | { | 173 | { |
174 | local_bh_disable(); | ||
174 | inet_frag_evictor(&nf_init_frags, &nf_frags); | 175 | inet_frag_evictor(&nf_init_frags, &nf_frags); |
176 | local_bh_enable(); | ||
175 | } | 177 | } |
176 | 178 | ||
177 | static void nf_ct_frag6_expire(unsigned long data) | 179 | static void nf_ct_frag6_expire(unsigned long data) |
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 46cf962f7f88..8c50eb430c19 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -155,6 +155,9 @@ static int llc_ui_create(struct net *net, struct socket *sock, int protocol) | |||
155 | struct sock *sk; | 155 | struct sock *sk; |
156 | int rc = -ESOCKTNOSUPPORT; | 156 | int rc = -ESOCKTNOSUPPORT; |
157 | 157 | ||
158 | if (!capable(CAP_NET_RAW)) | ||
159 | return -EPERM; | ||
160 | |||
158 | if (net != &init_net) | 161 | if (net != &init_net) |
159 | return -EAFNOSUPPORT; | 162 | return -EAFNOSUPPORT; |
160 | 163 | ||
diff --git a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c index 860140caa6e0..71a00225bdb3 100644 --- a/net/llc/llc_c_ac.c +++ b/net/llc/llc_c_ac.c | |||
@@ -198,7 +198,7 @@ int llc_conn_ac_send_disc_cmd_p_set_x(struct sock *sk, struct sk_buff *skb) | |||
198 | { | 198 | { |
199 | int rc = -ENOBUFS; | 199 | int rc = -ENOBUFS; |
200 | struct llc_sock *llc = llc_sk(sk); | 200 | struct llc_sock *llc = llc_sk(sk); |
201 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 201 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
202 | 202 | ||
203 | if (nskb) { | 203 | if (nskb) { |
204 | struct llc_sap *sap = llc->sap; | 204 | struct llc_sap *sap = llc->sap; |
@@ -223,7 +223,7 @@ int llc_conn_ac_send_dm_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) | |||
223 | { | 223 | { |
224 | int rc = -ENOBUFS; | 224 | int rc = -ENOBUFS; |
225 | struct llc_sock *llc = llc_sk(sk); | 225 | struct llc_sock *llc = llc_sk(sk); |
226 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 226 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
227 | 227 | ||
228 | if (nskb) { | 228 | if (nskb) { |
229 | struct llc_sap *sap = llc->sap; | 229 | struct llc_sap *sap = llc->sap; |
@@ -249,7 +249,7 @@ int llc_conn_ac_send_dm_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
249 | { | 249 | { |
250 | int rc = -ENOBUFS; | 250 | int rc = -ENOBUFS; |
251 | struct llc_sock *llc = llc_sk(sk); | 251 | struct llc_sock *llc = llc_sk(sk); |
252 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 252 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
253 | 253 | ||
254 | if (nskb) { | 254 | if (nskb) { |
255 | struct llc_sap *sap = llc->sap; | 255 | struct llc_sap *sap = llc->sap; |
@@ -282,7 +282,8 @@ int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk, struct sk_buff *skb) | |||
282 | llc_pdu_decode_pf_bit(skb, &f_bit); | 282 | llc_pdu_decode_pf_bit(skb, &f_bit); |
283 | else | 283 | else |
284 | f_bit = 0; | 284 | f_bit = 0; |
285 | nskb = llc_alloc_frame(sk, llc->dev); | 285 | nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, |
286 | sizeof(struct llc_frmr_info)); | ||
286 | if (nskb) { | 287 | if (nskb) { |
287 | struct llc_sap *sap = llc->sap; | 288 | struct llc_sap *sap = llc->sap; |
288 | 289 | ||
@@ -306,7 +307,8 @@ int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock *sk, struct sk_buff *skb) | |||
306 | { | 307 | { |
307 | int rc = -ENOBUFS; | 308 | int rc = -ENOBUFS; |
308 | struct llc_sock *llc = llc_sk(sk); | 309 | struct llc_sock *llc = llc_sk(sk); |
309 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 310 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, |
311 | sizeof(struct llc_frmr_info)); | ||
310 | 312 | ||
311 | if (nskb) { | 313 | if (nskb) { |
312 | struct llc_sap *sap = llc->sap; | 314 | struct llc_sap *sap = llc->sap; |
@@ -336,7 +338,8 @@ int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) | |||
336 | struct llc_sock *llc = llc_sk(sk); | 338 | struct llc_sock *llc = llc_sk(sk); |
337 | 339 | ||
338 | llc_pdu_decode_pf_bit(skb, &f_bit); | 340 | llc_pdu_decode_pf_bit(skb, &f_bit); |
339 | nskb = llc_alloc_frame(sk, llc->dev); | 341 | nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, |
342 | sizeof(struct llc_frmr_info)); | ||
340 | if (nskb) { | 343 | if (nskb) { |
341 | struct llc_sap *sap = llc->sap; | 344 | struct llc_sap *sap = llc->sap; |
342 | struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); | 345 | struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); |
@@ -424,7 +427,7 @@ int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk, | |||
424 | struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); | 427 | struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); |
425 | int rc = -ENOBUFS; | 428 | int rc = -ENOBUFS; |
426 | struct llc_sock *llc = llc_sk(sk); | 429 | struct llc_sock *llc = llc_sk(sk); |
427 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 430 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
428 | 431 | ||
429 | if (nskb) { | 432 | if (nskb) { |
430 | struct llc_sap *sap = llc->sap; | 433 | struct llc_sap *sap = llc->sap; |
@@ -459,7 +462,7 @@ int llc_conn_ac_send_rej_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
459 | { | 462 | { |
460 | int rc = -ENOBUFS; | 463 | int rc = -ENOBUFS; |
461 | struct llc_sock *llc = llc_sk(sk); | 464 | struct llc_sock *llc = llc_sk(sk); |
462 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 465 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
463 | 466 | ||
464 | if (nskb) { | 467 | if (nskb) { |
465 | struct llc_sap *sap = llc->sap; | 468 | struct llc_sap *sap = llc->sap; |
@@ -483,7 +486,7 @@ int llc_conn_ac_send_rej_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
483 | { | 486 | { |
484 | int rc = -ENOBUFS; | 487 | int rc = -ENOBUFS; |
485 | struct llc_sock *llc = llc_sk(sk); | 488 | struct llc_sock *llc = llc_sk(sk); |
486 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 489 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
487 | 490 | ||
488 | if (nskb) { | 491 | if (nskb) { |
489 | struct llc_sap *sap = llc->sap; | 492 | struct llc_sap *sap = llc->sap; |
@@ -507,7 +510,7 @@ int llc_conn_ac_send_rej_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
507 | { | 510 | { |
508 | int rc = -ENOBUFS; | 511 | int rc = -ENOBUFS; |
509 | struct llc_sock *llc = llc_sk(sk); | 512 | struct llc_sock *llc = llc_sk(sk); |
510 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 513 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
511 | 514 | ||
512 | if (nskb) { | 515 | if (nskb) { |
513 | struct llc_sap *sap = llc->sap; | 516 | struct llc_sap *sap = llc->sap; |
@@ -531,7 +534,7 @@ int llc_conn_ac_send_rnr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
531 | { | 534 | { |
532 | int rc = -ENOBUFS; | 535 | int rc = -ENOBUFS; |
533 | struct llc_sock *llc = llc_sk(sk); | 536 | struct llc_sock *llc = llc_sk(sk); |
534 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 537 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
535 | 538 | ||
536 | if (nskb) { | 539 | if (nskb) { |
537 | struct llc_sap *sap = llc->sap; | 540 | struct llc_sap *sap = llc->sap; |
@@ -555,7 +558,7 @@ int llc_conn_ac_send_rnr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
555 | { | 558 | { |
556 | int rc = -ENOBUFS; | 559 | int rc = -ENOBUFS; |
557 | struct llc_sock *llc = llc_sk(sk); | 560 | struct llc_sock *llc = llc_sk(sk); |
558 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 561 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
559 | 562 | ||
560 | if (nskb) { | 563 | if (nskb) { |
561 | struct llc_sap *sap = llc->sap; | 564 | struct llc_sap *sap = llc->sap; |
@@ -579,7 +582,7 @@ int llc_conn_ac_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
579 | { | 582 | { |
580 | int rc = -ENOBUFS; | 583 | int rc = -ENOBUFS; |
581 | struct llc_sock *llc = llc_sk(sk); | 584 | struct llc_sock *llc = llc_sk(sk); |
582 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 585 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
583 | 586 | ||
584 | if (nskb) { | 587 | if (nskb) { |
585 | struct llc_sap *sap = llc->sap; | 588 | struct llc_sap *sap = llc->sap; |
@@ -615,7 +618,7 @@ int llc_conn_ac_opt_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
615 | { | 618 | { |
616 | int rc = -ENOBUFS; | 619 | int rc = -ENOBUFS; |
617 | struct llc_sock *llc = llc_sk(sk); | 620 | struct llc_sock *llc = llc_sk(sk); |
618 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 621 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
619 | 622 | ||
620 | if (nskb) { | 623 | if (nskb) { |
621 | struct llc_sap *sap = llc->sap; | 624 | struct llc_sap *sap = llc->sap; |
@@ -639,7 +642,7 @@ int llc_conn_ac_send_rr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
639 | { | 642 | { |
640 | int rc = -ENOBUFS; | 643 | int rc = -ENOBUFS; |
641 | struct llc_sock *llc = llc_sk(sk); | 644 | struct llc_sock *llc = llc_sk(sk); |
642 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 645 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
643 | 646 | ||
644 | if (nskb) { | 647 | if (nskb) { |
645 | struct llc_sap *sap = llc->sap; | 648 | struct llc_sap *sap = llc->sap; |
@@ -663,7 +666,7 @@ int llc_conn_ac_send_rr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
663 | { | 666 | { |
664 | int rc = -ENOBUFS; | 667 | int rc = -ENOBUFS; |
665 | struct llc_sock *llc = llc_sk(sk); | 668 | struct llc_sock *llc = llc_sk(sk); |
666 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 669 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
667 | 670 | ||
668 | if (nskb) { | 671 | if (nskb) { |
669 | struct llc_sap *sap = llc->sap; | 672 | struct llc_sap *sap = llc->sap; |
@@ -688,7 +691,7 @@ int llc_conn_ac_send_ack_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
688 | { | 691 | { |
689 | int rc = -ENOBUFS; | 692 | int rc = -ENOBUFS; |
690 | struct llc_sock *llc = llc_sk(sk); | 693 | struct llc_sock *llc = llc_sk(sk); |
691 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 694 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
692 | 695 | ||
693 | if (nskb) { | 696 | if (nskb) { |
694 | struct llc_sap *sap = llc->sap; | 697 | struct llc_sap *sap = llc->sap; |
@@ -712,7 +715,7 @@ int llc_conn_ac_send_rr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
712 | { | 715 | { |
713 | int rc = -ENOBUFS; | 716 | int rc = -ENOBUFS; |
714 | struct llc_sock *llc = llc_sk(sk); | 717 | struct llc_sock *llc = llc_sk(sk); |
715 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 718 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
716 | 719 | ||
717 | if (nskb) { | 720 | if (nskb) { |
718 | struct llc_sap *sap = llc->sap; | 721 | struct llc_sap *sap = llc->sap; |
@@ -736,7 +739,7 @@ int llc_conn_ac_send_ack_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
736 | { | 739 | { |
737 | int rc = -ENOBUFS; | 740 | int rc = -ENOBUFS; |
738 | struct llc_sock *llc = llc_sk(sk); | 741 | struct llc_sock *llc = llc_sk(sk); |
739 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 742 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
740 | 743 | ||
741 | if (nskb) { | 744 | if (nskb) { |
742 | struct llc_sap *sap = llc->sap; | 745 | struct llc_sap *sap = llc->sap; |
@@ -770,7 +773,7 @@ int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock *sk, struct sk_buff *skb) | |||
770 | { | 773 | { |
771 | int rc = -ENOBUFS; | 774 | int rc = -ENOBUFS; |
772 | struct llc_sock *llc = llc_sk(sk); | 775 | struct llc_sock *llc = llc_sk(sk); |
773 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 776 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
774 | 777 | ||
775 | if (nskb) { | 778 | if (nskb) { |
776 | struct llc_sap *sap = llc->sap; | 779 | struct llc_sap *sap = llc->sap; |
@@ -799,7 +802,7 @@ int llc_conn_ac_send_ua_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) | |||
799 | u8 f_bit; | 802 | u8 f_bit; |
800 | int rc = -ENOBUFS; | 803 | int rc = -ENOBUFS; |
801 | struct llc_sock *llc = llc_sk(sk); | 804 | struct llc_sock *llc = llc_sk(sk); |
802 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 805 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
803 | 806 | ||
804 | llc_pdu_decode_pf_bit(skb, &f_bit); | 807 | llc_pdu_decode_pf_bit(skb, &f_bit); |
805 | if (nskb) { | 808 | if (nskb) { |
@@ -956,7 +959,7 @@ static int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock *sk, | |||
956 | { | 959 | { |
957 | int rc = -ENOBUFS; | 960 | int rc = -ENOBUFS; |
958 | struct llc_sock *llc = llc_sk(sk); | 961 | struct llc_sock *llc = llc_sk(sk); |
959 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 962 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
960 | 963 | ||
961 | if (nskb) { | 964 | if (nskb) { |
962 | struct llc_sap *sap = llc->sap; | 965 | struct llc_sap *sap = llc->sap; |
diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c index 248b5903bb13..50d5b10e23a2 100644 --- a/net/llc/llc_core.c +++ b/net/llc/llc_core.c | |||
@@ -25,8 +25,6 @@ | |||
25 | LIST_HEAD(llc_sap_list); | 25 | LIST_HEAD(llc_sap_list); |
26 | DEFINE_RWLOCK(llc_sap_list_lock); | 26 | DEFINE_RWLOCK(llc_sap_list_lock); |
27 | 27 | ||
28 | unsigned char llc_station_mac_sa[ETH_ALEN]; | ||
29 | |||
30 | /** | 28 | /** |
31 | * llc_sap_alloc - allocates and initializes sap. | 29 | * llc_sap_alloc - allocates and initializes sap. |
32 | * | 30 | * |
@@ -37,8 +35,8 @@ static struct llc_sap *llc_sap_alloc(void) | |||
37 | struct llc_sap *sap = kzalloc(sizeof(*sap), GFP_ATOMIC); | 35 | struct llc_sap *sap = kzalloc(sizeof(*sap), GFP_ATOMIC); |
38 | 36 | ||
39 | if (sap) { | 37 | if (sap) { |
38 | /* sap->laddr.mac - leave as a null, it's filled by bind */ | ||
40 | sap->state = LLC_SAP_STATE_ACTIVE; | 39 | sap->state = LLC_SAP_STATE_ACTIVE; |
41 | memcpy(sap->laddr.mac, llc_station_mac_sa, ETH_ALEN); | ||
42 | rwlock_init(&sap->sk_list.lock); | 40 | rwlock_init(&sap->sk_list.lock); |
43 | atomic_set(&sap->refcnt, 1); | 41 | atomic_set(&sap->refcnt, 1); |
44 | } | 42 | } |
@@ -167,10 +165,6 @@ static int __init llc_init(void) | |||
167 | if (dev != NULL) | 165 | if (dev != NULL) |
168 | dev = next_net_device(dev); | 166 | dev = next_net_device(dev); |
169 | 167 | ||
170 | if (dev != NULL) | ||
171 | memcpy(llc_station_mac_sa, dev->dev_addr, ETH_ALEN); | ||
172 | else | ||
173 | memset(llc_station_mac_sa, 0, ETH_ALEN); | ||
174 | dev_add_pack(&llc_packet_type); | 168 | dev_add_pack(&llc_packet_type); |
175 | dev_add_pack(&llc_tr_packet_type); | 169 | dev_add_pack(&llc_tr_packet_type); |
176 | return 0; | 170 | return 0; |
@@ -185,7 +179,6 @@ static void __exit llc_exit(void) | |||
185 | module_init(llc_init); | 179 | module_init(llc_init); |
186 | module_exit(llc_exit); | 180 | module_exit(llc_exit); |
187 | 181 | ||
188 | EXPORT_SYMBOL(llc_station_mac_sa); | ||
189 | EXPORT_SYMBOL(llc_sap_list); | 182 | EXPORT_SYMBOL(llc_sap_list); |
190 | EXPORT_SYMBOL(llc_sap_list_lock); | 183 | EXPORT_SYMBOL(llc_sap_list_lock); |
191 | EXPORT_SYMBOL(llc_sap_find); | 184 | EXPORT_SYMBOL(llc_sap_find); |
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c index c40c9b2a345a..bfd2567dd365 100644 --- a/net/llc/llc_input.c +++ b/net/llc/llc_input.c | |||
@@ -117,8 +117,12 @@ static inline int llc_fixup_skb(struct sk_buff *skb) | |||
117 | skb_pull(skb, llc_len); | 117 | skb_pull(skb, llc_len); |
118 | if (skb->protocol == htons(ETH_P_802_2)) { | 118 | if (skb->protocol == htons(ETH_P_802_2)) { |
119 | __be16 pdulen = eth_hdr(skb)->h_proto; | 119 | __be16 pdulen = eth_hdr(skb)->h_proto; |
120 | u16 data_size = ntohs(pdulen) - llc_len; | 120 | s32 data_size = ntohs(pdulen) - llc_len; |
121 | 121 | ||
122 | if (data_size < 0 || | ||
123 | ((skb_tail_pointer(skb) - | ||
124 | (u8 *)pdu) - llc_len) < data_size) | ||
125 | return 0; | ||
122 | if (unlikely(pskb_trim_rcsum(skb, data_size))) | 126 | if (unlikely(pskb_trim_rcsum(skb, data_size))) |
123 | return 0; | 127 | return 0; |
124 | } | 128 | } |
diff --git a/net/llc/llc_pdu.c b/net/llc/llc_pdu.c index fa8324396db3..2e6cb79196bb 100644 --- a/net/llc/llc_pdu.c +++ b/net/llc/llc_pdu.c | |||
@@ -241,7 +241,7 @@ void llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, struct llc_pdu_sn *prev_pdu, | |||
241 | FRMR_INFO_SET_PDU_INFO_2LONG_IND(frmr_info, vzyxw); | 241 | FRMR_INFO_SET_PDU_INFO_2LONG_IND(frmr_info, vzyxw); |
242 | FRMR_INFO_SET_PDU_INVALID_Nr_IND(frmr_info, vzyxw); | 242 | FRMR_INFO_SET_PDU_INVALID_Nr_IND(frmr_info, vzyxw); |
243 | FRMR_INFO_SET_PDU_INVALID_Ns_IND(frmr_info, vzyxw); | 243 | FRMR_INFO_SET_PDU_INVALID_Ns_IND(frmr_info, vzyxw); |
244 | skb_put(skb, 5); | 244 | skb_put(skb, sizeof(struct llc_frmr_info)); |
245 | } | 245 | } |
246 | 246 | ||
247 | /** | 247 | /** |
diff --git a/net/llc/llc_s_ac.c b/net/llc/llc_s_ac.c index ac3d93b210d2..a94bd56bcac6 100644 --- a/net/llc/llc_s_ac.c +++ b/net/llc/llc_s_ac.c | |||
@@ -103,7 +103,8 @@ int llc_sap_action_send_xid_r(struct llc_sap *sap, struct sk_buff *skb) | |||
103 | llc_pdu_decode_sa(skb, mac_da); | 103 | llc_pdu_decode_sa(skb, mac_da); |
104 | llc_pdu_decode_da(skb, mac_sa); | 104 | llc_pdu_decode_da(skb, mac_sa); |
105 | llc_pdu_decode_ssap(skb, &dsap); | 105 | llc_pdu_decode_ssap(skb, &dsap); |
106 | nskb = llc_alloc_frame(NULL, skb->dev); | 106 | nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, |
107 | sizeof(struct llc_xid_info)); | ||
107 | if (!nskb) | 108 | if (!nskb) |
108 | goto out; | 109 | goto out; |
109 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, | 110 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, |
@@ -144,11 +145,15 @@ int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb) | |||
144 | u8 mac_da[ETH_ALEN], mac_sa[ETH_ALEN], dsap; | 145 | u8 mac_da[ETH_ALEN], mac_sa[ETH_ALEN], dsap; |
145 | struct sk_buff *nskb; | 146 | struct sk_buff *nskb; |
146 | int rc = 1; | 147 | int rc = 1; |
148 | u32 data_size; | ||
147 | 149 | ||
148 | llc_pdu_decode_sa(skb, mac_da); | 150 | llc_pdu_decode_sa(skb, mac_da); |
149 | llc_pdu_decode_da(skb, mac_sa); | 151 | llc_pdu_decode_da(skb, mac_sa); |
150 | llc_pdu_decode_ssap(skb, &dsap); | 152 | llc_pdu_decode_ssap(skb, &dsap); |
151 | nskb = llc_alloc_frame(NULL, skb->dev); | 153 | |
154 | /* The test request command is type U (llc_len = 3) */ | ||
155 | data_size = ntohs(eth_hdr(skb)->h_proto) - 3; | ||
156 | nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size); | ||
152 | if (!nskb) | 157 | if (!nskb) |
153 | goto out; | 158 | goto out; |
154 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, | 159 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, |
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c index 2525165e2e8f..e2ddde755019 100644 --- a/net/llc/llc_sap.c +++ b/net/llc/llc_sap.c | |||
@@ -24,20 +24,41 @@ | |||
24 | #include <net/tcp_states.h> | 24 | #include <net/tcp_states.h> |
25 | #include <linux/llc.h> | 25 | #include <linux/llc.h> |
26 | 26 | ||
27 | static int llc_mac_header_len(unsigned short devtype) | ||
28 | { | ||
29 | switch (devtype) { | ||
30 | case ARPHRD_ETHER: | ||
31 | case ARPHRD_LOOPBACK: | ||
32 | return sizeof(struct ethhdr); | ||
33 | #ifdef CONFIG_TR | ||
34 | case ARPHRD_IEEE802_TR: | ||
35 | return sizeof(struct trh_hdr); | ||
36 | #endif | ||
37 | } | ||
38 | return 0; | ||
39 | } | ||
40 | |||
27 | /** | 41 | /** |
28 | * llc_alloc_frame - allocates sk_buff for frame | 42 | * llc_alloc_frame - allocates sk_buff for frame |
29 | * @dev: network device this skb will be sent over | 43 | * @dev: network device this skb will be sent over |
44 | * @type: pdu type to allocate | ||
45 | * @data_size: data size to allocate | ||
30 | * | 46 | * |
31 | * Allocates an sk_buff for frame and initializes sk_buff fields. | 47 | * Allocates an sk_buff for frame and initializes sk_buff fields. |
32 | * Returns allocated skb or %NULL when out of memory. | 48 | * Returns allocated skb or %NULL when out of memory. |
33 | */ | 49 | */ |
34 | struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev) | 50 | struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev, |
51 | u8 type, u32 data_size) | ||
35 | { | 52 | { |
36 | struct sk_buff *skb = alloc_skb(128, GFP_ATOMIC); | 53 | int hlen = type == LLC_PDU_TYPE_U ? 3 : 4; |
54 | struct sk_buff *skb; | ||
55 | |||
56 | hlen += llc_mac_header_len(dev->type); | ||
57 | skb = alloc_skb(hlen + data_size, GFP_ATOMIC); | ||
37 | 58 | ||
38 | if (skb) { | 59 | if (skb) { |
39 | skb_reset_mac_header(skb); | 60 | skb_reset_mac_header(skb); |
40 | skb_reserve(skb, 50); | 61 | skb_reserve(skb, hlen); |
41 | skb_reset_network_header(skb); | 62 | skb_reset_network_header(skb); |
42 | skb_reset_transport_header(skb); | 63 | skb_reset_transport_header(skb); |
43 | skb->protocol = htons(ETH_P_802_2); | 64 | skb->protocol = htons(ETH_P_802_2); |
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c index 6f2ea2090322..83da13339490 100644 --- a/net/llc/llc_station.c +++ b/net/llc/llc_station.c | |||
@@ -253,13 +253,14 @@ static int llc_station_ac_inc_xid_r_cnt_by_1(struct sk_buff *skb) | |||
253 | static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb) | 253 | static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb) |
254 | { | 254 | { |
255 | int rc = 1; | 255 | int rc = 1; |
256 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev); | 256 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, |
257 | sizeof(struct llc_xid_info)); | ||
257 | 258 | ||
258 | if (!nskb) | 259 | if (!nskb) |
259 | goto out; | 260 | goto out; |
260 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD); | 261 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD); |
261 | llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127); | 262 | llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127); |
262 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, llc_station_mac_sa); | 263 | rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, skb->dev->dev_addr); |
263 | if (unlikely(rc)) | 264 | if (unlikely(rc)) |
264 | goto free; | 265 | goto free; |
265 | llc_station_send_pdu(nskb); | 266 | llc_station_send_pdu(nskb); |
@@ -274,7 +275,8 @@ static int llc_station_ac_send_xid_r(struct sk_buff *skb) | |||
274 | { | 275 | { |
275 | u8 mac_da[ETH_ALEN], dsap; | 276 | u8 mac_da[ETH_ALEN], dsap; |
276 | int rc = 1; | 277 | int rc = 1; |
277 | struct sk_buff* nskb = llc_alloc_frame(NULL, skb->dev); | 278 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, |
279 | sizeof(struct llc_xid_info)); | ||
278 | 280 | ||
279 | if (!nskb) | 281 | if (!nskb) |
280 | goto out; | 282 | goto out; |
@@ -283,7 +285,7 @@ static int llc_station_ac_send_xid_r(struct sk_buff *skb) | |||
283 | llc_pdu_decode_ssap(skb, &dsap); | 285 | llc_pdu_decode_ssap(skb, &dsap); |
284 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); | 286 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); |
285 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127); | 287 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127); |
286 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); | 288 | rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, mac_da); |
287 | if (unlikely(rc)) | 289 | if (unlikely(rc)) |
288 | goto free; | 290 | goto free; |
289 | llc_station_send_pdu(nskb); | 291 | llc_station_send_pdu(nskb); |
@@ -298,7 +300,12 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb) | |||
298 | { | 300 | { |
299 | u8 mac_da[ETH_ALEN], dsap; | 301 | u8 mac_da[ETH_ALEN], dsap; |
300 | int rc = 1; | 302 | int rc = 1; |
301 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev); | 303 | u32 data_size; |
304 | struct sk_buff *nskb; | ||
305 | |||
306 | /* The test request command is type U (llc_len = 3) */ | ||
307 | data_size = ntohs(eth_hdr(skb)->h_proto) - 3; | ||
308 | nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size); | ||
302 | 309 | ||
303 | if (!nskb) | 310 | if (!nskb) |
304 | goto out; | 311 | goto out; |
@@ -307,7 +314,7 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb) | |||
307 | llc_pdu_decode_ssap(skb, &dsap); | 314 | llc_pdu_decode_ssap(skb, &dsap); |
308 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); | 315 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); |
309 | llc_pdu_init_as_test_rsp(nskb, skb); | 316 | llc_pdu_init_as_test_rsp(nskb, skb); |
310 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); | 317 | rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, mac_da); |
311 | if (unlikely(rc)) | 318 | if (unlikely(rc)) |
312 | goto free; | 319 | goto free; |
313 | llc_station_send_pdu(nskb); | 320 | llc_station_send_pdu(nskb); |
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 28bcdf9fc3df..8e586390a2ef 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -286,6 +286,18 @@ static int ieee80211_open(struct net_device *dev) | |||
286 | if (need_hw_reconfig) | 286 | if (need_hw_reconfig) |
287 | ieee80211_hw_config(local); | 287 | ieee80211_hw_config(local); |
288 | 288 | ||
289 | /* | ||
290 | * ieee80211_sta_work is disabled while network interface | ||
291 | * is down. Therefore, some configuration changes may not | ||
292 | * yet be effective. Trigger execution of ieee80211_sta_work | ||
293 | * to fix this. | ||
294 | */ | ||
295 | if(sdata->vif.type == IEEE80211_IF_TYPE_STA || | ||
296 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | ||
297 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | ||
298 | queue_work(local->hw.workqueue, &ifsta->work); | ||
299 | } | ||
300 | |||
289 | netif_start_queue(dev); | 301 | netif_start_queue(dev); |
290 | 302 | ||
291 | return 0; | 303 | return 0; |
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 9aeed5320228..e0c72d04584b 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -319,7 +319,7 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, | |||
319 | struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; | 319 | struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; |
320 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 320 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
321 | bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; | 321 | bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; |
322 | bool preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0; | 322 | bool use_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0; |
323 | DECLARE_MAC_BUF(mac); | 323 | DECLARE_MAC_BUF(mac); |
324 | u32 changed = 0; | 324 | u32 changed = 0; |
325 | 325 | ||
@@ -335,16 +335,15 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, | |||
335 | changed |= BSS_CHANGED_ERP_CTS_PROT; | 335 | changed |= BSS_CHANGED_ERP_CTS_PROT; |
336 | } | 336 | } |
337 | 337 | ||
338 | if (preamble_mode != bss_conf->use_short_preamble) { | 338 | if (use_short_preamble != bss_conf->use_short_preamble) { |
339 | if (net_ratelimit()) { | 339 | if (net_ratelimit()) { |
340 | printk(KERN_DEBUG "%s: switched to %s barker preamble" | 340 | printk(KERN_DEBUG "%s: switched to %s barker preamble" |
341 | " (BSSID=%s)\n", | 341 | " (BSSID=%s)\n", |
342 | sdata->dev->name, | 342 | sdata->dev->name, |
343 | (preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ? | 343 | use_short_preamble ? "short" : "long", |
344 | "short" : "long", | ||
345 | print_mac(mac, ifsta->bssid)); | 344 | print_mac(mac, ifsta->bssid)); |
346 | } | 345 | } |
347 | bss_conf->use_short_preamble = preamble_mode; | 346 | bss_conf->use_short_preamble = use_short_preamble; |
348 | changed |= BSS_CHANGED_ERP_PREAMBLE; | 347 | changed |= BSS_CHANGED_ERP_PREAMBLE; |
349 | } | 348 | } |
350 | 349 | ||
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index e88e96af613d..8599068050ec 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c | |||
@@ -395,7 +395,7 @@ EXPORT_SYMBOL_GPL(nf_ct_log_invalid); | |||
395 | static int __init nf_conntrack_standalone_init(void) | 395 | static int __init nf_conntrack_standalone_init(void) |
396 | { | 396 | { |
397 | #ifdef CONFIG_PROC_FS | 397 | #ifdef CONFIG_PROC_FS |
398 | struct proc_dir_entry *proc, *proc_stat; | 398 | struct proc_dir_entry *proc; |
399 | #endif | 399 | #endif |
400 | int ret = 0; | 400 | int ret = 0; |
401 | 401 | ||
@@ -407,12 +407,9 @@ static int __init nf_conntrack_standalone_init(void) | |||
407 | proc = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops); | 407 | proc = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops); |
408 | if (!proc) goto cleanup_init; | 408 | if (!proc) goto cleanup_init; |
409 | 409 | ||
410 | proc_stat = create_proc_entry("nf_conntrack", S_IRUGO, init_net.proc_net_stat); | 410 | if (!proc_create("nf_conntrack", S_IRUGO, |
411 | if (!proc_stat) | 411 | init_net.proc_net_stat, &ct_cpu_seq_fops)) |
412 | goto cleanup_proc; | 412 | goto cleanup_proc; |
413 | |||
414 | proc_stat->proc_fops = &ct_cpu_seq_fops; | ||
415 | proc_stat->owner = THIS_MODULE; | ||
416 | #endif | 413 | #endif |
417 | #ifdef CONFIG_SYSCTL | 414 | #ifdef CONFIG_SYSCTL |
418 | nf_ct_sysctl_header = register_sysctl_paths(nf_ct_path, | 415 | nf_ct_sysctl_header = register_sysctl_paths(nf_ct_path, |
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index cec9976aecbf..bc11d7092032 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
@@ -168,13 +168,9 @@ static const struct file_operations nflog_file_ops = { | |||
168 | int __init netfilter_log_init(void) | 168 | int __init netfilter_log_init(void) |
169 | { | 169 | { |
170 | #ifdef CONFIG_PROC_FS | 170 | #ifdef CONFIG_PROC_FS |
171 | struct proc_dir_entry *pde; | 171 | if (!proc_create("nf_log", S_IRUGO, |
172 | 172 | proc_net_netfilter, &nflog_file_ops)) | |
173 | pde = create_proc_entry("nf_log", S_IRUGO, proc_net_netfilter); | ||
174 | if (!pde) | ||
175 | return -1; | 173 | return -1; |
176 | |||
177 | pde->proc_fops = &nflog_file_ops; | ||
178 | #endif | 174 | #endif |
179 | return 0; | 175 | return 0; |
180 | } | 176 | } |
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index ddc80ea114cd..bbd26893c0c4 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c | |||
@@ -348,12 +348,9 @@ static const struct file_operations nfqueue_file_ops = { | |||
348 | int __init netfilter_queue_init(void) | 348 | int __init netfilter_queue_init(void) |
349 | { | 349 | { |
350 | #ifdef CONFIG_PROC_FS | 350 | #ifdef CONFIG_PROC_FS |
351 | struct proc_dir_entry *pde; | 351 | if (!proc_create("nf_queue", S_IRUGO, |
352 | 352 | proc_net_netfilter, &nfqueue_file_ops)) | |
353 | pde = create_proc_entry("nf_queue", S_IRUGO, proc_net_netfilter); | ||
354 | if (!pde) | ||
355 | return -1; | 353 | return -1; |
356 | pde->proc_fops = &nfqueue_file_ops; | ||
357 | #endif | 354 | #endif |
358 | return 0; | 355 | return 0; |
359 | } | 356 | } |
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index bf3f19b21fe4..b8173af8c24a 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -923,9 +923,6 @@ static const struct file_operations nful_file_ops = { | |||
923 | static int __init nfnetlink_log_init(void) | 923 | static int __init nfnetlink_log_init(void) |
924 | { | 924 | { |
925 | int i, status = -ENOMEM; | 925 | int i, status = -ENOMEM; |
926 | #ifdef CONFIG_PROC_FS | ||
927 | struct proc_dir_entry *proc_nful; | ||
928 | #endif | ||
929 | 926 | ||
930 | for (i = 0; i < INSTANCE_BUCKETS; i++) | 927 | for (i = 0; i < INSTANCE_BUCKETS; i++) |
931 | INIT_HLIST_HEAD(&instance_table[i]); | 928 | INIT_HLIST_HEAD(&instance_table[i]); |
@@ -943,11 +940,9 @@ static int __init nfnetlink_log_init(void) | |||
943 | } | 940 | } |
944 | 941 | ||
945 | #ifdef CONFIG_PROC_FS | 942 | #ifdef CONFIG_PROC_FS |
946 | proc_nful = create_proc_entry("nfnetlink_log", 0440, | 943 | if (!proc_create("nfnetlink_log", 0440, |
947 | proc_net_netfilter); | 944 | proc_net_netfilter, &nful_file_ops)) |
948 | if (!proc_nful) | ||
949 | goto cleanup_subsys; | 945 | goto cleanup_subsys; |
950 | proc_nful->proc_fops = &nful_file_ops; | ||
951 | #endif | 946 | #endif |
952 | return status; | 947 | return status; |
953 | 948 | ||
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 012cb6910820..10522c04ed24 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
@@ -896,9 +896,6 @@ static const struct file_operations nfqnl_file_ops = { | |||
896 | static int __init nfnetlink_queue_init(void) | 896 | static int __init nfnetlink_queue_init(void) |
897 | { | 897 | { |
898 | int i, status = -ENOMEM; | 898 | int i, status = -ENOMEM; |
899 | #ifdef CONFIG_PROC_FS | ||
900 | struct proc_dir_entry *proc_nfqueue; | ||
901 | #endif | ||
902 | 899 | ||
903 | for (i = 0; i < INSTANCE_BUCKETS; i++) | 900 | for (i = 0; i < INSTANCE_BUCKETS; i++) |
904 | INIT_HLIST_HEAD(&instance_table[i]); | 901 | INIT_HLIST_HEAD(&instance_table[i]); |
@@ -911,11 +908,9 @@ static int __init nfnetlink_queue_init(void) | |||
911 | } | 908 | } |
912 | 909 | ||
913 | #ifdef CONFIG_PROC_FS | 910 | #ifdef CONFIG_PROC_FS |
914 | proc_nfqueue = create_proc_entry("nfnetlink_queue", 0440, | 911 | if (!proc_create("nfnetlink_queue", 0440, |
915 | proc_net_netfilter); | 912 | proc_net_netfilter, &nfqnl_file_ops)) |
916 | if (!proc_nfqueue) | ||
917 | goto cleanup_subsys; | 913 | goto cleanup_subsys; |
918 | proc_nfqueue->proc_fops = &nfqnl_file_ops; | ||
919 | #endif | 914 | #endif |
920 | 915 | ||
921 | register_netdevice_notifier(&nfqnl_dev_notifier); | 916 | register_netdevice_notifier(&nfqnl_dev_notifier); |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 5418ce59ac3a..dc29007c52cd 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -237,14 +237,14 @@ static int htable_create_v0(struct xt_hashlimit_info *minfo, int family) | |||
237 | hinfo->family = family; | 237 | hinfo->family = family; |
238 | hinfo->rnd_initialized = 0; | 238 | hinfo->rnd_initialized = 0; |
239 | spin_lock_init(&hinfo->lock); | 239 | spin_lock_init(&hinfo->lock); |
240 | hinfo->pde = create_proc_entry(minfo->name, 0, | 240 | hinfo->pde = proc_create(minfo->name, 0, |
241 | family == AF_INET ? hashlimit_procdir4 : | 241 | family == AF_INET ? hashlimit_procdir4 : |
242 | hashlimit_procdir6); | 242 | hashlimit_procdir6, |
243 | &dl_file_ops); | ||
243 | if (!hinfo->pde) { | 244 | if (!hinfo->pde) { |
244 | vfree(hinfo); | 245 | vfree(hinfo); |
245 | return -1; | 246 | return -1; |
246 | } | 247 | } |
247 | hinfo->pde->proc_fops = &dl_file_ops; | ||
248 | hinfo->pde->data = hinfo; | 248 | hinfo->pde->data = hinfo; |
249 | 249 | ||
250 | setup_timer(&hinfo->timer, htable_gc, (unsigned long )hinfo); | 250 | setup_timer(&hinfo->timer, htable_gc, (unsigned long )hinfo); |
@@ -301,14 +301,14 @@ static int htable_create(struct xt_hashlimit_mtinfo1 *minfo, | |||
301 | hinfo->rnd_initialized = 0; | 301 | hinfo->rnd_initialized = 0; |
302 | spin_lock_init(&hinfo->lock); | 302 | spin_lock_init(&hinfo->lock); |
303 | 303 | ||
304 | hinfo->pde = create_proc_entry(minfo->name, 0, | 304 | hinfo->pde = proc_create(minfo->name, 0, |
305 | family == AF_INET ? hashlimit_procdir4 : | 305 | family == AF_INET ? hashlimit_procdir4 : |
306 | hashlimit_procdir6); | 306 | hashlimit_procdir6, |
307 | &dl_file_ops); | ||
307 | if (hinfo->pde == NULL) { | 308 | if (hinfo->pde == NULL) { |
308 | vfree(hinfo); | 309 | vfree(hinfo); |
309 | return -1; | 310 | return -1; |
310 | } | 311 | } |
311 | hinfo->pde->proc_fops = &dl_file_ops; | ||
312 | hinfo->pde->data = hinfo; | 312 | hinfo->pde->data = hinfo; |
313 | 313 | ||
314 | setup_timer(&hinfo->timer, htable_gc, (unsigned long)hinfo); | 314 | setup_timer(&hinfo->timer, htable_gc, (unsigned long)hinfo); |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 4a31a81059ab..063cbc5c26b1 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -598,17 +598,24 @@ static int rose_release(struct socket *sock) | |||
598 | 598 | ||
599 | if (sk == NULL) return 0; | 599 | if (sk == NULL) return 0; |
600 | 600 | ||
601 | sock_hold(sk); | ||
602 | sock_orphan(sk); | ||
603 | lock_sock(sk); | ||
601 | rose = rose_sk(sk); | 604 | rose = rose_sk(sk); |
602 | 605 | ||
603 | switch (rose->state) { | 606 | switch (rose->state) { |
604 | case ROSE_STATE_0: | 607 | case ROSE_STATE_0: |
608 | release_sock(sk); | ||
605 | rose_disconnect(sk, 0, -1, -1); | 609 | rose_disconnect(sk, 0, -1, -1); |
610 | lock_sock(sk); | ||
606 | rose_destroy_socket(sk); | 611 | rose_destroy_socket(sk); |
607 | break; | 612 | break; |
608 | 613 | ||
609 | case ROSE_STATE_2: | 614 | case ROSE_STATE_2: |
610 | rose->neighbour->use--; | 615 | rose->neighbour->use--; |
616 | release_sock(sk); | ||
611 | rose_disconnect(sk, 0, -1, -1); | 617 | rose_disconnect(sk, 0, -1, -1); |
618 | lock_sock(sk); | ||
612 | rose_destroy_socket(sk); | 619 | rose_destroy_socket(sk); |
613 | break; | 620 | break; |
614 | 621 | ||
@@ -633,6 +640,8 @@ static int rose_release(struct socket *sock) | |||
633 | } | 640 | } |
634 | 641 | ||
635 | sock->sk = NULL; | 642 | sock->sk = NULL; |
643 | release_sock(sk); | ||
644 | sock_put(sk); | ||
636 | 645 | ||
637 | return 0; | 646 | return 0; |
638 | } | 647 | } |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 10b5c0887fff..b741618e4d54 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -184,10 +184,22 @@ static inline int qdisc_restart(struct net_device *dev) | |||
184 | 184 | ||
185 | void __qdisc_run(struct net_device *dev) | 185 | void __qdisc_run(struct net_device *dev) |
186 | { | 186 | { |
187 | do { | 187 | unsigned long start_time = jiffies; |
188 | if (!qdisc_restart(dev)) | 188 | |
189 | while (qdisc_restart(dev)) { | ||
190 | if (netif_queue_stopped(dev)) | ||
191 | break; | ||
192 | |||
193 | /* | ||
194 | * Postpone processing if | ||
195 | * 1. another process needs the CPU; | ||
196 | * 2. we've been doing it for too long. | ||
197 | */ | ||
198 | if (need_resched() || jiffies != start_time) { | ||
199 | netif_schedule(dev); | ||
189 | break; | 200 | break; |
190 | } while (!netif_queue_stopped(dev)); | 201 | } |
202 | } | ||
191 | 203 | ||
192 | clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state); | 204 | clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state); |
193 | } | 205 | } |