diff options
author | David Ahern <dsahern@gmail.com> | 2019-04-05 16:30:27 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-08 15:22:40 -0700 |
commit | 1550c171935d264f522581fd037db5e64a716bb6 (patch) | |
tree | c043f42751289b3cb3a93e0a5f883a6d086240f4 /include | |
parent | bdf004677107e3b847c5db09c9fbf8edefa24996 (diff) | |
download | linux-1550c171935d264f522581fd037db5e64a716bb6.tar.bz2 |
ipv4: Prepare rtable for IPv6 gateway
To allow the gateway to be either an IPv4 or IPv6 address, remove
rt_uses_gateway from rtable and replace with rt_gw_family. If
rt_gw_family is set it implies rt_uses_gateway. Rename rt_gateway
to rt_gw4 to represent the IPv4 version.
Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/route.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/net/route.h b/include/net/route.h index 9883dc82f723..96912b099c08 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -55,12 +55,12 @@ struct rtable { unsigned int rt_flags; __u16 rt_type; __u8 rt_is_input; - __u8 rt_uses_gateway; + u8 rt_gw_family; int rt_iif; /* Info on neighbour */ - __be32 rt_gateway; + __be32 rt_gw4; /* Miscellaneous cached information */ u32 rt_mtu_locked:1, @@ -82,8 +82,8 @@ static inline bool rt_is_output_route(const struct rtable *rt) static inline __be32 rt_nexthop(const struct rtable *rt, __be32 daddr) { - if (rt->rt_gateway) - return rt->rt_gateway; + if (rt->rt_gw_family == AF_INET) + return rt->rt_gw4; return daddr; } |