]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
discover_interfaces() needs to behave differently for client and server
authorTed Lemon <source@isc.org>
Wed, 11 Sep 1996 18:53:33 +0000 (18:53 +0000)
committerTed Lemon <source@isc.org>
Wed, 11 Sep 1996 18:53:33 +0000 (18:53 +0000)
client/dhclient.c
common/dispatch.c
dhclient.c
dhcpd.c
dispatch.c
server/dhcpd.c

index 17e712f712d8d00cbd18dfc15dd79eb9589c3c0f..8bc551ef9893b2d65c1300111babdde662d30d44 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhclient.c,v 1.20 1996/09/11 05:51:25 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhclient.c,v 1.21 1996/09/11 18:53:32 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -118,7 +118,7 @@ int main (argc, argv, envp)
        GET_TIME (&cur_time);
 
        /* Discover all the network interfaces and initialize them. */
-       discover_interfaces ();
+       discover_interfaces (0);
 
        for (interface = interfaces; interface; interface = interface -> next)
                send_discover (interface);
index 404e852290ee4e7cc9d1d49003b9399787642cf1..c5b33dad35b31b8f7cd603f907431f5f6342824b 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dispatch.c,v 1.25 1996/09/11 06:35:16 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dispatch.c,v 1.26 1996/09/11 18:53:33 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -57,7 +57,8 @@ static void got_one PROTO ((struct interface_info *));
    register that interface with the network I/O software, figure out what
    subnet it's on, and add it to the list of interfaces. */
 
-void discover_interfaces ()
+void discover_interfaces (serverP)
+       int serverP;
 {
        struct interface_info *tmp;
        struct interface_info *last;
@@ -243,7 +244,7 @@ void discover_interfaces ()
                        sizeof tmp -> tif -> ifr_addr);
 
                /* We must have a subnet declaration for each interface. */
-               if (!tmp -> shared_network)
+               if (!tmp -> shared_network && serverP)
                        error ("No subnet declaration for %s (%s).",
                               tmp -> name, inet_ntoa (foo.sin_addr));
 
@@ -282,7 +283,7 @@ void discover_interfaces ()
 
                tmp -> tif = (struct ifreq *)0; /* Can't keep this. */
        }
-       if (!server_identifier_matched)
+       if (!server_identifier_matched && serverP)
                warn ("no interface address matches server identifier");
 
        close (sock);
index 17e712f712d8d00cbd18dfc15dd79eb9589c3c0f..8bc551ef9893b2d65c1300111babdde662d30d44 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhclient.c,v 1.20 1996/09/11 05:51:25 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhclient.c,v 1.21 1996/09/11 18:53:32 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -118,7 +118,7 @@ int main (argc, argv, envp)
        GET_TIME (&cur_time);
 
        /* Discover all the network interfaces and initialize them. */
-       discover_interfaces ();
+       discover_interfaces (0);
 
        for (interface = interfaces; interface; interface = interface -> next)
                send_discover (interface);
diff --git a/dhcpd.c b/dhcpd.c
index de296937efe2945524766aa38ad9035733b931ac..7aa6c45642432969c471869a2d99534b40732abe 100644 (file)
--- a/dhcpd.c
+++ b/dhcpd.c
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhcpd.c,v 1.34 1996/09/09 07:05:49 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium.";
+"$Id: dhcpd.c,v 1.35 1996/09/11 18:53:32 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium.";
 #endif
 
 static char copyright[] =
@@ -218,7 +218,7 @@ int main (argc, argv, envp)
        db_startup ();
 
        /* Discover all the network interfaces and initialize them. */
-       discover_interfaces ();
+       discover_interfaces (1);
 
 #ifndef DEBUG
        /* If we didn't write the pid file earlier because we found a
index 404e852290ee4e7cc9d1d49003b9399787642cf1..c5b33dad35b31b8f7cd603f907431f5f6342824b 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dispatch.c,v 1.25 1996/09/11 06:35:16 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dispatch.c,v 1.26 1996/09/11 18:53:33 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -57,7 +57,8 @@ static void got_one PROTO ((struct interface_info *));
    register that interface with the network I/O software, figure out what
    subnet it's on, and add it to the list of interfaces. */
 
-void discover_interfaces ()
+void discover_interfaces (serverP)
+       int serverP;
 {
        struct interface_info *tmp;
        struct interface_info *last;
@@ -243,7 +244,7 @@ void discover_interfaces ()
                        sizeof tmp -> tif -> ifr_addr);
 
                /* We must have a subnet declaration for each interface. */
-               if (!tmp -> shared_network)
+               if (!tmp -> shared_network && serverP)
                        error ("No subnet declaration for %s (%s).",
                               tmp -> name, inet_ntoa (foo.sin_addr));
 
@@ -282,7 +283,7 @@ void discover_interfaces ()
 
                tmp -> tif = (struct ifreq *)0; /* Can't keep this. */
        }
-       if (!server_identifier_matched)
+       if (!server_identifier_matched && serverP)
                warn ("no interface address matches server identifier");
 
        close (sock);
index de296937efe2945524766aa38ad9035733b931ac..7aa6c45642432969c471869a2d99534b40732abe 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhcpd.c,v 1.34 1996/09/09 07:05:49 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium.";
+"$Id: dhcpd.c,v 1.35 1996/09/11 18:53:32 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium.";
 #endif
 
 static char copyright[] =
@@ -218,7 +218,7 @@ int main (argc, argv, envp)
        db_startup ();
 
        /* Discover all the network interfaces and initialize them. */
-       discover_interfaces ();
+       discover_interfaces (1);
 
 #ifndef DEBUG
        /* If we didn't write the pid file earlier because we found a