aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br_if.c2
-rw-r--r--net/irda/irttp.c1
-rw-r--r--net/mac80211/Kconfig1
-rw-r--r--net/mac80211/mesh_pathtbl.c11
-rw-r--r--net/mac80211/tx.c2
-rw-r--r--net/rfkill/core.c31
-rw-r--r--net/rose/af_rose.c18
-rw-r--r--net/rose/rose_route.c23
-rw-r--r--net/wireless/nl80211.c5
-rw-r--r--net/wireless/scan.c3
10 files changed, 59 insertions, 38 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 8a96672e2c5c..eb404dc3ed6e 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -424,7 +424,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
424err2: 424err2:
425 br_fdb_delete_by_port(br, p, 1); 425 br_fdb_delete_by_port(br, p, 1);
426err1: 426err1:
427 kobject_del(&p->kobj); 427 kobject_put(&p->kobj);
428err0: 428err0:
429 dev_set_promiscuity(dev, -1); 429 dev_set_promiscuity(dev, -1);
430put_back: 430put_back:
diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index ecf4eb2717cb..9cb79f95bf63 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
@@ -1453,6 +1453,7 @@ struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance)
1453 } 1453 }
1454 /* Dup */ 1454 /* Dup */
1455 memcpy(new, orig, sizeof(struct tsap_cb)); 1455 memcpy(new, orig, sizeof(struct tsap_cb));
1456 spin_lock_init(&new->lock);
1456 1457
1457 /* We don't need the old instance any more */ 1458 /* We don't need the old instance any more */
1458 spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags); 1459 spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags);
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index ba2643a43c73..7836ee928983 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -83,6 +83,7 @@ endmenu
83config MAC80211_MESH 83config MAC80211_MESH
84 bool "Enable mac80211 mesh networking (pre-802.11s) support" 84 bool "Enable mac80211 mesh networking (pre-802.11s) support"
85 depends on MAC80211 && EXPERIMENTAL 85 depends on MAC80211 && EXPERIMENTAL
86 depends on BROKEN
86 ---help--- 87 ---help---
87 This options enables support of Draft 802.11s mesh networking. 88 This options enables support of Draft 802.11s mesh networking.
88 The implementation is based on Draft 1.08 of the Mesh Networking 89 The implementation is based on Draft 1.08 of the Mesh Networking
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 3c72557df45a..479597e88583 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -175,6 +175,8 @@ int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
175 int err = 0; 175 int err = 0;
176 u32 hash_idx; 176 u32 hash_idx;
177 177
178 might_sleep();
179
178 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0) 180 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
179 /* never add ourselves as neighbours */ 181 /* never add ourselves as neighbours */
180 return -ENOTSUPP; 182 return -ENOTSUPP;
@@ -265,6 +267,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
265 int err = 0; 267 int err = 0;
266 u32 hash_idx; 268 u32 hash_idx;
267 269
270 might_sleep();
268 271
269 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0) 272 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
270 /* never add ourselves as neighbours */ 273 /* never add ourselves as neighbours */
@@ -491,8 +494,10 @@ void mesh_path_tx_pending(struct mesh_path *mpath)
491 * @skb: frame to discard 494 * @skb: frame to discard
492 * @sdata: network subif the frame was to be sent through 495 * @sdata: network subif the frame was to be sent through
493 * 496 *
494 * If the frame was beign forwarded from another MP, a PERR frame will be sent 497 * If the frame was being forwarded from another MP, a PERR frame will be sent
495 * to the precursor. 498 * to the precursor. The precursor's address (i.e. the previous hop) was saved
499 * in addr1 of the frame-to-be-forwarded, and would only be overwritten once
500 * the destination is successfully resolved.
496 * 501 *
497 * Locking: the function must me called within a rcu_read_lock region 502 * Locking: the function must me called within a rcu_read_lock region
498 */ 503 */
@@ -507,7 +512,7 @@ void mesh_path_discard_frame(struct sk_buff *skb,
507 u8 *ra, *da; 512 u8 *ra, *da;
508 513
509 da = hdr->addr3; 514 da = hdr->addr3;
510 ra = hdr->addr2; 515 ra = hdr->addr1;
511 mpath = mesh_path_lookup(da, sdata); 516 mpath = mesh_path_lookup(da, sdata);
512 if (mpath) 517 if (mpath)
513 dsn = ++mpath->dsn; 518 dsn = ++mpath->dsn;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index d238a8939a09..3a8922cd1038 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1455,7 +1455,7 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
1455 monitor_iface = UNKNOWN_ADDRESS; 1455 monitor_iface = UNKNOWN_ADDRESS;
1456 1456
1457 len_rthdr = ieee80211_get_radiotap_len(skb->data); 1457 len_rthdr = ieee80211_get_radiotap_len(skb->data);
1458 hdr = (struct ieee80211_hdr *)skb->data + len_rthdr; 1458 hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr);
1459 hdrlen = ieee80211_hdrlen(hdr->frame_control); 1459 hdrlen = ieee80211_hdrlen(hdr->frame_control);
1460 1460
1461 /* check the header is complete in the frame */ 1461 /* check the header is complete in the frame */
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 79693fe2001e..2fc4a1724eb8 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -549,6 +549,10 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw)
549 swprev = !!(rfkill->state & RFKILL_BLOCK_SW); 549 swprev = !!(rfkill->state & RFKILL_BLOCK_SW);
550 hwprev = !!(rfkill->state & RFKILL_BLOCK_HW); 550 hwprev = !!(rfkill->state & RFKILL_BLOCK_HW);
551 __rfkill_set_sw_state(rfkill, sw); 551 __rfkill_set_sw_state(rfkill, sw);
552 if (hw)
553 rfkill->state |= RFKILL_BLOCK_HW;
554 else
555 rfkill->state &= ~RFKILL_BLOCK_HW;
552 556
553 spin_unlock_irqrestore(&rfkill->lock, flags); 557 spin_unlock_irqrestore(&rfkill->lock, flags);
554 558
@@ -648,15 +652,26 @@ static ssize_t rfkill_state_store(struct device *dev,
648 struct device_attribute *attr, 652 struct device_attribute *attr,
649 const char *buf, size_t count) 653 const char *buf, size_t count)
650{ 654{
651 /* 655 struct rfkill *rfkill = to_rfkill(dev);
652 * The intention was that userspace can only take control over 656 unsigned long state;
653 * a given device when/if rfkill-input doesn't control it due 657 int err;
654 * to user_claim. Since user_claim is currently unsupported, 658
655 * we never support changing the state from userspace -- this 659 if (!capable(CAP_NET_ADMIN))
656 * can be implemented again later. 660 return -EPERM;
657 */ 661
662 err = strict_strtoul(buf, 0, &state);
663 if (err)
664 return err;
665
666 if (state != RFKILL_USER_STATE_SOFT_BLOCKED &&
667 state != RFKILL_USER_STATE_UNBLOCKED)
668 return -EINVAL;
669
670 mutex_lock(&rfkill_global_mutex);
671 rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED);
672 mutex_unlock(&rfkill_global_mutex);
658 673
659 return -EPERM; 674 return err ?: count;
660} 675}
661 676
662static ssize_t rfkill_claim_show(struct device *dev, 677static ssize_t rfkill_claim_show(struct device *dev,
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 6bd8e93869ed..f0a76f6bca71 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -92,23 +92,21 @@ static void rose_set_lockdep_key(struct net_device *dev)
92/* 92/*
93 * Convert a ROSE address into text. 93 * Convert a ROSE address into text.
94 */ 94 */
95const char *rose2asc(const rose_address *addr) 95char *rose2asc(char *buf, const rose_address *addr)
96{ 96{
97 static char buffer[11];
98
99 if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 && 97 if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 &&
100 addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 && 98 addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 &&
101 addr->rose_addr[4] == 0x00) { 99 addr->rose_addr[4] == 0x00) {
102 strcpy(buffer, "*"); 100 strcpy(buf, "*");
103 } else { 101 } else {
104 sprintf(buffer, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF, 102 sprintf(buf, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF,
105 addr->rose_addr[1] & 0xFF, 103 addr->rose_addr[1] & 0xFF,
106 addr->rose_addr[2] & 0xFF, 104 addr->rose_addr[2] & 0xFF,
107 addr->rose_addr[3] & 0xFF, 105 addr->rose_addr[3] & 0xFF,
108 addr->rose_addr[4] & 0xFF); 106 addr->rose_addr[4] & 0xFF);
109 } 107 }
110 108
111 return buffer; 109 return buf;
112} 110}
113 111
114/* 112/*
@@ -1437,7 +1435,7 @@ static void rose_info_stop(struct seq_file *seq, void *v)
1437 1435
1438static int rose_info_show(struct seq_file *seq, void *v) 1436static int rose_info_show(struct seq_file *seq, void *v)
1439{ 1437{
1440 char buf[11]; 1438 char buf[11], rsbuf[11];
1441 1439
1442 if (v == SEQ_START_TOKEN) 1440 if (v == SEQ_START_TOKEN)
1443 seq_puts(seq, 1441 seq_puts(seq,
@@ -1455,8 +1453,8 @@ static int rose_info_show(struct seq_file *seq, void *v)
1455 devname = dev->name; 1453 devname = dev->name;
1456 1454
1457 seq_printf(seq, "%-10s %-9s ", 1455 seq_printf(seq, "%-10s %-9s ",
1458 rose2asc(&rose->dest_addr), 1456 rose2asc(rsbuf, &rose->dest_addr),
1459 ax2asc(buf, &rose->dest_call)); 1457 ax2asc(buf, &rose->dest_call));
1460 1458
1461 if (ax25cmp(&rose->source_call, &null_ax25_address) == 0) 1459 if (ax25cmp(&rose->source_call, &null_ax25_address) == 0)
1462 callsign = "??????-?"; 1460 callsign = "??????-?";
@@ -1465,7 +1463,7 @@ static int rose_info_show(struct seq_file *seq, void *v)
1465 1463
1466 seq_printf(seq, 1464 seq_printf(seq,
1467 "%-10s %-9s %-5s %3.3X %05d %d %d %d %d %3lu %3lu %3lu %3lu %3lu %3lu/%03lu %5d %5d %ld\n", 1465 "%-10s %-9s %-5s %3.3X %05d %d %d %d %d %3lu %3lu %3lu %3lu %3lu %3lu/%03lu %5d %5d %ld\n",
1468 rose2asc(&rose->source_addr), 1466 rose2asc(rsbuf, &rose->source_addr),
1469 callsign, 1467 callsign,
1470 devname, 1468 devname,
1471 rose->lci & 0x0FFF, 1469 rose->lci & 0x0FFF,
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index a81066a1010a..9478d9b3d977 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -1104,6 +1104,7 @@ static void rose_node_stop(struct seq_file *seq, void *v)
1104 1104
1105static int rose_node_show(struct seq_file *seq, void *v) 1105static int rose_node_show(struct seq_file *seq, void *v)
1106{ 1106{
1107 char rsbuf[11];
1107 int i; 1108 int i;
1108 1109
1109 if (v == SEQ_START_TOKEN) 1110 if (v == SEQ_START_TOKEN)
@@ -1112,13 +1113,13 @@ static int rose_node_show(struct seq_file *seq, void *v)
1112 const struct rose_node *rose_node = v; 1113 const struct rose_node *rose_node = v;
1113 /* if (rose_node->loopback) { 1114 /* if (rose_node->loopback) {
1114 seq_printf(seq, "%-10s %04d 1 loopback\n", 1115 seq_printf(seq, "%-10s %04d 1 loopback\n",
1115 rose2asc(&rose_node->address), 1116 rose2asc(rsbuf, &rose_node->address),
1116 rose_node->mask); 1117 rose_node->mask);
1117 } else { */ 1118 } else { */
1118 seq_printf(seq, "%-10s %04d %d", 1119 seq_printf(seq, "%-10s %04d %d",
1119 rose2asc(&rose_node->address), 1120 rose2asc(rsbuf, &rose_node->address),
1120 rose_node->mask, 1121 rose_node->mask,
1121 rose_node->count); 1122 rose_node->count);
1122 1123
1123 for (i = 0; i < rose_node->count; i++) 1124 for (i = 0; i < rose_node->count; i++)
1124 seq_printf(seq, " %05d", 1125 seq_printf(seq, " %05d",
@@ -1267,7 +1268,7 @@ static void rose_route_stop(struct seq_file *seq, void *v)
1267 1268
1268static int rose_route_show(struct seq_file *seq, void *v) 1269static int rose_route_show(struct seq_file *seq, void *v)
1269{ 1270{
1270 char buf[11]; 1271 char buf[11], rsbuf[11];
1271 1272
1272 if (v == SEQ_START_TOKEN) 1273 if (v == SEQ_START_TOKEN)
1273 seq_puts(seq, 1274 seq_puts(seq,
@@ -1279,7 +1280,7 @@ static int rose_route_show(struct seq_file *seq, void *v)
1279 seq_printf(seq, 1280 seq_printf(seq,
1280 "%3.3X %-10s %-9s %05d ", 1281 "%3.3X %-10s %-9s %05d ",
1281 rose_route->lci1, 1282 rose_route->lci1,
1282 rose2asc(&rose_route->src_addr), 1283 rose2asc(rsbuf, &rose_route->src_addr),
1283 ax2asc(buf, &rose_route->src_call), 1284 ax2asc(buf, &rose_route->src_call),
1284 rose_route->neigh1->number); 1285 rose_route->neigh1->number);
1285 else 1286 else
@@ -1289,10 +1290,10 @@ static int rose_route_show(struct seq_file *seq, void *v)
1289 if (rose_route->neigh2) 1290 if (rose_route->neigh2)
1290 seq_printf(seq, 1291 seq_printf(seq,
1291 "%3.3X %-10s %-9s %05d\n", 1292 "%3.3X %-10s %-9s %05d\n",
1292 rose_route->lci2, 1293 rose_route->lci2,
1293 rose2asc(&rose_route->dest_addr), 1294 rose2asc(rsbuf, &rose_route->dest_addr),
1294 ax2asc(buf, &rose_route->dest_call), 1295 ax2asc(buf, &rose_route->dest_call),
1295 rose_route->neigh2->number); 1296 rose_route->neigh2->number);
1296 else 1297 else
1297 seq_puts(seq, 1298 seq_puts(seq,
1298 "000 * * 00000\n"); 1299 "000 * * 00000\n");
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 43bdb1372cae..634496b3ed77 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -997,7 +997,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
997 997
998 if (IS_ERR(hdr)) { 998 if (IS_ERR(hdr)) {
999 err = PTR_ERR(hdr); 999 err = PTR_ERR(hdr);
1000 goto out; 1000 goto free_msg;
1001 } 1001 }
1002 1002
1003 cookie.msg = msg; 1003 cookie.msg = msg;
@@ -1011,7 +1011,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1011 &cookie, get_key_callback); 1011 &cookie, get_key_callback);
1012 1012
1013 if (err) 1013 if (err)
1014 goto out; 1014 goto free_msg;
1015 1015
1016 if (cookie.error) 1016 if (cookie.error)
1017 goto nla_put_failure; 1017 goto nla_put_failure;
@@ -1022,6 +1022,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1022 1022
1023 nla_put_failure: 1023 nla_put_failure:
1024 err = -ENOBUFS; 1024 err = -ENOBUFS;
1025 free_msg:
1025 nlmsg_free(msg); 1026 nlmsg_free(msg);
1026 out: 1027 out:
1027 cfg80211_put_dev(drv); 1028 cfg80211_put_dev(drv);
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index f8e71b300001..9271118e1fc4 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -35,8 +35,6 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted)
35 else 35 else
36 nl80211_send_scan_done(wiphy_to_dev(request->wiphy), dev); 36 nl80211_send_scan_done(wiphy_to_dev(request->wiphy), dev);
37 37
38 wiphy_to_dev(request->wiphy)->scan_req = NULL;
39
40#ifdef CONFIG_WIRELESS_EXT 38#ifdef CONFIG_WIRELESS_EXT
41 if (!aborted) { 39 if (!aborted) {
42 memset(&wrqu, 0, sizeof(wrqu)); 40 memset(&wrqu, 0, sizeof(wrqu));
@@ -48,6 +46,7 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted)
48 dev_put(dev); 46 dev_put(dev);
49 47
50 out: 48 out:
49 wiphy_to_dev(request->wiphy)->scan_req = NULL;
51 kfree(request); 50 kfree(request);
52} 51}
53EXPORT_SYMBOL(cfg80211_scan_done); 52EXPORT_SYMBOL(cfg80211_scan_done);