diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-06-21 17:36:22 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-06-21 17:38:14 +0200 |
commit | 148788eb0ee96026105755cf3fd1ad3d94f49cd2 (patch) | |
tree | aa300fa3e844410b823b87ca759060b668ff5b80 /networking/udhcp/packet.c | |
parent | 6fb8bd795c3f40735ced3f51b8082f91956fd786 (diff) | |
download | busybox-w32-148788eb0ee96026105755cf3fd1ad3d94f49cd2.tar.gz busybox-w32-148788eb0ee96026105755cf3fd1ad3d94f49cd2.tar.bz2 busybox-w32-148788eb0ee96026105755cf3fd1ad3d94f49cd2.zip |
udhcpc: remove code which requires server ID to be on local network
This reverts "udhcpc: paranoia when using kernel UDP mode
for sending renew: server ID may be bogus".
Users complain that they do have servers behind routers
(with DHCP relays).
function old new delta
send_packet 168 166 -2
bcast_or_ucast 25 23 -2
udhcp_send_kernel_packet 301 295 -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-10) Total: -10 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/packet.c')
-rw-r--r-- | networking/udhcp/packet.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c index fc2bb5416..ff16904f7 100644 --- a/networking/udhcp/packet.c +++ b/networking/udhcp/packet.c | |||
@@ -189,8 +189,7 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt, | |||
189 | /* Let the kernel do all the work for packet generation */ | 189 | /* Let the kernel do all the work for packet generation */ |
190 | int FAST_FUNC udhcp_send_kernel_packet(struct dhcp_packet *dhcp_pkt, | 190 | int FAST_FUNC udhcp_send_kernel_packet(struct dhcp_packet *dhcp_pkt, |
191 | uint32_t source_nip, int source_port, | 191 | uint32_t source_nip, int source_port, |
192 | uint32_t dest_nip, int dest_port, | 192 | uint32_t dest_nip, int dest_port) |
193 | int send_flags) | ||
194 | { | 193 | { |
195 | struct sockaddr_in sa; | 194 | struct sockaddr_in sa; |
196 | unsigned padding; | 195 | unsigned padding; |
@@ -227,8 +226,8 @@ int FAST_FUNC udhcp_send_kernel_packet(struct dhcp_packet *dhcp_pkt, | |||
227 | padding = DHCP_OPTIONS_BUFSIZE - 1 - udhcp_end_option(dhcp_pkt->options); | 226 | padding = DHCP_OPTIONS_BUFSIZE - 1 - udhcp_end_option(dhcp_pkt->options); |
228 | if (padding > DHCP_SIZE - 300) | 227 | if (padding > DHCP_SIZE - 300) |
229 | padding = DHCP_SIZE - 300; | 228 | padding = DHCP_SIZE - 300; |
230 | result = send(fd, dhcp_pkt, DHCP_SIZE - padding, send_flags); | 229 | result = safe_write(fd, dhcp_pkt, DHCP_SIZE - padding); |
231 | msg = "send"; | 230 | msg = "write"; |
232 | ret_close: | 231 | ret_close: |
233 | close(fd); | 232 | close(fd); |
234 | if (result < 0) { | 233 | if (result < 0) { |