Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/dhcpcd/dist Import dhcpcd-7.0.0-beta2 with the ...
details: https://anonhg.NetBSD.org/src/rev/e81d611b27cb
branches: trunk
changeset: 352467:e81d611b27cb
user: roy <roy%NetBSD.org@localhost>
date: Sun Apr 02 18:54:19 2017 +0000
description:
Import dhcpcd-7.0.0-beta2 with the following changes:
* Builds without AUTH now compile.
* Builds without IPv4LL now compile.
Thanks to Joerg Sonnenberger.
* BPF no longer uses a variable length buffer for stack protector.
* Minor documentation fix for duid file location.
Thanks to Peter Colberg.
diffstat:
external/bsd/dhcpcd/dist/Makefile | 33 +-------------------------
external/bsd/dhcpcd/dist/configure | 33 ---------------------------
external/bsd/dhcpcd/dist/src/bpf.c | 2 +-
external/bsd/dhcpcd/dist/src/defs.h | 2 +-
external/bsd/dhcpcd/dist/src/dhcp.c | 10 ++++---
external/bsd/dhcpcd/dist/src/dhcp6.c | 13 +++++++---
external/bsd/dhcpcd/dist/src/dhcpcd.8.in | 4 +-
external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in | 4 +-
external/bsd/dhcpcd/dist/src/ipv4ll.h | 8 +++---
9 files changed, 27 insertions(+), 82 deletions(-)
diffs (286 lines):
diff -r 00acea5ad499 -r e81d611b27cb external/bsd/dhcpcd/dist/Makefile
--- a/external/bsd/dhcpcd/dist/Makefile Sun Apr 02 14:27:11 2017 +0000
+++ b/external/bsd/dhcpcd/dist/Makefile Sun Apr 02 18:54:19 2017 +0000
@@ -83,38 +83,9 @@
tar cf - -C /tmp ${DISTPREFIX} | xz >${DISTFILE}
ls -l ${DISTFILE}
-import: ${SRCS} hooks
+import: dist
rm -rf /tmp/${DISTPREFIX}
${INSTALL} -d /tmp/${DISTPREFIX}
- cp genembedc genembedh /tmp/${DISTPREFIX}
- cp $$(echo ${SRCS} | sed -e 's/\(dhcpcd-embedded.[ch]\)/\1.in/') \
- /tmp/${DISTPREFIX}
- cp dhcpcd.conf dhcpcd-definitions.conf *.in /tmp/${DISTPREFIX}
- cp dhcpcd-definitions-small.conf *.in /tmp/${DISTPREFIX}
- cp $$(${CC} ${CPPFLAGS} -DDEPGEN -MM \
- $$(echo ${SRCS} | sed -e 's/dhcpcd-embedded.c//') | \
- sed -e 's/^.*\.c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \
- tr ' ' '\n' | \
- sed -e '/^dhcpcd-embedded.h$$/d' | \
- sed -e '/^compat\//d' | \
- sed -e '/^crypt\//d' | \
- sort -u) /tmp/${DISTPREFIX}; \
- if test -n "${CRYPT_SRCS}"; then \
- ${INSTALL} -d /tmp/${DISTPREFIX}/crypt; \
- cp ${CRYPT_SRCS} /tmp/${DISTPREFIX}/crypt; \
- cp $$(${CC} ${CPPFLAGS} -DDEPGEN -MM ${CRYPT_SRCS} | \
- sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \
- tr ' ' '\n' | sed -e '/\/\.\.\//d' | \
- sort -u) /tmp/${DISTPREFIX}/crypt; \
- fi;
- if test -n "${COMPAT_SRCS}"; then \
- ${INSTALL} -d /tmp/${DISTPREFIX}/compat; \
- cp ${COMPAT_SRCS} /tmp/${DISTPREFIX}/compat; \
- cp $$(${CC} ${CPPFLAGS} -DDEPGEN -MM ${COMPAT_SRCS} | \
- sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \
- tr ' ' '\n' | \
- sort -u) /tmp/${DISTPREFIX}/compat; \
- fi;
- cd dhcpcd-hooks; ${MAKE} DISTPREFIX=${DISTPREFIX} $@
+ tar xvJpf ${DISTFILE} -C /tmp
include Makefile.inc
diff -r 00acea5ad499 -r e81d611b27cb external/bsd/dhcpcd/dist/configure
--- a/external/bsd/dhcpcd/dist/configure Sun Apr 02 14:27:11 2017 +0000
+++ b/external/bsd/dhcpcd/dist/configure Sun Apr 02 18:54:19 2017 +0000
@@ -83,8 +83,6 @@
--without-arc4random) ARC4RANDOM=no;;
--without-strlcpy) STRLCPY=no;;
--without-pidfile_lock) PIDFILE_LOCK=no;;
- --with-printf_m) HAVE_PRINTF_M=yes;;
- --without-printf_m) HAVE_PRINTF_M=no;;
--without-reallocarrray) REALLOCARRAY=no;;
--without-md5) MD5=no;;
--without-sha2) SHA2=no;;
@@ -834,37 +832,6 @@
echo "#include \"compat/dprintf.h\"" >>$CONFIG_H
fi
-if [ -z "$HAVE_PRINTF_M" ]; then
- printf "Testing for printf %%m support ..."
- cat <<EOF >_printf_m.c
-#include <sys/param.h>
-#include <stdio.h>
-#ifdef __GLIBC__
-/* glibc has always had it */
-#elif defined(__UCLIBC_HAS_PRINTF_M_SPEC__)
-/* test uClibc */
-#else
-/* If you're using musl libc (or any other libc with printf %m support),
- * you'll have to pass --with-printf_m to configure to shrink the binary
- * size. */
-#error libc does not support printf %m
-#endif
-int main(void) {
- return printf("%m\n");
-}
-EOF
- if $XCC _printf_m.c -o _printf_m 2>&3; then
- HAVE_PRINTF_M=yes
- else
- HAVE_PRINTF_M=no
- fi
- echo "$HAVE_PRINTF_M"
- rm -f _printf_m.c _printf_m
-fi
-if [ "$HAVE_PRINTF_M" = yes ]; then
- echo "#define HAVE_PRINTF_M" >>$CONFIG_H
-fi
-
if [ -z "$TAILQ_FOREACH_SAFE" ]; then
printf "Testing for TAILQ_FOREACH_SAFE ... "
cat <<EOF >_queue.c
diff -r 00acea5ad499 -r e81d611b27cb external/bsd/dhcpcd/dist/src/bpf.c
--- a/external/bsd/dhcpcd/dist/src/bpf.c Sun Apr 02 14:27:11 2017 +0000
+++ b/external/bsd/dhcpcd/dist/src/bpf.c Sun Apr 02 18:54:19 2017 +0000
@@ -424,7 +424,7 @@
int
bpf_arp(struct interface *ifp, int fd)
{
- size_t bpf_hw = ((((size_t)ifp->hwlen / 4) + 2) * 2) + 1;
+ size_t bpf_hw = (((sizeof(ifp->hwaddr) / 4) + 2) * 2) + 1;
struct bpf_insn bpf[3 + bpf_arp_filter_len + bpf_hw + bpf_arp_extra];
struct bpf_insn *bp;
struct iarp_state *state;
diff -r 00acea5ad499 -r e81d611b27cb external/bsd/dhcpcd/dist/src/defs.h
--- a/external/bsd/dhcpcd/dist/src/defs.h Sun Apr 02 14:27:11 2017 +0000
+++ b/external/bsd/dhcpcd/dist/src/defs.h Sun Apr 02 18:54:19 2017 +0000
@@ -28,7 +28,7 @@
#define CONFIG_H
#define PACKAGE "dhcpcd"
-#define VERSION "7.0.0-beta1"
+#define VERSION "7.0.0-beta2"
#ifndef CONFIG
# define CONFIG SYSCONFDIR "/" PACKAGE ".conf"
diff -r 00acea5ad499 -r e81d611b27cb external/bsd/dhcpcd/dist/src/dhcp.c
--- a/external/bsd/dhcpcd/dist/src/dhcp.c Sun Apr 02 14:27:11 2017 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp.c Sun Apr 02 18:54:19 2017 +0000
@@ -2741,8 +2741,8 @@
unsigned int i;
char *msg;
bool bootp_copied;
+#ifdef AUTH
const uint8_t *auth;
-#ifdef AUTH
size_t auth_len;
#endif
#ifdef IN_IFF_DUPLICATED
@@ -2812,8 +2812,6 @@
}
LOGDHCP0(LOG_WARNING, "no authentication");
}
-#else
- auth = NULL;
#endif
/* RFC 3203 */
@@ -2824,8 +2822,9 @@
LOGDHCP(LOG_ERR, "discarding Force Renew");
return;
}
+#ifdef AUTH
if (auth == NULL) {
- LOGDHCP(LOG_ERR, "unauthenticated Force Renew");
+ LOGDHCP(LOG_ERR, "unauthenticated force renew");
if (ifo->auth.options & DHCPCD_AUTH_REQUIRE)
return;
}
@@ -2843,6 +2842,9 @@
send_inform, ifp);
dhcp_inform(ifp);
}
+#else
+ LOGDHCP(LOG_ERR, "unauthenticated force renew");
+#endif
return;
}
diff -r 00acea5ad499 -r e81d611b27cb external/bsd/dhcpcd/dist/src/dhcp6.c
--- a/external/bsd/dhcpcd/dist/src/dhcp6.c Sun Apr 02 14:27:11 2017 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp6.c Sun Apr 02 18:54:19 2017 +0000
@@ -635,9 +635,11 @@
if (ifo->mudurl[0])
len += sizeof(o) + ifo->mudurl[0];
+#ifdef AUTH
if ((ifo->auth.options & DHCPCD_AUTH_SENDREQUIRE) !=
DHCPCD_AUTH_SENDREQUIRE)
len += sizeof(o); /* Reconfigure Accept */
+#endif
}
len += sizeof(*state->send);
@@ -906,11 +908,12 @@
if (ifo->mudurl[0])
COPYIN(D6_OPTION_MUDURL,
ifo->mudurl + 1, ifo->mudurl[0]);
-
-
+
+#ifdef AUTH
if ((ifo->auth.options & DHCPCD_AUTH_SENDREQUIRE) !=
DHCPCD_AUTH_SENDREQUIRE)
COPYIN1(D6_OPTION_RECONF_ACCEPT, 0);
+#endif
if (n_options) {
o_lenp = NEXTLEN;
@@ -2885,8 +2888,6 @@
syslog(LOG_WARNING, "%s: no authentication from %s",
ifp->name, ctx->sfrom);
}
-#else
- auth = NULL;
#endif
op = dhcp6_get_op(r->type);
@@ -2996,11 +2997,14 @@
return;
break;
case DHCP6_RECONFIGURE:
+#ifdef AUTH
if (auth == NULL) {
+#endif
syslog(LOG_ERR, "%s: unauthenticated %s from %s",
ifp->name, op, ctx->sfrom);
if (ifo->auth.options & DHCPCD_AUTH_REQUIRE)
return;
+#ifdef AUTH
}
syslog(LOG_INFO, "%s: %s from %s",
ifp->name, op, ctx->sfrom);
@@ -3041,6 +3045,7 @@
break;
}
return;
+#endif
default:
syslog(LOG_ERR, "%s: invalid DHCP6 type %s (%d)",
ifp->name, op, r->type);
diff -r 00acea5ad499 -r e81d611b27cb external/bsd/dhcpcd/dist/src/dhcpcd.8.in
--- a/external/bsd/dhcpcd/dist/src/dhcpcd.8.in Sun Apr 02 14:27:11 2017 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcpcd.8.in Sun Apr 02 18:54:19 2017 +0000
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd March 28, 2017
+.Dd April 2, 2017
.Dt DHCPCD 8
.Os
.Sh NAME
@@ -259,7 +259,7 @@
is not enabled by default.
.Nm
generates the DUID and stores it in
-.Pa @SYSCONFDIR@/dhcpcd.duid .
+.Pa @DBDIR@/dhcpcd.duid .
This file should not be copied to other hosts.
.It Fl d , Fl Fl debug
Echo debug messages to the stderr and syslog.
diff -r 00acea5ad499 -r e81d611b27cb external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
--- a/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in Sun Apr 02 14:27:11 2017 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in Sun Apr 02 18:54:19 2017 +0000
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd March 28, 2017
+.Dd April 2, 2017
.Dt DHCPCD.CONF 5
.Os
.Sh NAME
@@ -191,7 +191,7 @@
This, plus the IAID will be used as the
.Ic clientid .
The DUID-LLT generated will be held in
-.Pa @SYSCONFDIR@/dhcpcd.duid
+.Pa @DBDIR@/dhcpcd.duid
and should not be copied to other hosts.
.It Ic iaid Ar iaid
Set the Interface Association Identifier to
diff -r 00acea5ad499 -r e81d611b27cb external/bsd/dhcpcd/dist/src/ipv4ll.h
--- a/external/bsd/dhcpcd/dist/src/ipv4ll.h Sun Apr 02 14:27:11 2017 +0000
+++ b/external/bsd/dhcpcd/dist/src/ipv4ll.h Sun Apr 02 18:54:19 2017 +0000
@@ -66,13 +66,13 @@
int ipv4ll_recvrt(int, const struct rt *);
#endif
-#define ipv4ll_free(ifp) ipv4ll_freedrop((ifp), 0);
-#define ipv4ll_drop(ifp) ipv4ll_freedrop((ifp), 1);
+#define ipv4ll_free(ifp) ipv4ll_freedrop((ifp), 0);
+#define ipv4ll_drop(ifp) ipv4ll_freedrop((ifp), 1);
void ipv4ll_freedrop(struct interface *, int);
#else
#define IPV4LL_STATE_RUNNING(ifp) (0)
-#define ipv4ll_subnet_route(ifp) (NULL)
-#define ipv4ll_default_route(ifp) (NULL)
+#define ipv4ll_subnetroute(route, ifp) (0)
+#define ipv4ll_defaultroute(route, ifp) (0)
#define ipv4ll_handlert(a, b, c) (0)
#define ipv4ll_free(a) {}
#define ipv4ll_drop(a) {}
Home |
Main Index |
Thread Index |
Old Index