]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Additional warnings and such from robie. [ISC-Bugs #16865d]
authorDavid Hankins <dhankins@isc.org>
Thu, 17 May 2007 18:27:11 +0000 (18:27 +0000)
committerDavid Hankins <dhankins@isc.org>
Thu, 17 May 2007 18:27:11 +0000 (18:27 +0000)
client/dhc6.c
client/dhclient.c
common/socket.c
includes/dhcpd.h
server/Makefile.dist
server/ddns.c
server/mdb6.c

index 5752336bd079aec3af0636003c3e2dc8eefc4f2f..2c6ce374eaea594d30b1cbe49eea72394bcdb0b1 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhc6.c,v 1.2 2007/05/08 23:05:20 dhankins Exp $ Copyright (c) 2006 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: dhc6.c,v 1.3 2007/05/17 18:27:10 dhankins Exp $ Copyright (c) 2006 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -2545,6 +2545,8 @@ start_bound(struct client_state *client)
 
              default:
                log_fatal("Impossible condition at %s:%d.", MDL);
+               /* Silence compiler warnings. */
+               return;
        }
 
        log_debug("PRC: Bound to lease %s.",
index c20462fdebb9966000ff791b43df14ecae886c1b..33d399f75f1713d417ed5ef556ef503e5301ddde 100644 (file)
@@ -32,7 +32,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhclient.c,v 1.147 2007/05/08 23:05:20 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: dhclient.c,v 1.148 2007/05/17 18:27:10 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -2440,6 +2440,8 @@ write_duid(struct data_string *duid)
 
        if (fflush(leaseFile) != 0)
                return ISC_R_IOERROR;
+
+       return ISC_R_SUCCESS;
 }
 
 /* Write a DHCPv6 lease to the store. */
@@ -2487,7 +2489,7 @@ write_client6_lease(struct client_state *client, struct dhc6_lease *lease,
                stat = fprintf(leaseFile, "    starts %d;\n"
                                          "    renew %u;\n"
                                          "    rebind %u;\n",
-                              ia->starts, ia->renew, ia->rebind);
+                              (int)ia->starts, ia->renew, ia->rebind);
                if (stat <= 0)
                        return ISC_R_IOERROR;
 
@@ -2500,7 +2502,7 @@ write_client6_lease(struct client_state *client, struct dhc6_lease *lease,
                        stat = fprintf(leaseFile, "      starts %d;\n"
                                                  "      preferred-life %u;\n"
                                                  "      max-life %u;\n",
-                                      addr->starts, addr->preferred_life,
+                                      (int)addr->starts, addr->preferred_life,
                                       addr->max_life);
                        if (stat <= 0)
                                return ISC_R_IOERROR;
@@ -2537,6 +2539,8 @@ write_client6_lease(struct client_state *client, struct dhc6_lease *lease,
                        return ISC_R_IOERROR;
                }
        }
+
+       return ISC_R_SUCCESS;
 }
 
 int write_client_lease (client, lease, rewrite, makesure)
