Skip to content

Commit

Permalink
route-table: Store route protocol.
Browse files Browse the repository at this point in the history
The route-table code is useful outside the scope of Open vSwitch.
In a subsequent patch we will expose the route-table data
structures to allow projects compiling against the private Open
vSwitch library to consume this data.

Store the route protocol so that other consumers may read this
data if relevant to them.

Co-Authored-by: Felix Huettner <[email protected]>
Signed-off-by: Felix Huettner <[email protected]>
Signed-off-by: Frode Nordahl <[email protected]>
Signed-off-by: 0-day Robot <[email protected]>
  • Loading branch information
2 people authored and ovsrobot committed Dec 6, 2024
1 parent eb6dc28 commit ce561ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/route-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ COVERAGE_DEFINE(route_table_dump);
struct route_data {
/* Copied from struct rtmsg. */
unsigned char rtm_dst_len;
unsigned char rtm_protocol;
bool local;

/* Extracted from Netlink attributes. */
Expand Down Expand Up @@ -291,6 +292,7 @@ route_table_parse(struct ofpbuf *buf, void *change_)

change->nlmsg_type = nlmsg->nlmsg_type;
change->rd.rtm_dst_len = rtm->rtm_dst_len + (ipv4 ? 96 : 0);
change->rd.rtm_protocol = rtm->rtm_protocol;
change->rd.local = rtm->rtm_type == RTN_LOCAL;
if (attrs[RTA_OIF]) {
rta_oif = nl_attr_get_u32(attrs[RTA_OIF]);
Expand Down

0 comments on commit ce561ef

Please sign in to comment.