On 09/10/2025 10:21, Ilya Maximets wrote:
> Current code assumes that if the rtnetlink.h exists, then it must
> have definitions for RTA_VIA and 'struct rtvia'.  This is causing
> build failures on older systems:
> 
>   lib/netlink.c: In function 'min_attr_len':
>   lib/netlink.c:832:38:
>     error: invalid application of 'sizeof' to incomplete type 'struct rtvia'
>      case NL_A_RTA_VIA: return sizeof(struct rtvia) + sizeof(struct in_addr);
>                                       ^
> 
> The code structure overall is not great, we should not include Linux
> specific headers in the common netlink.c.  The only reason for the
> inclusion though is the structure size.  We can just put a number
> instead, as it is already done for all other types.  It should never
> change, as long as kernel uAPI is stable.
> 
> Structure and the RTA_VIA should be defined in the Linux-specific
> route-table.c, in case rtnetlink.h doesn't have a definition for them.
> 
> Fixes: 9d9a99d157f2 ("route-table: Support parsing RTA_VIA attribute.")
> Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2025-
> September/053800.html
> Reported-by: Brendan Doyle <[email protected]>
> Signed-off-by: Ilya Maximets <[email protected]>
> ---
>  acinclude.m4      |  7 +++++++
>  lib/netlink.c     | 14 ++------------
>  lib/route-table.c |  9 +++++++++

Acked-by: Kevin Traynor <[email protected]>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to