From: Ted Lemon Date: Sun, 24 Oct 1999 19:38:53 +0000 (+0000) Subject: - Reply to remote_port if giaddr is 127.0.0.1, so that relay debugging can X-Git-Tag: BCTEL_SPECIAL_19991124~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b871100429a2384fa7c612a7a5f9cefe9802ff4;p=thirdparty%2Fdhcp.git - Reply to remote_port if giaddr is 127.0.0.1, so that relay debugging can be done using lo0. --- diff --git a/server/dhcp.c b/server/dhcp.c index ef1a78070..3dc18c8e6 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.124 1999/10/24 18:55:37 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.125 1999/10/24 19:38:53 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -814,7 +814,10 @@ void nak_lease (packet, cip) Otherwise, broadcast it on the local network. */ if (raw.giaddr.s_addr) { to.sin_addr = raw.giaddr; - to.sin_port = local_port; + if (raw.giaddr.s_addr != INADDR_LOOPBACK) + to.sin_port = local_port; + else + to.sin_port = remote_port; /* for testing. */ if (fallback_interface) { result = send_packet (fallback_interface, @@ -1889,7 +1892,10 @@ void dhcp_reply (lease) /* If this was gatewayed, send it back to the gateway... */ if (raw.giaddr.s_addr) { to.sin_addr = raw.giaddr; - to.sin_port = local_port; + if (raw.giaddr.s_addr != INADDR_LOOPBACK) + to.sin_port = local_port; + else + to.sin_port = remote_port; /* For debugging. */ if (fallback_interface) { result = send_packet (fallback_interface,