]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ip: mroute: Print offload indication
authorYotam Gigi <yotamg@mellanox.com>
Sun, 8 Oct 2017 14:43:04 +0000 (17:43 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 11 Oct 2017 17:54:27 +0000 (10:54 -0700)
Since kernel net-next commit c7c0bbeae950 ("net: ipmr: Add MFC offload
indication") the kernel indicates on an MFC entry whether it was offloaded
using the RTNH_F_OFFLOAD flag. Update the "ip mroute show" command to
indicate when a route is offloaded, similarly to the "ip route show"
command.

Example output:
$ ip mroute
(0.0.0.0, 239.255.0.1)      Iif: sw1p7  Oifs: t_br0 State: resolved offload
(192.168.1.1, 239.255.0.1)  Iif: sw1p7  Oifs: sw1p4 State: resolved offload

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
ip/ipmroute.c

index b51c23cc50e2c3f84e350a72dcdae5f3b17fe1cc..453a6cf62e71172d34156a902acff994286217b1 100644 (file)
@@ -161,6 +161,8 @@ int print_mroute(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
        }
        fprintf(fp, " State: %s",
                r->rtm_flags & RTNH_F_UNRESOLVED ? "unresolved" : "resolved");
+       if (r->rtm_flags & RTNH_F_OFFLOAD)
+               fprintf(fp, " offload");
        if (show_stats && tb[RTA_MFC_STATS]) {
                struct rta_mfc_stats *mfcs = RTA_DATA(tb[RTA_MFC_STATS]);