From: Roi Dayan <hidden> Date: 2021-02-22 12:11:41
In older distros we need bsd/stdlib.h but newer distro doesn't
need it. Also old distro will need libbsd-devel installed and newer
doesn't. To remove a possible dependency on libbsd-devel replace usage
of reallocarray to realloc.
dcb_app.c: In function ‘dcb_app_table_push’:
dcb_app.c:68:25: warning: implicit declaration of function ‘reallocarray’; did you mean ‘realloc’?
Fixes: 8e9bed1493f5 ("dcb: Add a subtool for the DCB APP object")
Signed-off-by: Roi Dayan <redacted>
---
Notes:
v2
- tag for iproute next
- replace reallocarray with realloc instead of messing with libbsd
dcb/dcb_app.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
reallocarray() checks that count*size does not overflow. But the whole
APP table needs to fit into one attribute, which limits the size to some
64K, so from UAPI direction this will never overflow. From the
command-line direction, size of 'struct app' is 4 bytes, so to overflow
you'd need to stuff in 1G APP entries. I think we don't need to worry
about that.
So this looks good.
Reviewed-by: Petr Machata <petrm@nvidia.com>