aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/clientpacket.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-11-22 00:58:49 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-11-22 00:58:49 +0000
commit223bc97f61f2fd5efbccede0837a374c1669e864 (patch)
tree0105a1f02dbc344ede7cca99565b6c556e7cab96 /networking/udhcp/clientpacket.c
parentc881c733bb05286f7147d0ca49ad238b86f6d848 (diff)
downloadbusybox-223bc97f61f2fd5efbccede0837a374c1669e864.tar.gz
udhcpc: an option to perform ARP check (Jonas Danielsson <jonas.danielsson@axis.com>)
configurable, ~+300 bytes when on.
Diffstat (limited to 'networking/udhcp/clientpacket.c')
-rw-r--r--networking/udhcp/clientpacket.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/networking/udhcp/clientpacket.c b/networking/udhcp/clientpacket.c
index 42b4895e5..e7eeb58b1 100644
--- a/networking/udhcp/clientpacket.c
+++ b/networking/udhcp/clientpacket.c
@@ -69,6 +69,22 @@ static void add_requests(struct dhcpMessage *packet)
}
+#if ENABLE_FEATURE_UDHCPC_ARPING
+/* Unicast a DHCP decline message */
+int send_decline(uint32_t xid, uint32_t server)
+{
+ struct dhcpMessage packet;
+
+ init_packet(&packet, DHCPDECLINE);
+ packet.xid = xid;
+ add_requests(&packet);
+
+ bb_info_msg("Sending decline...");
+
+ return udhcp_raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST,
+ SERVER_PORT, MAC_BCAST_ADDR, client_config.ifindex);
+}
+#endif
/* Broadcast a DHCP discover packet to the network, with an optionally requested IP */
int send_discover(uint32_t xid, uint32_t requested)