Skip to content

Commit

Permalink
net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL80215…
Browse files Browse the repository at this point in the history
…4_EXPERIMENTAL is disabled

When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
error:
net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?
 2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   NL802154_CMD_SET_CCA_ED_LEVEL

Unhide the experimental commands, having them defined in an enum
makes no difference.

Fixes: 9c5d03d ("genetlink: start to validate reserved header bytes")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Link: https://lore.kernel.org/r/20220902030620.2737091-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Gal Pressman authored and Jakub Kicinski committed Sep 3, 2022
1 parent c3f760e commit 8254393
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/net/nl802154.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ enum nl802154_commands {

NL802154_CMD_SET_WPAN_PHY_NETNS,

/* add new commands above here */

#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
NL802154_CMD_SET_SEC_PARAMS,
NL802154_CMD_GET_SEC_KEY, /* can dump */
NL802154_CMD_NEW_SEC_KEY,
Expand All @@ -74,7 +71,8 @@ enum nl802154_commands {
NL802154_CMD_GET_SEC_LEVEL, /* can dump */
NL802154_CMD_NEW_SEC_LEVEL,
NL802154_CMD_DEL_SEC_LEVEL,
#endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */

/* add new commands above here */

/* used to define NL802154_CMD_MAX below */
__NL802154_CMD_AFTER_LAST,
Expand Down

0 comments on commit 8254393

Please sign in to comment.