busybox/networking/udhcp
Denys Vlasenko a6a3ad3273 udhcpc: paranoia when using kernel UDP mode for sending renew: server ID may be bogus
With new code, we request that target IP (server ID) must be directly reachable.
If it's not, this happens:

udhcpc: waiting 2000 seconds
udhcpc: entering listen mode: kernel
udhcpc: opening listen socket on *:68 wlan0
udhcpc: entering renew state
udhcpc: sending renew to 1.1.1.1
udhcpc: send: Network is unreachable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1.1.1.1 needs routing, this is fishy!
udhcpc: entering rebinding state
udhcpc: entering listen mode: raw
udhcpc: created raw socket
udhcpc: sending renew to 0.0.0.0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ going to use broadcast

which is the desired behavior. Before the patch, packet to 1.1.1.1 was routed
over eth0 (!) and maybe even into Internet (!!!).

function                                             old     new   delta
udhcpc_main                                         2752    2763     +11
udhcp_send_kernel_packet                             295     301      +6
send_renew                                            82      84      +2
send_packet                                          166     168      +2
bcast_or_ucast                                        23      25      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/0 up/down: 23/0)               Total: 23 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-29 16:02:11 +02:00
..
arpping.c dhcp: merge leases.c and static_leases.c into dhcpd.c 2016-10-04 00:56:58 +02:00
common.c udhcpc6: make -O OPT work 2017-06-28 19:18:17 +02:00
common.h udhcpc: paranoia when using kernel UDP mode for sending renew: server ID may be bogus 2017-09-29 16:02:11 +02:00
Config.src config: trim/improve item names and help texts, take 2 2017-07-27 10:53:09 +02:00
d6_common.h udhcpc6: add comments about option 39, no code changes 2017-06-27 18:31:08 +02:00
d6_dhcpc.c udhcpc: paranoia when using kernel UDP mode for sending renew: server ID may be bogus 2017-09-29 16:02:11 +02:00
d6_packet.c udhcpc[6]: initialize entire sockaddr_ll 2017-09-29 14:22:43 +02:00
d6_socket.c udhcpc[6]: downgrade "adapter index N" messages to log2 level 2017-07-24 12:06:53 +02:00
dhcpc.c udhcpc: paranoia when using kernel UDP mode for sending renew: server ID may be bogus 2017-09-29 16:02:11 +02:00
dhcpc.h udhcpc6: make -O OPT work 2017-06-28 19:18:17 +02:00
dhcpd.c udhcpc: paranoia when using kernel UDP mode for sending renew: server ID may be bogus 2017-09-29 16:02:11 +02:00
dhcpd.h dhcp: merge leases.c and static_leases.c into dhcpd.c 2016-10-04 00:56:58 +02:00
dhcprelay.c Spelling fixes in comments, documentation, tests and examples 2017-04-17 16:13:32 +02:00
domain_codec.c udhcpc: fix a warning in debug code 2016-03-11 00:26:58 +01:00
dumpleases.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
Kbuild.src fix breakage found by mass one-applet builds 2016-12-23 02:42:26 +01:00
packet.c udhcpc: paranoia when using kernel UDP mode for sending renew: server ID may be bogus 2017-09-29 16:02:11 +02:00
signalpipe.c udhcp: use poll() instead of select() 2017-02-16 23:25:44 +01:00
socket.c udhcpc: downgrade "MAC X:X:X:X:X:X" message to log2 level 2017-07-24 13:37:38 +02:00