summaryrefslogtreecommitdiffstats
path: root/ip/iproute.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-07-25 05:58:36 +0200
committerStephen Hemminger <shemminger@osdl.org>2006-08-04 10:51:01 -0700
commitf4f6d6407d43b81152e366b2011b606db1083802 (patch)
treefedd90b1b2657972001787bf8126bce8ad4c1ee8 /ip/iproute.c
parentf38c73340966cd821d5e3cb08730797e1ea0c233 (diff)
Add support for multipath route realms
Diffstat (limited to 'ip/iproute.c')
-rw-r--r--ip/iproute.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ip/iproute.c b/ip/iproute.c
index 4f7e8570..8f4a55d5 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -559,6 +559,18 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
RTA_DATA(tb[RTA_GATEWAY]),
abuf, sizeof(abuf)));
}
+ if (tb[RTA_FLOW]) {
+ __u32 to = *(__u32*)RTA_DATA(tb[RTA_FLOW]);
+ __u32 from = to>>16;
+ to &= 0xFFFF;
+ fprintf(fp, " realm%s ", from ? "s" : "");
+ if (from) {
+ fprintf(fp, "%s/",
+ rtnl_rtrealm_n2a(from, b1, sizeof(b1)));
+ }
+ fprintf(fp, "%s",
+ rtnl_rtrealm_n2a(to, b1, sizeof(b1)));
+ }
}
if (r->rtm_flags&RTM_F_CLONED && r->rtm_type == RTN_MULTICAST) {
fprintf(fp, " %s", ll_index_to_name(nh->rtnh_ifindex));
@@ -608,6 +620,13 @@ int parse_one_nh(struct rtattr *rta, struct rtnexthop *rtnh, int *argcp, char **
rtnh->rtnh_hops = w - 1;
} else if (strcmp(*argv, "onlink") == 0) {
rtnh->rtnh_flags |= RTNH_F_ONLINK;
+ } else if (matches(*argv, "realms") == 0) {
+ __u32 realm;
+ NEXT_ARG();
+ if (get_rt_realms(&realm, *argv))
+ invarg("\"realm\" value is invalid\n", *argv);
+ rta_addattr32(rta, 4096, RTA_FLOW, realm);
+ rtnh->rtnh_len += sizeof(struct rtattr) + 4;
} else
break;
}