nexthop: Add support for IPv4 nexthops

Add support for IPv4 nexthops. If nh_family is set to AF_INET, then
NHA_GATEWAY is expected to be an IPv4 address.

Register for netdev events to be notified of admin up/down changes as
well as deletes. A hash table is used to track nexthop per devices to
quickly convert device events to the affected nexthops.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David Ahern
2019-05-24 14:43:05 -07:00
committed by David S. Miller
parent ab84be7e54
commit 597cfe4fc3
2 changed files with 213 additions and 0 deletions

View File

@@ -29,6 +29,10 @@ struct nh_config {
int nh_ifindex;
struct net_device *dev;
union {
__be32 ipv4;
} gw;
u32 nlflags;
struct nl_info nlinfo;
};
@@ -42,6 +46,7 @@ struct nh_info {
union {
struct fib_nh_common fib_nhc;
struct fib_nh fib_nh;
};
};