@@ -3426,6 +3430,7 @@ isc_result_t client_dns_update (struct client_state *client, int addp,
         */
        memset (&ddns_dhcid, 0, sizeof ddns_dhcid);
 
+       result = 0;
        memset(&client_identifier, 0, sizeof(client_identifier));
        if (client->active_lease != NULL) {
                if (((oc =
index f41606c4845b8722732389039c05c9850d1d4a31..ea103920320f90db99890cff3e8d50ab60b1eb08 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: socket.c,v 1.62 2007/05/16 22:27:34 shane Exp $ "
+"$Id: socket.c,v 1.63 2007/05/17 18:27:11 dhankins Exp $ "
 "Copyright (c) 2004-2006 Internet Systems Consortium.\n";
 #endif /* not lint */
 
@@ -417,8 +417,7 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
 
 /* Send an IPv6 packet */
 ssize_t send_packet6(struct interface_info *interface,
-                    struct dhcp_packet *raw, 
-                    size_t len, 
+                    const unsigned char *raw, size_t len,
                     struct sockaddr_in6 *to) {
        struct msghdr m;
        struct iovec v;
index 8fac87392fb0ace0a31938ee90f45fb362128cc8..022cd9c43187f9a91a12d2530611d4e9779dc470 100644 (file)
@@ -1592,6 +1592,8 @@ void parse_group_declaration PROTO ((struct parse *, struct group *));
 int parse_fixed_addr_param PROTO ((struct option_cache **, 
                                   struct parse *, enum dhcp_token));
 int parse_lease_declaration PROTO ((struct lease **, struct parse *));
+int parse_ip6_addr(struct parse *, struct iaddr *);
+int parse_ip6_addr_expr(struct expression **, struct parse *);
 void parse_address_range PROTO ((struct parse *, struct group *, int,
                                 struct pool *, struct lease **));
 void parse_address_range6(struct parse *cfile, struct group *group);
@@ -1822,6 +1824,7 @@ isc_boolean_t server_duid_isset(void);
 void copy_server_duid(struct data_string *ds, const char *file, int line);
 void set_server_duid(struct data_string *new_duid);
 isc_result_t set_server_duid_from_option(void);
+void set_server_duid_type(int type);
 isc_result_t generate_new_server_duid(void);
 void dhcpv6(struct packet *);
 
@@ -2020,10 +2023,9 @@ ssize_t send_packet PROTO ((struct interface_info *,
                            struct packet *, struct dhcp_packet *, size_t, 
                            struct in_addr,
                            struct sockaddr_in *, struct hardware *));
-ssize_t send_packet6(struct interface_info *, struct packet *, 
-                    struct dhcp_packet *, size_t, struct in6_addr,
-                    struct sockaddr_in6 *, struct hardware *);
 #endif
+ssize_t send_packet6(struct interface_info *, const unsigned char *, size_t,
+                    struct sockaddr_in6 *);
 #ifdef USE_SOCKET_RECEIVE
 void if_reinitialize_receive PROTO ((struct interface_info *));
 void if_register_receive PROTO ((struct interface_info *));
@@ -2031,8 +2033,6 @@ void if_deregister_receive PROTO ((struct interface_info *));
 ssize_t receive_packet PROTO ((struct interface_info *,
                               unsigned char *, size_t,
                               struct sockaddr_in *, struct hardware *));
-ssize_t receive_packet6(struct interface_info *, unsigned char *, size_t,
-                       struct sockaddr_in *, struct in6_addr *);
 #endif
 
 #if defined (USE_SOCKET_FALLBACK)
@@ -2387,6 +2387,7 @@ void dhcpv4_client_assignments(void);
 void dhcpv6_client_assignments(void);
 
 /* dhc6.c */
+void form_duid(struct data_string *duid, char *file, int line);
 void dhc6_lease_destroy(struct dhc6_lease *lease, char *file, int line);
 void start_init6(struct client_state *client);
 void start_confirm6(struct client_state *client);
@@ -2398,6 +2399,7 @@ isc_result_t write_client6_lease(struct client_state *client,
 /* db.c */
 int write_lease PROTO ((struct lease *));
 int write_host PROTO ((struct host_decl *));
+int write_server_duid(void);
 #if defined (FAILOVER_PROTOCOL)
 int write_failover_state (dhcp_failover_state_t *);
 #endif
index ef5f31d9cf792258d0248095bc2b5a7040b06306..2900f83943d8156c876dcd877c4e2e5ce233f749 100644 (file)
@@ -111,10 +111,12 @@ dhcpd:    $(OBJS) $(COBJ) $(DHCPLIB)
        $(CC) $(LFLAGS) -o dhcpd $(OBJS) $(DHCPLIB) $(LIBS)
 
 testmdb6.o: mdb6.c
-       $(CC) -c -DUNIT_TEST -o testmdb6.o $(INCLUDES) $(PREDEFINES) mdb6.c
+       $(CC) -c -DUNIT_TEST $(CFLAGS) -o testmdb6.o $(INCLUDES) \
+               $(PREDEFINES) mdb6.c
 
 testdhcpd.o: dhcpd.c
-       $(CC) -c -DUNIT_TEST -o testdhcpd.o $(INCLUDES) $(PREDEFINES) dhcpd.c
+       $(CC) -c -DUNIT_TEST $(CFLAGS) -o testdhcpd.o $(INCLUDES) \
+               $(PREDEFINES) dhcpd.c
 
 TOBJS  = dhcp.o bootp.o confpars.o db.o class.o failover.o \
         omapi.o mdb.o stables.o salloc.o ddns.o dhcpleasequery.o dhcpv6.o
index 300f5431ab5c0db6d57f2b3e70a28cd5f9082e47..24604b0fd0ff4789995ae640b1fc4e46e32eeb6e 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: ddns.c,v 1.27 2007/05/08 23:05:21 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: ddns.c,v 1.28 2007/05/17 18:27:11 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -253,8 +253,11 @@ ddns_updates(struct packet *packet, struct lease *lease, struct lease *old,
                scope = &(lease6->scope);
                memcpy(addr.iabuf, lease6->addr.s6_addr, 16);
                addr.len = 16;
-       } else
+       } else {
                log_fatal("Impossible condition at %s:%d.", MDL);
+               /* Silence compiler warnings. */
+               return 0;
+       }
 
        memset(&d1, 0, sizeof(d1));
        memset (&ddns_hostname, 0, sizeof (ddns_hostname));
@@ -489,8 +492,11 @@ ddns_updates(struct packet *packet, struct lease *lease, struct lease *old,
                 * 32 hex characters separated by dots.
                 */
                rev_name_len = 64;
-       } else
+       } else {
                log_fatal("invalid address length %d", addr.len);
+               /* Silence compiler warnings. */
+               return 0;
+       }
 
        oc = lookup_option(&server_universe, options, SV_DDNS_REV_DOMAIN_NAME);
        if (oc)
index 3855ba84bc627031069f56a82de2b9d4564dc0b8..2f94bd9ad64c28dad62f99e24b591adf28e7aff7 100644 (file)
@@ -24,8 +24,8 @@
 #include "isc-dhcp/result.h"
 
 #include <stdarg.h>
-#include "omapip/omapip.h"
 #include "dhcpd.h"
+#include "omapip/omapip.h"
 #include "omapip/hash.h"
 #include "dst/md5.h"