]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Reply to remote_port if giaddr is 127.0.0.1, so that relay debugging can
authorTed Lemon <source@isc.org>
Sun, 24 Oct 1999 19:38:53 +0000 (19:38 +0000)
committerTed Lemon <source@isc.org>
Sun, 24 Oct 1999 19:38:53 +0000 (19:38 +0000)
  be done using lo0.

server/dhcp.c

index ef1a7807021945b91aadeccf8ec5998958dfab01..3dc18c8e61d1b9cf209b5726f033fd14c674fec7 100644 (file)
@@ -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,