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-6.4.3 with the follow...
details: https://anonhg.NetBSD.org/src/rev/53e995669f19
branches: trunk
changeset: 331076:53e995669f19
user: roy <roy%NetBSD.org@localhost>
date: Wed Jul 30 15:44:09 2014 +0000
description:
Import dhcpcd-6.4.3 with the following changes:
* Correct DHCPv6 Prefix Delegation option decoding
* Poll interfaces on BSD for IFF_RUNNING if link state cannot be obtained
* Check for an IA to use in DHCPv6 lease validation
* Warn about exceeding IDGEN_RETRIES when a stable private address cannot
be obtained
* Fix DHCP option overload handling, thanks to Tobias Stoeckmann
diffstat:
external/bsd/dhcpcd/dist/arp.c | 3 ++-
external/bsd/dhcpcd/dist/crypt/hmac_md5.c | 8 +++++---
external/bsd/dhcpcd/dist/defs.h | 4 ++--
external/bsd/dhcpcd/dist/dhcp6.c | 24 ++++++++++--------------
external/bsd/dhcpcd/dist/dhcpcd-definitions.conf | 3 ++-
external/bsd/dhcpcd/dist/dhcpcd-embedded.c | 3 ++-
external/bsd/dhcpcd/dist/if.c | 11 ++++++-----
external/bsd/dhcpcd/dist/if.h | 4 ++--
8 files changed, 31 insertions(+), 29 deletions(-)
diffs (235 lines):
diff -r 1b0a148345ba -r 53e995669f19 external/bsd/dhcpcd/dist/arp.c
--- a/external/bsd/dhcpcd/dist/arp.c Wed Jul 30 13:50:33 2014 +0000
+++ b/external/bsd/dhcpcd/dist/arp.c Wed Jul 30 15:44:09 2014 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: arp.c,v 1.1.1.12 2014/06/14 20:51:04 roy Exp $");
+ __RCSID("$NetBSD: arp.c,v 1.1.1.13 2014/07/30 15:44:09 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -29,6 +29,7 @@
*/
#include <sys/socket.h>
+#include <sys/types.h>
#include <net/if.h>
#include <netinet/in.h>
diff -r 1b0a148345ba -r 53e995669f19 external/bsd/dhcpcd/dist/crypt/hmac_md5.c
--- a/external/bsd/dhcpcd/dist/crypt/hmac_md5.c Wed Jul 30 13:50:33 2014 +0000
+++ b/external/bsd/dhcpcd/dist/crypt/hmac_md5.c Wed Jul 30 15:44:09 2014 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: hmac_md5.c,v 1.1.1.3 2014/07/14 14:02:02 roy Exp $");
+ __RCSID("$NetBSD: hmac_md5.c,v 1.1.1.4 2014/07/30 15:44:11 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -35,9 +35,11 @@
#include "../config.h"
#ifdef HAVE_MD5_H
-#include <md5.h>
+# ifndef DEPGEN
+# include <md5.h>
+# endif
#else
-#include "md5.h"
+# include "md5.h"
#endif
#define HMAC_PAD_LEN 64
diff -r 1b0a148345ba -r 53e995669f19 external/bsd/dhcpcd/dist/defs.h
--- a/external/bsd/dhcpcd/dist/defs.h Wed Jul 30 13:50:33 2014 +0000
+++ b/external/bsd/dhcpcd/dist/defs.h Wed Jul 30 15:44:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.1.1.40 2014/07/14 14:02:02 roy Exp $ */
+/* $NetBSD: defs.h,v 1.1.1.41 2014/07/30 15:44:11 roy Exp $ */
/*
* dhcpcd - DHCP client daemon
@@ -30,7 +30,7 @@
#define CONFIG_H
#define PACKAGE "dhcpcd"
-#define VERSION "6.4.2"
+#define VERSION "6.4.3"
#ifndef CONFIG
# define CONFIG SYSCONFDIR "/" PACKAGE ".conf"
diff -r 1b0a148345ba -r 53e995669f19 external/bsd/dhcpcd/dist/dhcp6.c
--- a/external/bsd/dhcpcd/dist/dhcp6.c Wed Jul 30 13:50:33 2014 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp6.c Wed Jul 30 15:44:09 2014 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: dhcp6.c,v 1.1.1.12 2014/07/14 14:02:01 roy Exp $");
+ __RCSID("$NetBSD: dhcp6.c,v 1.1.1.13 2014/07/30 15:44:10 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -48,8 +48,7 @@
#include <syslog.h>
#include <unistd.h>
-#define ELOOP_QUEUE 3
-
+#define ELOOP_QUEUE 4
#include "config.h"
#include "common.h"
#include "dhcp.h"
@@ -1605,8 +1604,6 @@
{
struct dhcp6_state *state;
const struct dhcp6_option *o;
- const uint8_t *p;
- struct in6_addr in6;
struct ipv6_addr *a;
char iabuf[INET6_ADDRSTRLEN];
const char *ia;
@@ -1630,9 +1627,7 @@
ifp->name);
continue;
}
- p = D6_COPTION_DATA(o);
iap = (const struct dhcp6_ia_addr *)D6_COPTION_DATA(o);
- p += sizeof(in6);
a = dhcp6_findaddr(ifp, &iap->addr);
if (a == NULL) {
a = calloc(1, sizeof(*a));
@@ -1959,6 +1954,7 @@
const char *sfrom)
{
struct dhcp6_state *state;
+ int nia;
if (len <= sizeof(*m)) {
syslog(LOG_ERR, "%s: DHCPv6 lease truncated", ifp->name);
@@ -1971,7 +1967,13 @@
state->renew = state->rebind = state->expire = 0;
state->lowpl = ND6_INFINITE_LIFETIME;
- return dhcp6_findia(ifp, m, len, sfrom);
+ nia = dhcp6_findia(ifp, m, len, sfrom);
+ if (nia == 0) {
+ syslog(LOG_ERR, "%s: no useable IA found in lease",
+ ifp->name);
+ return -1;
+ }
+ return nia;
}
static ssize_t
@@ -2041,11 +2043,6 @@
fd = dhcp6_validatelease(ifp, state->new, state->new_len, NULL);
if (fd == -1)
goto ex;
- if (fd == 0) {
- syslog(LOG_INFO, "%s: no useable IA found in lease",
- ifp->name);
- goto ex;
- }
if (state->expire != ND6_INFINITE_LIFETIME) {
gettimeofday(&now, NULL);
@@ -2150,7 +2147,6 @@
int pfxlen;
/* RFC6603 Section 4.2 */
- pfxlen = 0; /* appease gcc */
if (strcmp(ifp->name, ifs->name) == 0) {
if (prefix->prefix_exclude_len == 0) {
/* Don't spam the log automatically */
diff -r 1b0a148345ba -r 53e995669f19 external/bsd/dhcpcd/dist/dhcpcd-definitions.conf
--- a/external/bsd/dhcpcd/dist/dhcpcd-definitions.conf Wed Jul 30 13:50:33 2014 +0000
+++ b/external/bsd/dhcpcd/dist/dhcpcd-definitions.conf Wed Jul 30 15:44:09 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: dhcpcd-definitions.conf,v 1.1.1.4 2014/07/14 11:45:04 roy Exp $
+# $NetBSD: dhcpcd-definitions.conf,v 1.1.1.5 2014/07/30 15:44:11 roy Exp $
# Copyright (c) 2006-2014 Roy Marples
# All rights reserved
@@ -360,6 +360,7 @@
define6 26 index embed prefix
embed uint32 pltime
embed uint32 vltime
+embed byte length
embed ip6address prefix
encap 13 option
encap 67 option
diff -r 1b0a148345ba -r 53e995669f19 external/bsd/dhcpcd/dist/dhcpcd-embedded.c
--- a/external/bsd/dhcpcd/dist/dhcpcd-embedded.c Wed Jul 30 13:50:33 2014 +0000
+++ b/external/bsd/dhcpcd/dist/dhcpcd-embedded.c Wed Jul 30 15:44:09 2014 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: dhcpcd-embedded.c,v 1.1.1.6 2014/07/14 11:45:03 roy Exp $");
+ __RCSID("$NetBSD: dhcpcd-embedded.c,v 1.1.1.7 2014/07/30 15:44:09 roy Exp $");
/*
* DO NOT EDIT
@@ -252,6 +252,7 @@
"define6 26 index embed prefix",
"embed uint32 pltime",
"embed uint32 vltime",
+"embed byte length",
"embed ip6address prefix",
"encap 13 option",
"encap 67 option",
diff -r 1b0a148345ba -r 53e995669f19 external/bsd/dhcpcd/dist/if.c
--- a/external/bsd/dhcpcd/dist/if.c Wed Jul 30 13:50:33 2014 +0000
+++ b/external/bsd/dhcpcd/dist/if.c Wed Jul 30 15:44:09 2014 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: if.c,v 1.1.1.2 2014/07/14 11:45:03 roy Exp $");
+ __RCSID("$NetBSD: if.c,v 1.1.1.3 2014/07/30 15:44:09 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -121,16 +121,17 @@
}
iface->flags = (unsigned int)ifr.ifr_flags;
- r = LINK_UNKNOWN;
#ifdef SIOCGIFMEDIA
memset(&ifmr, 0, sizeof(ifmr));
strlcpy(ifmr.ifm_name, iface->name, sizeof(ifmr.ifm_name));
if (ioctl(s, SIOCGIFMEDIA, &ifmr) != -1 &&
ifmr.ifm_status & IFM_AVALID)
r = (ifmr.ifm_status & IFM_ACTIVE) ? LINK_UP : LINK_DOWN;
+ else
+ r = ifr.ifr_flags & IFF_RUNNING ? LINK_UP : LINK_UNKNOWN;
+#else
+ r = ifr.ifr_flags & IFF_RUNNING ? LINK_UP : LINK_DOWN;
#endif
- if (r == LINK_UNKNOWN)
- r = (ifr.ifr_flags & IFF_RUNNING) ? LINK_UP : LINK_DOWN;
close(s);
return r;
}
@@ -155,7 +156,7 @@
#endif
r = -1;
if (ioctl(s, SIOCGIFFLAGS, &ifr) == 0) {
- if (flag == 0 || ifr.ifr_flags & flag)
+ if (flag == 0 || (ifr.ifr_flags & flag) == flag)
r = 0;
else {
ifr.ifr_flags |= flag;
diff -r 1b0a148345ba -r 53e995669f19 external/bsd/dhcpcd/dist/if.h
--- a/external/bsd/dhcpcd/dist/if.h Wed Jul 30 13:50:33 2014 +0000
+++ b/external/bsd/dhcpcd/dist/if.h Wed Jul 30 15:44:09 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.h,v 1.1.1.2 2014/07/14 11:45:06 roy Exp $ */
+/* $NetBSD: if.h,v 1.1.1.3 2014/07/30 15:44:11 roy Exp $ */
/*
* dhcpcd - DHCP client daemon
@@ -93,7 +93,7 @@
#define RAW_PARTIALCSUM 2 << 0
int if_setflag(struct interface *ifp, short flag);
-#define if_up(ifp) if_setflag((ifp), IFF_UP)
+#define if_up(ifp) if_setflag((ifp), (IFF_UP | IFF_RUNNING))
struct if_head *if_discover(struct dhcpcd_ctx *, int, char * const *);
struct interface *if_find(struct dhcpcd_ctx *, const char *);
void if_free(struct interface *);
Home |
Main Index |
Thread Index |
Old Index