diff options
author | Ido Schimmel <idosch@nvidia.com> | 2021-01-28 13:49:17 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-28 20:49:52 -0800 |
commit | 09ad6becf5355fe0645f500f518fbbd531715722 (patch) | |
tree | eeb9454ed1731d5dda578ee19cfffff84c62f195 /include/net/nexthop.h | |
parent | 720ccd9a728506ca4721b18a22a2157a9d48ed60 (diff) |
nexthop: Use enum to encode notification type
Currently there are only two types of in-kernel nexthop notification.
The two are distinguished by the 'is_grp' boolean field in 'struct
nh_notifier_info'.
As more notification types are introduced for more next-hop group types, a
boolean is not an easily extensible interface. Instead, convert it to an
enum.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/nexthop.h')
-rw-r--r-- | include/net/nexthop.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/net/nexthop.h b/include/net/nexthop.h index d0e245b0635d..7bc057aee40b 100644 --- a/include/net/nexthop.h +++ b/include/net/nexthop.h @@ -114,6 +114,11 @@ enum nexthop_event_type { NEXTHOP_EVENT_REPLACE, }; +enum nh_notifier_info_type { + NH_NOTIFIER_INFO_TYPE_SINGLE, + NH_NOTIFIER_INFO_TYPE_GRP, +}; + struct nh_notifier_single_info { struct net_device *dev; u8 gw_family; @@ -142,7 +147,7 @@ struct nh_notifier_info { struct net *net; struct netlink_ext_ack *extack; u32 id; - bool is_grp; + enum nh_notifier_info_type type; union { struct nh_notifier_single_info *nh; struct nh_notifier_grp_info *nh_grp; |