net: ipv6: make "ip -6 route get mark xyz" work.
authorLorenzo Colitti <lorenzo@google.com>
Thu, 15 May 2014 23:38:41 +0000 (16:38 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 28 Jul 2020 08:47:01 +0000 (09:47 +0100)
Currently, "ip -6 route get mark xyz" ignores the mark passed in
by userspace. Make it honour the mark, just like IPv4 does.

[net-next commit 2e47b291953c35afa4e20a65475954c1a1b9afe1]

Change-Id: Idaae7338506d1785a80159bfe4f0cc3c2a9b6827
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c

index 4e1e02a765f33444723c5ebd8d99eface8ddb666..2c79063b665383c98a5132f09bddd05b7fd9f1bc 100644 (file)
@@ -2633,6 +2633,9 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh)
        if (tb[RTA_OIF])
                oif = nla_get_u32(tb[RTA_OIF]);
 
+       if (tb[RTA_MARK])
+               fl6.flowi6_mark = nla_get_u32(tb[RTA_MARK]);
+
        if (tb[RTA_UID])
                fl6.flowi6_uid = make_kuid(current_user_ns(),
                                           nla_get_u32(tb[RTA_UID]));