f32cea2830675bce4eeceaddcb43bfae01a090ea
[openwrt.git] / package / utils / busybox / patches / 201-udhcpc_changed_ifindex.patch
1 --- a/networking/udhcp/dhcpc.c
2 +++ b/networking/udhcp/dhcpc.c
3 @@ -1418,6 +1418,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
4                 /* silence "uninitialized!" warning */
5                 unsigned timestamp_before_wait = timestamp_before_wait;
6  
7 +               /* When running on a bridge, the ifindex may have changed (e.g. if
8 +                * member interfaces were added/removed or if the status of the
9 +                * bridge changed).
10 +                * Workaround: refresh it here before processing the next packet */
11 +               udhcp_read_interface(client_config.interface, &client_config.ifindex, NULL, client_config.client_mac);
12 +
13                 //bb_error_msg("sockfd:%d, listen_mode:%d", sockfd, listen_mode);
14  
15                 /* Was opening raw or udp socket here