Skip to content

Commit

Permalink
routing-table: parse skb-mark from RTNETLINK msg
Browse files Browse the repository at this point in the history
Keep track of skb-mark of given RTNL routing notification.
This will be used by next commit.

Signed-off-by: Pravin B Shelar <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
pshelar committed Jan 28, 2017
1 parent bf4bbd0 commit f36786c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/route-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 },
};

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f36786c

Please sign in to comment.