Merge ~pieq/plainbox-provider-resource:fix_1581474 into plainbox-provider-resource:master

Proposed by Pierre Equoy
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 977680232f086658b076bcf805953bf8e2c7f026
Merged at revision: a54d2f5e208e0dac01f2eb0e3d008152f75b2cd1
Proposed branch: ~pieq/plainbox-provider-resource:fix_1581474
Merge into: plainbox-provider-resource:master
Diff against target: 12 lines (+1/-0)
1 file modified
src/80211_resource.c (+1/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+308787@code.launchpad.net

Description of the change

In recent nl80211.h headers used in Xenial and Trusty (in package libnl-3-dev),
we have this:

enum nl80211_iftype {
 NL80211_IFTYPE_UNSPECIFIED,
 NL80211_IFTYPE_ADHOC,
 NL80211_IFTYPE_STATION,
 NL80211_IFTYPE_AP,
 NL80211_IFTYPE_AP_VLAN,
 NL80211_IFTYPE_WDS,
 NL80211_IFTYPE_MONITOR,
 NL80211_IFTYPE_MESH_POINT,
 NL80211_IFTYPE_P2P_CLIENT,
 NL80211_IFTYPE_P2P_GO,
 NL80211_IFTYPE_P2P_DEVICE,
 NL80211_IFTYPE_OCB,

 /* keep last */
 NUM_NL80211_IFTYPES,
 NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
};

NL80211_IFTYPE_OCB is new and means "Outside Context of a BSS".
On some devices, our program tries to access ifmodes[NL80211_IFTYPE_OCB],
which doesn't exist...

Before this fix is applied, when running the program on the test device:

-----------------------------------------
$ ./80211_resource
IBSS: supported
managed: supported
AP: supported
AP_VLAN: supported
WDS: supported
monitor: supported
mesh_point: supported
P2P_client: supported
P2P_GO: supported
Segmentation fault (core dumped)
-----------------------------------------

After:

-----------------------------------------
$ ./80211_resource
IBSS: supported
managed: supported
AP: supported
AP_VLAN: supported
WDS: supported
monitor: supported
mesh_point: supported
P2P_client: supported
P2P_GO: supported
outside_context_BSS: supported
n: supported
bg: supported
-----------------------------------------

This patch has been tested on both Trusty and Xenial.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

What a good gdb session, well done. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/80211_resource.c b/src/80211_resource.c
2index df9d975..102a266 100644
3--- a/src/80211_resource.c
4+++ b/src/80211_resource.c
5@@ -61,6 +61,7 @@ static const char *ifmodes[] = {
6 "P2P_client",
7 "P2P_GO",
8 "P2P_device",
9+ "outside_context_BSS",
10 };
11
12 #define BIT(x) (1ULL<<(x))

Subscribers

People subscribed via source and target branches