summaryrefslogtreecommitdiff
path: root/server/bootp.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>1996-05-12 23:55:27 +0000
committerTed Lemon <source@isc.org>1996-05-12 23:55:27 +0000
commitfde927d2f5e6d63b0d0de6d30e6a8621ee66a63f (patch)
tree743a3ae86660783bf48af6fc5f961dc33a5e4bea /server/bootp.c
parent045820eec6cfbb226e6ff3b1d56ceb08083f92d3 (diff)
downloadisc-dhcp-fde927d2f5e6d63b0d0de6d30e6a8621ee66a63f.tar.gz
Add support for hardware unicast; use send_packet instead of sendto; get interface address from packet rather than searching the list.
Diffstat (limited to 'server/bootp.c')
-rw-r--r--server/bootp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/bootp.c b/server/bootp.c
index ff767088..6a9e3730 100644
--- a/server/bootp.c
+++ b/server/bootp.c
@@ -57,6 +57,7 @@ void bootp (packet)
struct packet outgoing;
struct dhcp_packet raw;
struct sockaddr_in to;
+ struct hardware hto;
struct tree_cache *options [256];
int i;
@@ -122,7 +123,7 @@ void bootp (packet)
hp -> fixed_addr -> tree);
memcpy (&raw.yiaddr, hp -> fixed_addr -> value,
sizeof raw.yiaddr);
- raw.siaddr.s_addr = pick_interface (packet);
+ memcpy (&raw.siaddr, packet -> interface -> address.iabuf, 4);
raw.giaddr = packet -> raw -> giaddr;
if (hp -> server_name) {
strncpy (raw.sname, hp -> server_name,
@@ -157,9 +158,13 @@ void bootp (packet)
packet -> raw -> chaddr),
inet_ntoa (packet -> raw -> yiaddr));
+ hto.htype = packet -> raw -> htype;
+ hto.hlen = packet -> raw -> hlen;
+ memcpy (hto.haddr, packet -> raw -> chaddr, hto.hlen);
+
errno = 0;
- result = sendto (packet -> client_sock, &raw, outgoing.packet_length,
- 0, (struct sockaddr *)&to, sizeof to);
+ result = send_packet (packet -> interface,
+ packet, &raw, outgoing.packet_length, &to, &hto);
if (result < 0)
- warn ("sendto: %m");
+ warn ("send_packet: %m");
}