[PATCH] drivers/net/wireless: correct reported ssid lengths
authorDan Williams <dcbw@redhat.com>
Thu, 12 Jan 2006 20:00:58 +0000 (15:00 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 Jan 2006 21:51:53 +0000 (16:51 -0500)
ESSIDs can technically include NULL characters.  Drivers should not be
adjusting the length of the ESSID before reporting it in their
SIOCGIWESSID handlers.  Breaks stuff like wpa_supplicant.  Note that ipw
drivers, which seem to currently be the "most correct", don't have this
problem.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/airo.c
drivers/net/wireless/atmel.c
drivers/net/wireless/prism54/isl_ioctl.c
drivers/net/wireless/ray_cs.c
drivers/net/wireless/wavelan_cs.c

index ee866fd6957de2cf9ed0f3b75a9ca37971c4534b..65057348838b69ae7e9c493cb58dea7974f81235 100644 (file)
@@ -5783,7 +5783,7 @@ static int airo_get_essid(struct net_device *dev,
        /* If none, we may want to get the one that was set */
 
        /* Push it out ! */
-       dwrq->length = status_rid.SSIDlen + 1;
+       dwrq->length = status_rid.SSIDlen;
        dwrq->flags = 1; /* active */
 
        return 0;
index f0ccfef664459fced62da435aec49d65da8dd11a..98a76f10a0f71f29f09ef031b000659dbbccb09c 100644 (file)
@@ -1718,11 +1718,11 @@ static int atmel_get_essid(struct net_device *dev,
        if (priv->new_SSID_size != 0) {
                memcpy(extra, priv->new_SSID, priv->new_SSID_size);
                extra[priv->new_SSID_size] = '\0';
-               dwrq->length = priv->new_SSID_size + 1;
+               dwrq->length = priv->new_SSID_size;
        } else {
                memcpy(extra, priv->SSID, priv->SSID_size);
                extra[priv->SSID_size] = '\0';
-               dwrq->length = priv->SSID_size + 1;
+               dwrq->length = priv->SSID_size;
        }
 
        dwrq->flags = !priv->connect_to_any_BSS; /* active */
index 135a156db25d9c07607d7ce0cae5cb9019636417..c5cd61c7f92774043c3184b2b5b23983748adda0 100644 (file)
@@ -748,7 +748,7 @@ prism54_get_essid(struct net_device *ndev, struct iw_request_info *info,
        if (essid->length) {
                dwrq->flags = 1;        /* set ESSID to ON for Wireless Extensions */
                /* if it is to big, trunk it */
-               dwrq->length = min(IW_ESSID_MAX_SIZE, essid->length + 1);
+               dwrq->length = min(IW_ESSID_MAX_SIZE, essid->length);
        } else {
                dwrq->flags = 0;
                dwrq->length = 0;
index 319180ca7e71325cc30350c85cd6bae57391e8da..7880d8c31aadc20abb96e554af606d4a337663f1 100644 (file)
@@ -1256,7 +1256,7 @@ static int ray_get_essid(struct net_device *dev,
        extra[IW_ESSID_MAX_SIZE] = '\0';
 
        /* Push it out ! */
-       dwrq->length = strlen(extra) + 1;
+       dwrq->length = strlen(extra);
        dwrq->flags = 1; /* active */
 
        return 0;
index 7e2039f52c49fdcef509b7529626d38282522fb9..cf373625fc7074e3bdfb2f2abf214856c4142c81 100644 (file)
@@ -2280,7 +2280,7 @@ static int wavelan_get_essid(struct net_device *dev,
        extra[IW_ESSID_MAX_SIZE] = '\0';
 
        /* Set the length */
-       wrqu->data.length = strlen(extra) + 1;
+       wrqu->data.length = strlen(extra);
 
        return 0;
 }
This page took 0.036372 seconds and 5 git commands to generate.