2014-11-04 15:15:16

by Henning Rogge

[permalink] [raw]
Subject: [PATCH] cfg80211: fix nl80211 cmd id in nl80211_send_mpath()

Netlink command for nl80211_send_mpath() should be NL80211_CMD_NEW_MPATH.

Signed-off-by: Henning Rogge <[email protected]>
---
net/wireless/nl80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index cb9f5a4..7c20040 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4423,7 +4423,7 @@ static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq,
void *hdr;
struct nlattr *pinfoattr;

- hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_STATION);
+ hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_MPATH);
if (!hdr)
return -1;

--
2.1.0



2014-11-04 16:05:13

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: fix nl80211 cmd id in nl80211_send_mpath()

On Tue, 2014-11-04 at 16:56 +0100, Henning Rogge wrote:
> Hi,
>
> the only reason why nobody noticed is that the "iw" tool does not even
> check the cmd field of the kernel replies it process. I wonder if "iw"
> should check the value, just to make sure bugs like this are easier to
> detect.

It doesn't really have to since it's not processing events on the same
socket ... but maybe we should just add some sanity checks.

johannes


2014-11-04 15:37:46

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: fix nl80211 cmd id in nl80211_send_mpath()

On Tue, 2014-11-04 at 16:14 +0100, Henning Rogge wrote:
> Netlink command for nl80211_send_mpath() should be NL80211_CMD_NEW_MPATH.

Doh. Applied, of course.

johannes


2014-11-04 15:57:16

by Henning Rogge

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: fix nl80211 cmd id in nl80211_send_mpath()

Hi,

the only reason why nobody noticed is that the "iw" tool does not even
check the cmd field of the kernel replies it process. I wonder if "iw"
should check the value, just to make sure bugs like this are easier to
detect.

Henning Rogge

On Tue, Nov 4, 2014 at 4:37 PM, Johannes Berg <[email protected]> wrote:
> On Tue, 2014-11-04 at 16:14 +0100, Henning Rogge wrote:
>> Netlink command for nl80211_send_mpath() should be NL80211_CMD_NEW_MPATH.
>
> Doh. Applied, of course.
>
> johannes
>