Skip to content

Commit

Permalink
zebra: fix fpm_listener compilation
Browse files Browse the repository at this point in the history
I don't know why it appears only now.

> ../sdist/zebra/fpm_listener.c:420:8: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
>                 if (!RTNH_OK(rtnh, len)) {
>                      ^~~~~~~~~~~~~~~~~~
> ../sdist/include/linux/rtnetlink.h:437:31: note: expanded from macro 'RTNH_OK'
>                            ((int)(rtnh)->rtnh_len) <= (len))

len is set with RTA_PAYLOAD and should be an integer.

> len = RTA_PAYLOAD(mpath_rtattr);
> #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))

Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed Apr 26, 2024
1 parent efbf234 commit bb46027
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zebra/fpm_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static int netlink_msg_ctx_add_nh(struct netlink_msg_ctx *ctx, int if_index,
static int parse_multipath_attr(struct netlink_msg_ctx *ctx,
struct rtattr *mpath_rtattr)
{
size_t len;
int len;
struct rtnexthop *rtnh;
struct rtattr *rtattrs[RTA_MAX + 1];
struct rtattr *gateway;
Expand Down

0 comments on commit bb46027

Please sign in to comment.