diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2016-09-10 12:09:53 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-10 23:12:52 -0700 |
commit | a8e3e1a9f02094145580ea7920c6a1d9aabd5539 (patch) | |
tree | 1bedde4339e71fa07c4f73d27cfc807ec9220120 /net/ipv4/ip_output.c | |
parent | 9ee0034b8f49aaaa7e7c2da8db1038915db99c19 (diff) | |
download | op-kernel-dev-a8e3e1a9f02094145580ea7920c6a1d9aabd5539.zip op-kernel-dev-a8e3e1a9f02094145580ea7920c6a1d9aabd5539.tar.gz |
net: l3mdev: Add hook to output path
This patch adds the infrastructure to the output path to pass an skb
to an l3mdev device if it has a hook registered. This is the Tx parallel
to l3mdev_ip{6}_rcv in the receive path and is the basis for removing
the existing hook that returns the vrf dst on the fib lookup.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index b913f5b..41e10e3 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -99,6 +99,14 @@ int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb) iph->tot_len = htons(skb->len); ip_send_check(iph); + + /* if egress device is enslaved to an L3 master device pass the + * skb to its handler for processing + */ + skb = l3mdev_ip_out(sk, skb); + if (unlikely(!skb)) + return 0; + return nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT, net, sk, skb, NULL, skb_dst(skb)->dev, dst_output); |