From: David Hankins Date: Wed, 3 Oct 2007 23:36:27 +0000 (+0000) Subject: - Compilation with DLPI and -Werror has been repaired. [ISC-Bugs #17189] X-Git-Tag: v4_0_0b1~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=109e00db7f9eb556af20078091ac2174bf5cd2f3;p=thirdparty%2Fdhcp.git - Compilation with DLPI and -Werror has been repaired. [ISC-Bugs #17189] --- diff --git a/RELNOTES b/RELNOTES index 903221041..9770b64d3 100644 --- a/RELNOTES +++ b/RELNOTES @@ -72,6 +72,8 @@ suggested fixes to . "-Werror" (unused variable) rather than the actual test failure. Lead to inconsistent and unworkable auto-configurations. +- Compilation with DLPI and -Werror has been repaired. + Changes since 4.0.0a2 - Fix for startup where there are no IPv4 addresses on an interface. diff --git a/common/dlpi.c b/common/dlpi.c index c38255d11..50f05eff9 100644 --- a/common/dlpi.c +++ b/common/dlpi.c @@ -122,7 +122,9 @@ # define ABS(x) ((x) >= 0 ? (x) : 0-(x)) # endif +#if defined(USE_DLPI_PFMOD) || defined(USE_DLPI_RAW) static int strioctl PROTO ((int fd, int cmd, int timeout, int len, char *dp)); +#endif #define DLPI_MAXDLBUF 8192 /* Buffer size */ #define DLPI_MAXDLADDR 1024 /* Max address size */ @@ -136,8 +138,13 @@ static int dlpiattachreq PROTO ((int fd, unsigned long ppa)); static int dlpibindreq PROTO ((int fd, unsigned long sap, unsigned long max_conind, unsigned long service_mode, unsigned long conn_mgmt, unsigned long xidtest)); +#if defined(UNUSED_DLPI_INTERFACE) +/* These functions are unused at present, but may be used at a later date. + * defined out to avoid compiler warnings about unused static functions. + */ static int dlpidetachreq PROTO ((int fd)); static int dlpiunbindreq PROTO ((int fd)); +#endif static int dlpiokack PROTO ((int fd, char *bufp)); static int dlpiinfoack PROTO ((int fd, char *bufp)); static int dlpiphysaddrack PROTO ((int fd, char *bufp)); @@ -290,6 +297,7 @@ int if_register_dlpi (info) return sock; } +#if defined(USE_DLPI_PFMOD) || defined(USE_DLPI_RAW) static int strioctl (fd, cmd, timeout, len, dp) int fd; @@ -312,6 +320,7 @@ char *dp; return sio.ic_len; } } +#endif /* USE_DPI_PFMOD || USE_DLPI_RAW */ #ifdef USE_DLPI_SEND void if_register_send (info) @@ -514,8 +523,9 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto) struct sockaddr_in *to; struct hardware *hto; { - unsigned hbufp = 0; +#ifdef USE_DLPI_RAW double hh [32]; +#endif double ih [1536 / sizeof (double)]; unsigned char *dbuf = (unsigned char *)ih; unsigned dbuflen; @@ -615,10 +625,8 @@ ssize_t receive_packet (interface, buf, len, from, hfrom) unsigned char dbuf [1536]; unsigned char srcaddr [DLPI_MAXDLADDR]; unsigned long srcaddrlen; - int flags = 0; int length = 0; int offset = 0; - int rslt; int bufix = 0; int paylen; @@ -728,8 +736,7 @@ ssize_t receive_packet (interface, buf, len, from, hfrom) static int dlpiunit (ifname) char *ifname; { - int fd; - char *cp, *dp, *ep; + char *cp; int unit; if (!ifname) { @@ -890,8 +897,11 @@ static int dlpibindreq (fd, sap, max_conind, service_mode, conn_mgmt, xidtest) return putmsg (fd, &ctl, (struct strbuf*)NULL, flags); } +#if defined(UNUSED_DLPI_INTERFACE) /* - * dlpiunbindreq - send a request to unbind. + * dlpiunbindreq - send a request to unbind. This function is not actually + * used by ISC DHCP, but is included for completeness in case it is + * ever required for new work. */ static int dlpiunbindreq (fd) int fd; @@ -913,7 +923,9 @@ static int dlpiunbindreq (fd) /* - * dlpidetachreq - send a request to detach. + * dlpidetachreq - send a request to detach. This function is not actually + * used by ISC DHCP, but is included for completeness in case it is + * ever required for new work. */ static int dlpidetachreq (fd) int fd; @@ -932,6 +944,7 @@ static int dlpidetachreq (fd) return putmsg (fd, &ctl, (struct strbuf*)NULL, flags); } +#endif /* UNUSED_DLPI_INTERFACE */ /* diff --git a/includes/dhcpd.h b/includes/dhcpd.h index 017026cd2..7658612d4 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -2178,6 +2178,8 @@ int if_register_dlpi PROTO ( (struct interface_info *)); #endif #ifdef USE_DLPI_SEND +int can_unicast_without_arp PROTO ((struct interface_info *)); +int can_receive_unicast_unconfigured PROTO ((struct interface_info *)); void if_reinitialize_send PROTO ((struct interface_info *)); void if_register_send PROTO ((struct interface_info *)); void if_deregister_send PROTO ((struct interface_info *)); @@ -2185,6 +2187,8 @@ ssize_t send_packet PROTO ((struct interface_info *, struct packet *, struct dhcp_packet *, size_t, struct in_addr, struct sockaddr_in *, struct hardware *)); +int supports_multiple_interfaces (struct interface_info *); +void maybe_setup_fallback PROTO ((void)); #endif #ifdef USE_DLPI_RECEIVE void if_reinitialize_receive PROTO ((struct interface_info *));