summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2004-04-12 23:09:32 +0000
committerhenning <henning@openbsd.org>2004-04-12 23:09:32 +0000
commiteb7948a66a15d72bf3fede12ca45c83b9367e66e (patch)
tree29360083916f8bd54b48d71ed0e2b8cc483cb073
parentremove those overly helpfull comments like explaining that time(3) gets the (diff)
downloadwireguard-openbsd-eb7948a66a15d72bf3fede12ca45c83b9367e66e.tar.xz
wireguard-openbsd-eb7948a66a15d72bf3fede12ca45c83b9367e66e.zip
relaying back bootp answers should work again
-rw-r--r--usr.sbin/dhcrelay/dhcrelay.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/usr.sbin/dhcrelay/dhcrelay.c b/usr.sbin/dhcrelay/dhcrelay.c
index 43f5ac0393f..960c3c62429 100644
--- a/usr.sbin/dhcrelay/dhcrelay.c
+++ b/usr.sbin/dhcrelay/dhcrelay.c
@@ -175,7 +175,6 @@ relay(struct interface_info *ip, struct dhcp_packet *packet, int length,
{
struct server_list *sp;
struct sockaddr_in to;
- struct interface_info *out;
struct hardware hto;
if (packet->hlen > sizeof packet->chaddr) {
@@ -203,27 +202,11 @@ relay(struct interface_info *ip, struct dhcp_packet *packet, int length,
memcpy(hto.haddr, packet->chaddr, hto.hlen);
hto.htype = packet->htype;
-/* XXX broken */
- /* Find the interface that corresponds to the giaddr
- in the packet. */
- for (out = interfaces; out; out = out->next) {
- if (!memcmp (&out->primary_address,
- &packet->giaddr,
- sizeof packet->giaddr))
- break;
- }
- if (!out) {
- warn("packet to bogus giaddr %s.",
- inet_ntoa(packet->giaddr));
- return;
- }
-
- if (send_packet(out, NULL, packet, length, out->primary_address,
- &to, &hto) != -1)
+ if (send_packet(interfaces, NULL, packet, length,
+ interfaces->primary_address, &to, &hto) != -1)
debug("forwarded BOOTREPLY for %s to %s",
print_hw_addr(packet->htype, packet->hlen,
- packet->chaddr), inet_ntoa (to.sin_addr));
-/* XXX */
+ packet->chaddr), inet_ntoa(to.sin_addr));
return;
}