]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Don't print /unattached if there's no shared-network hanging off an
authorTed Lemon <source@isc.org>
Tue, 23 Feb 1999 22:09:56 +0000 (22:09 +0000)
committerTed Lemon <source@isc.org>
Tue, 23 Feb 1999 22:09:56 +0000 (22:09 +0000)
interface.

common/bpf.c
common/dlpi.c
common/lpf.c
common/nit.c
common/raw.c
common/socket.c
common/upf.c

index 96ca0033687c0b6784c8d62ecfc6a0492b0645b2..38234064b0d67d5aba98ee94786ecd3872ada3b6 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: bpf.c,v 1.19.2.7 1999/02/23 17:35:45 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: bpf.c,v 1.19.2.8 1999/02/23 22:09:56 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -142,13 +142,14 @@ void if_register_send (info)
        info -> wfdesc = info -> rfdesc;
 #endif
        if (!quiet_interface_discovery)
-               note ("Sending on   BPF/%s/%s/%s",
+               note ("Sending on   BPF/%s/%s%s%s",
                      info -> name,
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_BPF_SEND */
 
@@ -250,13 +251,14 @@ void if_register_receive (info)
        if (ioctl (info -> rfdesc, BIOCSETF, &p) < 0)
                error ("Can't install packet filter program: %m");
        if (!quiet_interface_discovery)
-               note ("Listening on BPF/%s/%s/%s",
+               note ("Listening on BPF/%s/%s%s%s",
                      info -> name,
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_BPF_RECEIVE */
 
@@ -273,6 +275,7 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
        int bufp = 0;
        unsigned char buf [256];
        struct iovec iov [2];
+       int result;
 
        if (!strcmp (interface -> name, "fallback"))
                return send_fallback (interface, packet, raw,
index 7ff1a7c61de6d25d35a940ee9f79d6d39c84b2d3..d877db52088f75d21972ab2c1574fb27b18e746d 100644 (file)
@@ -344,13 +344,14 @@ void if_register_send (info)
 #endif
 
         if (!quiet_interface_discovery)
-               note ("Sending on   DLPI/%s/%s/%s",
+               note ("Sending on   DLPI/%s/%s%s%s",
                      info -> name,
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 
 #ifdef DLPI_FIRST_SEND_WAIT
 /* See the implementation notes at the beginning of this file */
@@ -397,7 +398,7 @@ void if_register_receive (info)
        pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_CAND;
        pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 18;
        pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND;
-       pf.Pf_Filter [pf.Pf_FilterLen++] = local_port;
+       pf.Pf_Filter [pf.Pf_FilterLen++] = htons (local_port);
 #else
        /*
         * The packets that will be received on this file descriptor
@@ -415,7 +416,7 @@ void if_register_receive (info)
        pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_CAND;
        pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 11;
        pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND;
-       pf.Pf_Filter [pf.Pf_FilterLen++] = local_port;
+       pf.Pf_Filter [pf.Pf_FilterLen++] = htons (local_port);
 #endif
 
        /* Install the filter... */
@@ -426,13 +427,14 @@ void if_register_receive (info)
 #endif
 
         if (!quiet_interface_discovery)
-               note ("Listening on DLPI/%s/%s/%s",
+               note ("Listening on DLPI/%s/%s%s%s",
                      info -> name,
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 
 #ifdef DLPI_FIRST_SEND_WAIT
 /* See the implementation notes at the beginning of this file */
index f7ac8ea1a576d203548cbdea2418a27985d754b0..d31d6f3cb96ecc7138d0ea921c960210b321699d 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: lpf.c,v 1.1.2.5 1999/02/23 17:35:45 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: lpf.c,v 1.1.2.6 1999/02/23 22:09:55 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -129,13 +129,14 @@ void if_register_send (info)
        info -> wfdesc = info -> rfdesc;
 #endif
        if (!quiet_interface_discovery)
-               note ("Sending on   LPF/%s/%s/%s",
+               note ("Sending on   LPF/%s/%s%s%s",
                      info -> name,
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_LPF_SEND */
 
@@ -174,13 +175,14 @@ void if_register_receive (info)
                error ("Can't install packet filter program: %m");
        }
        if (!quiet_interface_discovery)
-               note ("Listening on LPF/%s/%s/%s",
+               note ("Listening on LPF/%s/%s%s%s",
                      info -> name,
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_LPF_RECEIVE */
 
index a2162abb7ecefce52deb27fa19e4a66037440fcc..047f2a11ae553cad39479a2535755835de6415cd 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: nit.c,v 1.15.2.2 1999/02/23 17:35:46 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: nit.c,v 1.15.2.3 1999/02/23 22:09:54 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -155,12 +155,13 @@ void if_register_send (info)
        info -> wfdesc = info -> rfdesc;
 #endif
         if (!quiet_interface_discovery)
-               note ("Sending on   NIT/%s/%s",
+               note ("Sending on   NIT/%s%s%s",
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_NIT_SEND */
 
@@ -238,12 +239,13 @@ void if_register_receive (info)
                error ("Can't set NIT filter on %s: %m", info -> name);
 
         if (!quiet_interface_discovery)
-               note ("Listening on NIT/%s/%s",
+               note ("Listening on NIT/%s%s%s",
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_NIT_RECEIVE */
 
index dd095d9d832551370cb29a07217f8ca977e0881f..2740c49fbe90db25818ee6c52b14930ea31aab78 100644 (file)
@@ -54,7 +54,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: raw.c,v 1.11.2.1 1999/02/23 17:35:46 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: raw.c,v 1.11.2.2 1999/02/23 22:09:54 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -97,10 +97,11 @@ void if_register_send (info)
 
        info -> wfdesc = sock;
         if (!quiet_interface_discovery)
-               note ("Sending on   Raw/%s/%s",
+               note ("Sending on   Raw/%s%s%s",
                      info -> name,
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 
 size_t send_packet (interface, packet, raw, len, from, to, hto)
index c28eb4fbe3ca489867594c026648b66ce4841c31..8e1b274b668d6d214a0fbdecc5729d1d78128102 100644 (file)
@@ -50,7 +50,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: socket.c,v 1.26.2.9 1999/02/23 17:35:46 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: socket.c,v 1.26.2.10 1999/02/23 22:09:55 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -159,11 +159,11 @@ void if_register_send (info)
        info -> wfdesc = info -> rfdesc;
 #endif
        if (!quiet_interface_discovery)
-               note ("Sending on   Socket/%s/%s",
+               note ("Sending on   Socket/%s%s%s",
                      info -> name,
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
-
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_SOCKET_SEND */
 
@@ -175,10 +175,11 @@ void if_register_receive (info)
           we don't need to register this interface twice. */
        info -> rfdesc = if_register_socket (info);
        if (!quiet_interface_discovery)
-               note ("Listening on Socket/%s/%s",
+               note ("Listening on Socket/%s%s%s",
                      info -> name,
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_SOCKET_RECEIVE */
 
index 811d33df2ead66894f5b8dbf1ea17fec8620a6d7..c172c6239eb3b89ee604f827b9286d0abe1540c9 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: upf.c,v 1.3.2.2 1999/02/23 17:35:47 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: upf.c,v 1.3.2.3 1999/02/23 22:09:56 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -143,13 +143,14 @@ void if_register_send (info)
        info -> wfdesc = info -> rfdesc;
 #endif
         if (!quiet_interface_discovery)
-               note ("Sending on   UPF/%s/%s/%s",
+               note ("Sending on   UPF/%s/%s%s%s",
                      info -> name,
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_UPF_SEND */
 
@@ -208,13 +209,14 @@ void if_register_receive (info)
        if (ioctl (info -> rfdesc, EIOCSETF, &pf) < 0)
                error ("Can't install packet filter program: %m");
         if (!quiet_interface_discovery)
-               note ("Listening on UPF/%s/%s/%s",
+               note ("Listening on UPF/%s/%s%s%s",
                      info -> name,
                      print_hw_addr (info -> hw_address.htype,
                                     info -> hw_address.hlen,
                                     info -> hw_address.haddr),
+                     (info -> shared_network ? "/" : ""),
                      (info -> shared_network ?
-                      info -> shared_network -> name : "unattached"));
+                      info -> shared_network -> name : ""));
 }
 #endif /* USE_UPF_RECEIVE */