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.
This commit is contained in:
roy 2017-04-02 18:54:19 +00:00
parent 8e077e469b
commit 82ffdd577c
9 changed files with 26 additions and 81 deletions

View File

@ -83,38 +83,9 @@ snapshot:
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

View File

@ -83,8 +83,6 @@ for x do
--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 @@ if [ "$DPRINTF" = no ]; then
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

View File

@ -424,7 +424,7 @@ static const struct bpf_insn bpf_arp_filter [] = {
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;

View File

@ -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"

View File

@ -2741,8 +2741,8 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len,
unsigned int i;
char *msg;
bool bootp_copied;
const uint8_t *auth;
#ifdef AUTH
const uint8_t *auth;
size_t auth_len;
#endif
#ifdef IN_IFF_DUPLICATED
@ -2812,8 +2812,6 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len,
}
LOGDHCP0(LOG_WARNING, "no authentication");
}
#else
auth = NULL;
#endif
/* RFC 3203 */
@ -2824,8 +2822,9 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len,
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 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len,
send_inform, ifp);
dhcp_inform(ifp);
}
#else
LOGDHCP(LOG_ERR, "unauthenticated force renew");
#endif
return;
}

View File

@ -635,9 +635,11 @@ dhcp6_makemessage(struct interface *ifp)
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 @@ dhcp6_makemessage(struct interface *ifp)
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 @@ dhcp6_handledata(void *arg)
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 @@ dhcp6_handledata(void *arg)
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 @@ dhcp6_handledata(void *arg)
break;
}
return;
#endif
default:
syslog(LOG_ERR, "%s: invalid DHCP6 type %s (%d)",
ifp->name, op, r->type);

View File

@ -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 @@ This requires persistent storage and not all DHCP servers work with it so it
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.

View File

@ -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 @@ is generated, otherwise DUID-LL is generated (link local address).
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

View File

@ -66,13 +66,13 @@ void ipv4ll_handle_failure(void *);
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) {}