-
Notifications
You must be signed in to change notification settings - Fork 39
/
iw261_restore_full_essid.diff
60 lines (56 loc) · 1.82 KB
/
iw261_restore_full_essid.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff -u -p linux/net/core/wireless.j2.c linux/net/core/wireless.c
--- linux/net/core/wireless.j2.c 2007-03-21 14:41:51.000000000 -0700
+++ linux/net/core/wireless.c 2007-03-21 14:41:08.000000000 -0700
@@ -766,39 +766,11 @@ static int ioctl_standard_call(struct ne
int extra_size;
int user_length = 0;
int err;
- int essid_compat = 0;
/* Calculate space needed by arguments. Always allocate
* for max space. Easier, and won't last long... */
extra_size = descr->max_tokens * descr->token_size;
- /* Check need for ESSID compatibility for WE < 21 */
- switch (cmd) {
- case SIOCSIWESSID:
- case SIOCGIWESSID:
- case SIOCSIWNICKN:
- case SIOCGIWNICKN:
- if (iwr->u.data.length == descr->max_tokens + 1)
- essid_compat = 1;
- else if (IW_IS_SET(cmd) && (iwr->u.data.length != 0)) {
- char essid[IW_ESSID_MAX_SIZE + 1];
-
- err = copy_from_user(essid, iwr->u.data.pointer,
- iwr->u.data.length *
- descr->token_size);
- if (err)
- return -EFAULT;
-
- if (essid[iwr->u.data.length - 1] == '\0')
- essid_compat = 1;
- }
- break;
- default:
- break;
- }
-
- iwr->u.data.length -= essid_compat;
-
/* Check what user space is giving us */
if(IW_IS_SET(cmd)) {
/* Check NULL pointer */
@@ -841,7 +813,6 @@ static int ioctl_standard_call(struct ne
#endif /* WE_IOCTL_DEBUG */
/* Create the kernel buffer */
- /* kzalloc ensures NULL-termination for essid_compat */
extra = kzalloc(extra_size, GFP_KERNEL);
if (extra == NULL) {
return -ENOMEM;
@@ -866,8 +837,6 @@ static int ioctl_standard_call(struct ne
/* Call the handler */
ret = handler(dev, &info, &(iwr->u), extra);
- iwr->u.data.length += essid_compat;
-
/* If we have something to return to the user */
if (!ret && IW_IS_GET(cmd)) {
/* Check if there is enough buffer up there */