201-udhcpc_changed_ifindex.patch 680 B

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