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>
This commit is contained in:
committed by
Jakub Kicinski
parent
720ccd9a72
commit
09ad6becf5
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user