diff options
author | David Ahern <dsahern@gmail.com> | 2019-04-06 01:30:33 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-09 00:22:41 +0200 |
commit | 0353f28231c79416191326810e7fe656b69c63b7 (patch) | |
tree | 5a815e6a8e58d9b4be5d72259bf5f53078ad43d6 /include | |
parent | ipv4: Add fib_check_nh_v6_gw (diff) | |
download | linux-0353f28231c79416191326810e7fe656b69c63b7.tar.xz linux-0353f28231c79416191326810e7fe656b69c63b7.zip |
neighbor: Add skip_cache argument to neigh_output
A later patch allows an IPv6 gateway with an IPv4 route. The neighbor
entry will exist in the v6 ndisc table and the cached header will contain
the ipv6 protocol which is wrong for an IPv4 packet. For an IPv4 packet to
use the v6 neighbor entry, neigh_output needs to skip the cached header
and just use the output callback for the neigh entry.
A future patchset can look at expanding the hh_cache to handle 2
protocols. For now, IPv6 gateways with an IPv4 route will take the
extra overhead of generating the header.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/neighbour.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 7c1ab9edba03..3e5438bd0101 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -498,11 +498,12 @@ static inline int neigh_hh_output(const struct hh_cache *hh, struct sk_buff *skb return dev_queue_xmit(skb); } -static inline int neigh_output(struct neighbour *n, struct sk_buff *skb) +static inline int neigh_output(struct neighbour *n, struct sk_buff *skb, + bool skip_cache) { const struct hh_cache *hh = &n->hh; - if ((n->nud_state & NUD_CONNECTED) && hh->hh_len) + if ((n->nud_state & NUD_CONNECTED) && hh->hh_len && !skip_cache) return neigh_hh_output(hh, skb); else return n->output(n, skb); |