mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-22 09:57:20 +00:00
- Additional warnings and such from robie. [ISC-Bugs #16865d]
This commit is contained in:
parent
94f9feeafe
commit
6705543f81
@ -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.",
|
||||
|
@ -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 =
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user