b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | --- a/networking/udhcp/dhcpc.c |
| 2 | +++ b/networking/udhcp/dhcpc.c |
| 3 | @@ -1384,6 +1384,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c |
| 4 | struct pollfd pfds[2]; |
| 5 | struct dhcp_packet packet; |
| 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_data.interface, &client_data.ifindex, NULL, client_data.client_mac); |
| 12 | + |
| 13 | //bb_error_msg("sockfd:%d, listen_mode:%d", client_data.sockfd, client_data.listen_mode); |
| 14 | |
| 15 | /* Was opening raw or udp socket here |