Make the ability to leave the plink_state unchanged not use a magic -1 variable that isn't in the enum, but an explicit change flag; reject invalid plink states or actions and move the needed constants for plink actions to the right header file. Also reject plink_state changes for non-mesh interfaces.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -884,7 +884,8 @@ enum nl80211_commands { · 883 unmodified lines | ||
| 884 | 884 | * consisting of a nested array. |
| 885 | 885 | * |
| 886 | 886 | * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). |
| 887 | − * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link. | |
| 887 | + * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link | |
| 888 | + * (see &enum nl80211_plink_action). | |
| 888 | 889 | * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. |
| 889 | 890 | * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path |
| 890 | 891 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at |
| @@ -3307,6 +3308,23 @@ enum nl80211_plink_state { · 2416 unmodified lines | ||
| 3307 | 3308 | MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 |
| 3308 | 3309 | }; |
| 3309 | 3310 | |
| 3311 | +/** | |
| 3312 | + * enum nl80211_plink_action - actions to perform in mesh peers | |
| 3313 | + * | |
| 3314 | + * @NL80211_PLINK_ACTION_NO_ACTION: perform no action | |
| 3315 | + * @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment | |
| 3316 | + * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer | |
| 3317 | + * @NUM_NL80211_PLINK_ACTIONS: number of possible actions | |
| 3318 | + */ | |
| 3319 | +enum plink_actions { | |
| 3320 | + NL80211_PLINK_ACTION_NO_ACTION, | |
| 3321 | + NL80211_PLINK_ACTION_OPEN, | |
| 3322 | + NL80211_PLINK_ACTION_BLOCK, | |
| 3323 | + | |
| 3324 | + NUM_NL80211_PLINK_ACTIONS, | |
| 3325 | +}; | |
| 3326 | + | |
| 3327 | + | |
| 3310 | 3328 | #define NL80211_KCK_LEN 16 |
| 3311 | 3329 | #define NL80211_KEK_LEN 16 |
| 3312 | 3330 | #define NL80211_REPLAY_CTR_LEN 8 |