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 Sync
details: https://anonhg.NetBSD.org/src/rev/b61b57b5549e
branches: trunk
changeset: 344786:b61b57b5549e
user: roy <roy%NetBSD.org@localhost>
date: Wed Apr 20 08:53:01 2016 +0000
description:
Sync
diffstat:
external/bsd/dhcpcd/dist/arp.c | 4 +-
external/bsd/dhcpcd/dist/arp.h | 3 +-
external/bsd/dhcpcd/dist/control.c | 4 +-
external/bsd/dhcpcd/dist/defs.h | 4 +-
external/bsd/dhcpcd/dist/dhcp-common.c | 35 +++++++++-----
external/bsd/dhcpcd/dist/dhcp-common.h | 55 ++++++++++++-----------
external/bsd/dhcpcd/dist/dhcp.c | 4 +-
external/bsd/dhcpcd/dist/dhcp6.c | 18 ++++---
external/bsd/dhcpcd/dist/dhcpcd-definitions.conf | 17 ++++++-
external/bsd/dhcpcd/dist/dhcpcd-embedded.c | 13 +++++-
external/bsd/dhcpcd/dist/dhcpcd-embedded.h | 4 +-
external/bsd/dhcpcd/dist/dhcpcd.c | 13 +---
external/bsd/dhcpcd/dist/dhcpcd.conf.5.in | 14 +++--
external/bsd/dhcpcd/dist/if-bsd.c | 9 ++-
external/bsd/dhcpcd/dist/if-options.c | 17 ++++++-
external/bsd/dhcpcd/dist/if.c | 26 +++++-----
external/bsd/dhcpcd/dist/if.h | 4 +-
external/bsd/dhcpcd/dist/ipv4ll.c | 28 ++++++++---
external/bsd/dhcpcd/dist/ipv6nd.c | 17 +++++-
19 files changed, 179 insertions(+), 110 deletions(-)
diffs (truncated from 761 to 300 lines):
diff -r e684f39e6766 -r b61b57b5549e external/bsd/dhcpcd/dist/arp.c
--- a/external/bsd/dhcpcd/dist/arp.c Wed Apr 20 08:50:43 2016 +0000
+++ b/external/bsd/dhcpcd/dist/arp.c Wed Apr 20 08:53:01 2016 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: arp.c,v 1.17 2016/04/10 21:00:53 roy Exp $");
+ __RCSID("$NetBSD: arp.c,v 1.18 2016/04/20 08:53:01 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -58,7 +58,7 @@
#define ARP_LEN \
(sizeof(struct arphdr) + (2 * sizeof(uint32_t)) + (2 * HWADDR_LEN))
-static ssize_t
+ssize_t
arp_request(const struct interface *ifp, in_addr_t sip, in_addr_t tip)
{
uint8_t arp_buffer[ARP_LEN];
diff -r e684f39e6766 -r b61b57b5549e external/bsd/dhcpcd/dist/arp.h
--- a/external/bsd/dhcpcd/dist/arp.h Wed Apr 20 08:50:43 2016 +0000
+++ b/external/bsd/dhcpcd/dist/arp.h Wed Apr 20 08:53:01 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arp.h,v 1.11 2015/07/09 10:15:34 roy Exp $ */
+/* $NetBSD: arp.h,v 1.12 2016/04/20 08:53:01 roy Exp $ */
/*
* dhcpcd - DHCP client daemon
@@ -79,6 +79,7 @@
((const struct iarp_state *)(ifp)->if_data[IF_DATA_ARP])
#ifdef INET
+ssize_t arp_request(const struct interface *, in_addr_t, in_addr_t);
void arp_report_conflicted(const struct arp_state *, const struct arp_msg *);
void arp_announce(struct arp_state *);
void arp_probe(struct arp_state *);
diff -r e684f39e6766 -r b61b57b5549e external/bsd/dhcpcd/dist/control.c
--- a/external/bsd/dhcpcd/dist/control.c Wed Apr 20 08:50:43 2016 +0000
+++ b/external/bsd/dhcpcd/dist/control.c Wed Apr 20 08:53:01 2016 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: control.c,v 1.11 2016/04/10 21:00:53 roy Exp $");
+ __RCSID("$NetBSD: control.c,v 1.12 2016/04/20 08:53:01 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -211,7 +211,7 @@
int fd;
#define SOCK_FLAGS SOCK_CLOEXEC | SOCK_NONBLOCK
- if ((fd = xsocket(AF_UNIX, SOCK_STREAM, 0, SOCK_FLAGS)) == -1)
+ if ((fd = xsocket(AF_UNIX, SOCK_STREAM | SOCK_FLAGS, 0)) == -1)
return -1;
#undef SOCK_FLAGS
memset(sa, 0, sizeof(*sa));
diff -r e684f39e6766 -r b61b57b5549e external/bsd/dhcpcd/dist/defs.h
--- a/external/bsd/dhcpcd/dist/defs.h Wed Apr 20 08:50:43 2016 +0000
+++ b/external/bsd/dhcpcd/dist/defs.h Wed Apr 20 08:53:01 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.25 2016/04/10 21:00:53 roy Exp $ */
+/* $NetBSD: defs.h,v 1.26 2016/04/20 08:53:01 roy Exp $ */
/*
* dhcpcd - DHCP client daemon
@@ -30,7 +30,7 @@
#define CONFIG_H
#define PACKAGE "dhcpcd"
-#define VERSION "6.10.2"
+#define VERSION "6.10.3"
#ifndef CONFIG
# define CONFIG SYSCONFDIR "/" PACKAGE ".conf"
diff -r e684f39e6766 -r b61b57b5549e external/bsd/dhcpcd/dist/dhcp-common.c
--- a/external/bsd/dhcpcd/dist/dhcp-common.c Wed Apr 20 08:50:43 2016 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp-common.c Wed Apr 20 08:53:01 2016 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: dhcp-common.c,v 1.13 2016/04/10 21:00:53 roy Exp $");
+ __RCSID("$NetBSD: dhcp-common.c,v 1.14 2016/04/20 08:53:01 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -103,15 +103,17 @@
if (opt->type & ARRAY)
printf(" array");
if (opt->type & UINT8)
- printf(" byte");
+ printf(" uint8");
+ else if (opt->type & INT8)
+ printf(" int8");
else if (opt->type & UINT16)
printf(" uint16");
- else if (opt->type & SINT16)
- printf(" sint16");
+ else if (opt->type & INT16)
+ printf(" int16");
else if (opt->type & UINT32)
printf(" uint32");
- else if (opt->type & SINT32)
- printf(" sint32");
+ else if (opt->type & INT32)
+ printf(" int32");
else if (opt->type & ADDRIPV4)
printf(" ipaddress");
else if (opt->type & ADDRIPV6)
@@ -208,6 +210,8 @@
continue;
match = 0;
for (i = 0, opt = odopts; i < odopts_len; i++, opt++) {
+ if (opt->var == NULL && opt->option == 0)
+ continue; /* buggy dhcpcd-definitions.conf */
if (strcmp(opt->var, token) == 0)
match = 1;
else {
@@ -590,11 +594,11 @@
if (opt->type & ADDRIPV6)
sz = ADDR6SZ;
- else if (opt->type & (UINT32 | ADDRIPV4))
+ else if (opt->type & (INT32 | UINT32 | ADDRIPV4))
sz = sizeof(uint32_t);
- else if (opt->type & UINT16)
+ else if (opt->type & (INT16 | UINT16))
sz = sizeof(uint16_t);
- else if (opt->type & (UINT8 | BITFLAG))
+ else if (opt->type & (INT8 | UINT8 | BITFLAG))
sz = sizeof(uint8_t);
else if (opt->type & FLAG)
return 0;
@@ -733,16 +737,18 @@
if (!s) {
if (opt->type & UINT8)
l = 3;
+ else if (opt->type & INT8)
+ l = 4;
else if (opt->type & UINT16) {
l = 5;
dl /= 2;
- } else if (opt->type & SINT16) {
+ } else if (opt->type & INT16) {
l = 6;
dl /= 2;
} else if (opt->type & UINT32) {
l = 10;
dl /= 4;
- } else if (opt->type & SINT32) {
+ } else if (opt->type & INT32) {
l = 11;
dl /= 4;
} else if (opt->type & ADDRIPV4) {
@@ -779,12 +785,15 @@
if (opt->type & UINT8) {
sl = snprintf(s, len, "%u", *data);
data++;
+ } else if (opt->type & INT8) {
+ sl = snprintf(s, len, "%d", *data);
+ data++;
} else if (opt->type & UINT16) {
memcpy(&u16, data, sizeof(u16));
u16 = ntohs(u16);
sl = snprintf(s, len, "%u", u16);
data += sizeof(u16);
- } else if (opt->type & SINT16) {
+ } else if (opt->type & INT16) {
memcpy(&u16, data, sizeof(u16));
s16 = (int16_t)ntohs(u16);
sl = snprintf(s, len, "%d", s16);
@@ -794,7 +803,7 @@
u32 = ntohl(u32);
sl = snprintf(s, len, "%u", u32);
data += sizeof(u32);
- } else if (opt->type & SINT32) {
+ } else if (opt->type & INT32) {
memcpy(&u32, data, sizeof(u32));
s32 = (int32_t)ntohl(u32);
sl = snprintf(s, len, "%d", s32);
diff -r e684f39e6766 -r b61b57b5549e external/bsd/dhcpcd/dist/dhcp-common.h
--- a/external/bsd/dhcpcd/dist/dhcp-common.h Wed Apr 20 08:50:43 2016 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp-common.h Wed Apr 20 08:53:01 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dhcp-common.h,v 1.11 2015/11/30 16:33:00 roy Exp $ */
+/* $NetBSD: dhcp-common.h,v 1.12 2016/04/20 08:53:01 roy Exp $ */
/*
* dhcpcd - DHCP client daemon
@@ -44,32 +44,33 @@
#define REQUEST (1 << 0)
#define UINT8 (1 << 1)
-#define UINT16 (1 << 2)
-#define SINT16 (1 << 3)
-#define UINT32 (1 << 4)
-#define SINT32 (1 << 5)
-#define ADDRIPV4 (1 << 6)
-#define STRING (1 << 7)
-#define ARRAY (1 << 8)
-#define RFC3361 (1 << 9)
-#define RFC1035 (1 << 10)
-#define RFC3442 (1 << 11)
-#define OPTIONAL (1 << 12)
-#define ADDRIPV6 (1 << 13)
-#define BINHEX (1 << 14)
-#define FLAG (1 << 15)
-#define NOREQ (1 << 16)
-#define EMBED (1 << 17)
-#define ENCAP (1 << 18)
-#define INDEX (1 << 19)
-#define OPTION (1 << 20)
-#define DOMAIN (1 << 21)
-#define ASCII (1 << 22)
-#define RAW (1 << 23)
-#define ESCSTRING (1 << 24)
-#define ESCFILE (1 << 25)
-#define BITFLAG (1 << 26)
-#define RESERVED (1 << 27)
+#define INT8 (1 << 2)
+#define UINT16 (1 << 3)
+#define INT16 (1 << 4)
+#define UINT32 (1 << 5)
+#define INT32 (1 << 6)
+#define ADDRIPV4 (1 << 7)
+#define STRING (1 << 8)
+#define ARRAY (1 << 9)
+#define RFC3361 (1 << 10)
+#define RFC1035 (1 << 11)
+#define RFC3442 (1 << 12)
+#define OPTIONAL (1 << 13)
+#define ADDRIPV6 (1 << 14)
+#define BINHEX (1 << 15)
+#define FLAG (1 << 16)
+#define NOREQ (1 << 17)
+#define EMBED (1 << 18)
+#define ENCAP (1 << 19)
+#define INDEX (1 << 20)
+#define OPTION (1 << 21)
+#define DOMAIN (1 << 22)
+#define ASCII (1 << 23)
+#define RAW (1 << 24)
+#define ESCSTRING (1 << 25)
+#define ESCFILE (1 << 26)
+#define BITFLAG (1 << 27)
+#define RESERVED (1 << 28)
struct dhcp_opt {
uint32_t option; /* Also used for IANA Enterpise Number */
diff -r e684f39e6766 -r b61b57b5549e external/bsd/dhcpcd/dist/dhcp.c
--- a/external/bsd/dhcpcd/dist/dhcp.c Wed Apr 20 08:50:43 2016 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp.c Wed Apr 20 08:53:01 2016 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: dhcp.c,v 1.38 2016/04/10 21:00:53 roy Exp $");
+ __RCSID("$NetBSD: dhcp.c,v 1.39 2016/04/20 08:53:01 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -1492,7 +1492,7 @@
char *p;
#endif
- if ((s = xsocket(PF_INET, SOCK_DGRAM, IPPROTO_UDP, SOCK_CLOEXEC)) == -1)
+ if ((s = xsocket(PF_INET, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP)) == -1)
return -1;
n = 1;
diff -r e684f39e6766 -r b61b57b5549e external/bsd/dhcpcd/dist/dhcp6.c
--- a/external/bsd/dhcpcd/dist/dhcp6.c Wed Apr 20 08:50:43 2016 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp6.c Wed Apr 20 08:53:01 2016 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: dhcp6.c,v 1.19 2016/04/10 21:00:53 roy Exp $");
+ __RCSID("$NetBSD: dhcp6.c,v 1.20 2016/04/20 08:53:01 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -440,7 +440,7 @@
else {
asla.prefix_len = (uint8_t)(prefix->prefix_len + bits);
- /* Make a 64 prefix by default, as this maks SLAAC
+ /* Make a 64 prefix by default, as this makes SLAAC
* possible.
* Otherwise round up to the nearest 4 bits. */
if (asla.prefix_len <= 64)
@@ -458,7 +458,9 @@
prefix->prefix_len);
}
- if (ipv6_userprefix(&prefix->prefix, prefix->prefix_len,
+ if (sla->sla == 0) {
+ *addr = prefix->prefix;
+ } else if (ipv6_userprefix(&prefix->prefix, prefix->prefix_len,
sla->sla, addr, sla->prefix_len) == -1)
{
sa = inet_ntop(AF_INET6, &prefix->prefix,
@@ -2392,6 +2394,11 @@
a->prefix = addr;
a->prefix_len = (uint8_t)pfxlen;
+ /* If sla is zero and the prefix length hasn't changed,
Home |
Main Index |
Thread Index |
Old Index