Skip to content

Commit

Permalink
nl80211: fix netlink snd_portinfo
Browse files Browse the repository at this point in the history
use genl_info_snd_portid() in nl80211.c for allowing building
with varoius kernel versions.

Signed-off-by: Eyal Reizer <eyalr@ti.com>
  • Loading branch information
eyalreizer committed Sep 8, 2013
1 parent 40d5abd commit f8214f9
Showing 1 changed file with 77 additions and 0 deletions.
@@ -0,0 +1,77 @@
From e8e412345dd09ab51c00340544eca83e6250d96d Mon Sep 17 00:00:00 2001
From: Eyal Reizer <eyalr@ti.com>
Date: Tue, 3 Sep 2013 16:46:53 +0300
Subject: [PATCH] nl80211: fix netlink portid usage

The patch:

commit 15e473046cb6e5d18a4d0057e61d76315230382b
Author: Eric W. Biederman <ebiederm@xmission.com>
Date: Fri Sep 7 20:12:54 2012 +0000

netlink: Rename pid to portid to avoid confusion

It is a frequent mistake to confuse the netlink port identifier with a
process identifier. Try to reduce this confusion by renaming fields
that hold port identifiers portid instead of pid.

I have carefully avoided changing the structures exported to
userspace to avoid changing the userspace API.

I have successfully built an allyesconfig kernel with this change.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Changed the struct members:

struct netlink_notify->pid to
struct netlink_notify->portid

struct genl_info->snd_pid to
struct genl_info->snd_portid

To help backport this and not have to #ifdef around it against
kernel versions compat has introduced two helpers for us to
simply do the backport with two macro helpers:

genl_info_snd_portid()
netlink_notify_portid()

most of this has been taken care of in the compat patch
"0005-netlink-portid.patch"

modify nl80211.c to use genl_info_snd_portid() where the previous patch was
missing it.

Signed-off-by: Eyal Reizer <eyalr@ti.com>
---
net/wireless/nl80211.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0f621b20..f949618 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5213,7 +5213,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
}

if (info->attrs[NL80211_ATTR_IM_SCAN_RESULT]) {
- rdev->im_scan_result_snd_pid = info->snd_portid;
+ rdev->im_scan_result_snd_pid = genl_info_snd_portid(info);
if (info->attrs[NL80211_ATTR_IM_SCAN_RESULT_MIN_RSSI]) {
attr = info->attrs[NL80211_ATTR_IM_SCAN_RESULT_MIN_RSSI];
rdev->im_scan_result_min_rssi_mbm =
@@ -8436,7 +8436,7 @@ static int nl80211_crit_protocol_start(struct sk_buff *skb,

ret = rdev_crit_proto_start(rdev, wdev, proto, duration);
if (!ret)
- rdev->crit_proto_nlportid = info->snd_portid;
+ rdev->crit_proto_nlportid = genl_info_snd_portid(info);

return ret;
}
--
1.7.9.5

0 comments on commit f8214f9

Please sign in to comment.