bridge/mdb.c: include limits.h
Subsystems (2)
PATCH 1/1 bridge/mdb.c: include limits.h
While building iproute2 6.4.0 with musl using Yocto Project, errors such as the following were encountered:
| mdb.c: In function 'mdb_parse_vni': | mdb.c:666:47: error: 'ULONG_MAX' undeclared (first use in this function) | 666 | if ((endptr && *endptr) || vni_num == ULONG_MAX) | | ^~~~~~~~~ | mdb.c:666:47: note: 'ULONG_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?
Include limits.h in bridge/mdb.c to fix this issue. This change is based on one in Alpine Linux, but the author there had no plans to submit:
https://git.alpinelinux.org/aports/commit/main/iproute2/include.patch?id=bd46efb8a8da54948639cebcfa5b37bd608f1069
--- bridge/mdb.c | 1 + 1 file changed, 1 insertion(+)
bridge/mdb.c +1 -0
@@ -15,6 +15,7 @@#include <string.h> #include <arpa/inet.h> #include <netdb.h> +#include <limits.h> #include "libnetlink.h" #include "utils.h"
Signature · 1 line
2.41.0
Quoted 9 lines · Trevor Gamblin
While building iproute2 6.4.0 with musl using Yocto Project, errors such as the following were encountered:
| mdb.c: In function 'mdb_parse_vni': | mdb.c:666:47: error: 'ULONG_MAX' undeclared (first use in this function) | 666 | if ((endptr && *endptr) || vni_num == ULONG_MAX) | | ^~~~~~~~~ | mdb.c:666:47: note: 'ULONG_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?
Quoted 5 lines
Include
limits.hinbridge/mdb.cto fix this issue. This change is based on one in Alpine Linux, but the author there had no plans to submit:
https://git.alpinelinux.org/aports/commit/main/iproute2/include.patch?id=bd46efb8a8da54948639cebcfa5b37bd608f1069Signed-off-by Trevor Gamblin <[email protected]>
Similar change was done in commit dd9cc0ee81a6 ("iproute2: various header include fixes for compiling with musl libc").
Thanks
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Hello:
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Quoted 10 lines · On Thu, 20 Jul 2023 16:37:26 -0400 you wrote:
While building iproute2 6.4.0 with musl using Yocto Project, errors such as the following were encountered:
| mdb.c: In function 'mdb_parse_vni': | mdb.c:666:47: error: 'ULONG_MAX' undeclared (first use in this function) | 666 | if ((endptr && *endptr) || vni_num == ULONG_MAX) | | ^~~~~~~~~ | mdb.c:666:47: note: 'ULONG_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?[...]
Here is the summary with links:
- [iproute2] bridge/mdb.c: include limits.h
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=9d82667cc9d2
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html