29727556d18c2a4368b2225d8e43264b6cfa4f12
[openwrt-10.03/.git] / package / busybox / patches / 243-udhcpc_changed_ifindex.patch
1 --- a/networking/udhcp/dhcpc.c
2 +++ b/networking/udhcp/dhcpc.c
3 @@ -320,6 +320,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
4         for (;;) {
5                 unsigned 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.arp);
12 +
13                 if (listen_mode != LISTEN_NONE && sockfd < 0) {
14                         if (listen_mode == LISTEN_KERNEL)
15                                 sockfd = udhcp_listen_socket(/*INADDR_ANY,*/ CLIENT_PORT, client_config.interface);