we have identified that BusyBox's IP applet flush IP addresses of all device if device given in command is not exist in system e.g: #busybox ip -4 address flush dev abcdefg In this case if device 'abcdefg' not exists on system then it will flush addresses of all interfaces. This behaviour is same across all version of BusyBox and since inception. RCA: We have analysed the issue and identified that whenever we are calling 'xll_name_to_index' function to perform interface name to interface index opertation we are not cheking the return values of it in the caller functions. Proposing the below patch for the fix and requesting you to do the needful. May be need to look into other areas for the same condition. PATCH: --- busybox-1.31.1/networking/libiproute/ipaddress.c 2021-04-30 19:06:47.872878596 +0530 +++ ipaddress.c 2021-04-30 19:00:14.688899593 +0530 @@ -486,7 +486,9 @@ int FAST_FUNC ipaddr_list_or_flush(char ll_init_map(&rth); if (filter_dev) { - G_filter.ifindex = xll_name_to_index(filter_dev); + if((G_filter.ifindex = xll_name_to_index(filter_dev)) <= 0) { + return 1; + } } if (flush) {
*** Bug 13921 has been marked as a duplicate of this bug. ***
*** Bug 13916 has been marked as a duplicate of this bug. ***
*** Bug 13911 has been marked as a duplicate of this bug. ***