ipv4: Adjust semantics of rt->rt_gateway.
In order to allow prefixed routes, we have to adjust how rt_gateway is set and interpreted. The new interpretation is: 1) rt_gateway == 0, destination is on-link, nexthop is iph->daddr 2) rt_gateway != 0, destination requires a nexthop gateway Abstract the fetching of the proper nexthop value using a new inline helper, rt_nexthop(), as suggested by Joe Perches. Signed-off-by: David S. Miller <davem@davemloft.net> Tested-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Showing
- include/net/route.h 7 additions, 0 deletionsinclude/net/route.h
- net/ipv4/arp.c 1 addition, 2 deletionsnet/ipv4/arp.c
- net/ipv4/inet_connection_sock.c 2 additions, 2 deletionsnet/ipv4/inet_connection_sock.c
- net/ipv4/ip_gre.c 1 addition, 1 deletionnet/ipv4/ip_gre.c
- net/ipv4/ip_output.c 1 addition, 1 deletionnet/ipv4/ip_output.c
- net/ipv4/ipip.c 1 addition, 1 deletionnet/ipv4/ipip.c
- net/ipv4/netfilter/ipt_MASQUERADE.c 3 additions, 2 deletionsnet/ipv4/netfilter/ipt_MASQUERADE.c
- net/ipv4/route.c 9 additions, 8 deletionsnet/ipv4/route.c
Loading
Please register or sign in to comment