routing-table: parse skb-mark from RTNETLINK msg
Keep track of skb-mark of given RTNL routing notification.
This will be used by next commit.
Acked-by: Jarno Rajahalme
@@ -45,6 +45,7 @@ struct route_data {
struct in6_addr rta_dst; /* 0 if missing. */
struct in6_addr rta_gw;
char ifname[IFNAMSIZ]; /* Interface name. */
+ uint32_t mark;
};
/* A digested version of a route message sent down by the kernel to indicate
@@ -190,11 +191,13 @@ route_table_parse(struct ofpbuf *buf, struct route_table_msg *change)
[RTA_DST] = { .type = NL_A_U32, .optional = true },
[RTA_OIF] = { .type = NL_A_U32, .optional = true },
[RTA_GATEWAY] = { .type = NL_A_U32, .optional = true },
+ [RTA_MARK] = { .type = NL_A_U32, .optional = true },
};
static const struct nl_policy policy6[] = {
[RTA_DST] = { .type = NL_A_IPV6, .optional = true },
[RTA_OIF] = { .type = NL_A_U32, .optional = true },
+ [RTA_MARK] = { .type = NL_A_U32, .optional = true },
[RTA_GATEWAY] = { .type = NL_A_IPV6, .optional = true },
};
@@ -270,6 +273,9 @@ route_table_parse(struct ofpbuf *buf, struct route_table_msg *change)
change->rd.rta_gw = nl_attr_get_in6_addr(attrs[RTA_GATEWAY]);
}
}
+ if (attrs[RTA_MARK]) {
+ change->rd.mark = nl_attr_get_u32(attrs[RTA_MARK]);
+ }
} else {
VLOG_DBG_RL(&rl, "received unparseable rtnetlink route message");
return 0;
