On 10 Dec 2024, at 23:18, Frode Nordahl wrote:

> 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 <felix.huettner@stackit.cloud>
> Signed-off-by: Felix Huettner <felix.huettner@stackit.cloud>
> Signed-off-by: Frode Nordahl <fnord...@ubuntu.com>

The changes look good to me, with the exception of a missing test case.

Cheers,

Eelco

> ---
>  lib/route-table.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/route-table.c b/lib/route-table.c
> index e6442220c..b7e7861d6 100644
> --- a/lib/route-table.c
> +++ b/lib/route-table.c
> @@ -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. */
> @@ -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]);
> -- 
> 2.45.2

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to