summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-04-12 23:09:33 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-04-12 23:09:33 +0000
commitf68f54cb7541a6596c2b88d9fe69a1da8aed70b5 (patch)
tree155c3254275e15a4a2e972d5307775c782aab422 /usr.sbin
parent9d8e742c214db96f0402771eef2ffabe460ed1e2 (diff)
relaying back bootp answers should work again
Diffstat (limited to 'usr.sbin')
-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;
}