]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Fix up all the log messages that I broke in the previous commit (thanks
authorTed Lemon <source@isc.org>
Tue, 23 Nov 1999 19:08:24 +0000 (19:08 +0000)
committerTed Lemon <source@isc.org>
Tue, 23 Nov 1999 19:08:24 +0000 (19:08 +0000)
  to Brian Murrell for QCing this code).

server/dhcp.c

index 58ba31d8b4cb454d746e96817097564df7af6900..facbd31b72400d5c5f2904235282200d1322c730 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.129 1999/11/20 18:36:28 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.130 1999/11/23 19:08:24 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -87,7 +87,7 @@ void dhcpdiscover (packet)
                 (packet -> raw -> htype
                  ? print_hw_addr (packet -> raw -> htype,
                                   packet -> raw -> hlen,
-                                  packet -> raw -> chaddr),
+                                  packet -> raw -> chaddr)
                  : (lease
                     ? print_hex_1 (lease -> uid_len, lease -> uid, 
                                    lease -> uid_len)
@@ -172,12 +172,12 @@ void dhcprequest (packet)
                s = (char *)0;
 
        /* Say what we're doing... */
-       sprintf (msgbuf, "DHCPREQUEST for from %s %s%s%svia %s",
+       sprintf (msgbuf, "DHCPREQUEST for %s from %s %s%s%svia %s",
                 piaddr (cip),
                 (packet -> raw -> htype
                  ? print_hw_addr (packet -> raw -> htype,
                                   packet -> raw -> hlen,
-                                  packet -> raw -> chaddr),
+                                  packet -> raw -> chaddr)
                  : (lease
                     ? print_hex_1 (lease -> uid_len, lease -> uid, 
                                    lease -> uid_len)
@@ -285,6 +285,7 @@ void dhcprelease (packet)
        struct iaddr cip;
        struct option_cache *oc;
        struct data_string data;
+       char *s;
 
        /* DHCPRELEASE must not specify address in requested-address
            option, but old protocol specs weren't explicit about this,
@@ -337,7 +338,7 @@ void dhcprelease (packet)
                  (packet -> raw -> htype
                   ? print_hw_addr (packet -> raw -> htype,
                             packet -> raw -> hlen,
-                            packet -> raw -> chaddr),
+                            packet -> raw -> chaddr)
                   : (lease
                      ? print_hex_1 (lease -> uid_len, lease -> uid, 
                                     lease -> uid_len)
@@ -427,7 +428,7 @@ void dhcpdecline (packet)
                          (packet -> raw -> htype
                           ? print_hw_addr (packet -> raw -> htype,
                                            packet -> raw -> hlen,
-                                           packet -> raw -> chaddr),
+                                           packet -> raw -> chaddr)
                           : (lease
                              ? print_hex_1 (lease -> uid_len, lease -> uid, 
                                             lease -> uid_len)
@@ -437,6 +438,7 @@ void dhcpdecline (packet)
                          ? inet_ntoa (packet -> raw -> giaddr)
                          : packet -> interface -> name,
                          status);
+       }
                
        option_state_dereference (&options, "dhcpdecline");
 }
@@ -1932,16 +1934,16 @@ void dhcp_reply (lease)
                   ? (state -> offer == DHCPACK ? "DHCPACK" : "DHCPOFFER")
                   : "BOOTREPLY"),
                  piaddr (lease -> ip_addr),
-                 s ? "(" : "", s ? s : "", s ? ") " : "",
                  (lease -> hardware_addr.htype
                   ? print_hw_addr (lease -> hardware_addr.htype,
                                    lease -> hardware_addr.hlen,
                                    lease -> hardware_addr.haddr)
                   : print_hex_1 (lease -> uid_len, lease -> uid, 
                                  lease -> uid_len)),
-                 state -> giaddr.s_addr
-                 ? inet_ntoa (state -> giaddr)
-                 : state -> ip -> name);
+                 s ? "(" : "", s ? s : "", s ? ") " : "",
+                 (state -> giaddr.s_addr
+                  ? inet_ntoa (state -> giaddr)
+                  : state -> ip -> name));
 
        /* Set up the hardware address... */
        hto.htype = lease -> hardware_addr.htype;