aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-01-14 13:23:12 +0200
committerDavid S. Miller <davem@davemloft.net>2020-01-14 18:53:35 -0800
commitbb3c4ab93e44784c1e958bdbba7824bba40f23cd (patch)
tree382f6bf2f8de99794ce78aadf832f204f74745fb /net/ipv6/route.c
parentipv4: Add "offload" and "trap" indications to routes (diff)
downloadlinux-dev-bb3c4ab93e44784c1e958bdbba7824bba40f23cd.tar.xz
linux-dev-bb3c4ab93e44784c1e958bdbba7824bba40f23cd.zip
ipv6: Add "offload" and "trap" indications to routes
In a similar fashion to previous patch, add "offload" and "trap" indication to IPv6 routes. This is done by using two unused bits in 'struct fib6_info' to hold these indications. Capable drivers are expected to set these when processing the various in-kernel route notifications. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: David Ahern <dsahern@gmail.com> Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv6/route.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0253b702afb7..4fbdc60b4e07 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -5576,6 +5576,13 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,
expires -= jiffies;
}
+ if (!dst) {
+ if (rt->offload)
+ rtm->rtm_flags |= RTM_F_OFFLOAD;
+ if (rt->trap)
+ rtm->rtm_flags |= RTM_F_TRAP;
+ }
+
if (rtnl_put_cacheinfo(skb, dst, 0, expires, dst ? dst->error : 0) < 0)
goto nla_put_failure;