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.5 with the follow...
details: https://anonhg.NetBSD.org/src/rev/129f8c9e8987
branches: trunk
changeset: 802509:129f8c9e8987
user: roy <roy%NetBSD.org@localhost>
date: Thu Sep 18 20:43:55 2014 +0000
description:
Import dhcpcd-6.4.5 with the following changes:
* Remove all instances of if_indextoname as we already know the index
* Check we have allocated IPv6 resources before checkings RA's
diffstat:
external/bsd/dhcpcd/dist/defs.h | 4 ++--
external/bsd/dhcpcd/dist/dhcp6.c | 10 +++-------
external/bsd/dhcpcd/dist/if.c | 23 +++++++++++++++++++----
external/bsd/dhcpcd/dist/if.h | 5 +++--
external/bsd/dhcpcd/dist/ipv6.h | 4 ++--
5 files changed, 29 insertions(+), 17 deletions(-)
diffs (145 lines):
diff -r ccb56efd0aa7 -r 129f8c9e8987 external/bsd/dhcpcd/dist/defs.h
--- a/external/bsd/dhcpcd/dist/defs.h Thu Sep 18 19:45:24 2014 +0000
+++ b/external/bsd/dhcpcd/dist/defs.h Thu Sep 18 20:43:55 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.1.1.42 2014/09/16 22:23:21 roy Exp $ */
+/* $NetBSD: defs.h,v 1.1.1.43 2014/09/18 20:43:58 roy Exp $ */
/*
* dhcpcd - DHCP client daemon
@@ -30,7 +30,7 @@
#define CONFIG_H
#define PACKAGE "dhcpcd"
-#define VERSION "6.4.4"
+#define VERSION "6.4.5"
#ifndef CONFIG
# define CONFIG SYSCONFDIR "/" PACKAGE ".conf"
diff -r ccb56efd0aa7 -r 129f8c9e8987 external/bsd/dhcpcd/dist/dhcp6.c
--- a/external/bsd/dhcpcd/dist/dhcp6.c Thu Sep 18 19:45:24 2014 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp6.c Thu Sep 18 20:43:55 2014 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: dhcp6.c,v 1.1.1.14 2014/09/16 22:23:19 roy Exp $");
+ __RCSID("$NetBSD: dhcp6.c,v 1.1.1.15 2014/09/18 20:43:56 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -34,10 +34,6 @@
#include <sys/utsname.h>
#include <netinet/in.h>
-#ifdef __linux__
-# define _LINUX_IN6_H
-# include <linux/ipv6.h>
-#endif
#include <ctype.h>
#include <errno.h>
@@ -1056,8 +1052,8 @@
ctx = ifp->ctx->ipv6;
dst.sin6_scope_id = ifp->index;
- ctx->sndhdr.msg_name = (caddr_t)&dst;
- ctx->sndhdr.msg_iov[0].iov_base = (caddr_t)state->send;
+ ctx->sndhdr.msg_name = (void *)&dst;
+ ctx->sndhdr.msg_iov[0].iov_base = state->send;
ctx->sndhdr.msg_iov[0].iov_len = state->send_len;
/* Set the outbound interface */
diff -r ccb56efd0aa7 -r 129f8c9e8987 external/bsd/dhcpcd/dist/if.c
--- a/external/bsd/dhcpcd/dist/if.c Thu Sep 18 19:45:24 2014 +0000
+++ b/external/bsd/dhcpcd/dist/if.c Thu Sep 18 20:43:55 2014 +0000
@@ -1,5 +1,5 @@
#include <sys/cdefs.h>
- __RCSID("$NetBSD: if.c,v 1.1.1.4 2014/09/16 22:23:18 roy Exp $");
+ __RCSID("$NetBSD: if.c,v 1.1.1.5 2014/09/18 20:43:55 roy Exp $");
/*
* dhcpcd - DHCP client daemon
@@ -481,8 +481,8 @@
return ifs;
}
-struct interface *
-if_find(struct dhcpcd_ctx *ctx, const char *ifname)
+static struct interface *
+if_findindexname(struct dhcpcd_ctx *ctx, unsigned int idx, const char *name)
{
struct interface *ifp;
@@ -490,13 +490,28 @@
TAILQ_FOREACH(ifp, ctx->ifaces, next) {
if ((ifp->options == NULL ||
!(ifp->options->options & DHCPCD_PFXDLGONLY)) &&
- strcmp(ifp->name, ifname) == 0)
+ ((name && strcmp(ifp->name, name) == 0) ||
+ (!name && ifp->index == idx)))
return ifp;
}
}
return NULL;
}
+struct interface *
+if_find(struct dhcpcd_ctx *ctx, const char *name)
+{
+
+ return if_findindexname(ctx, 0, name);
+}
+
+struct interface *
+if_findindex(struct dhcpcd_ctx *ctx, unsigned int idx)
+{
+
+ return if_findindexname(ctx, idx, NULL);
+}
+
int
if_domtu(const char *ifname, short int mtu)
{
diff -r ccb56efd0aa7 -r 129f8c9e8987 external/bsd/dhcpcd/dist/if.h
--- a/external/bsd/dhcpcd/dist/if.h Thu Sep 18 19:45:24 2014 +0000
+++ b/external/bsd/dhcpcd/dist/if.h Thu Sep 18 20:43:55 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.h,v 1.1.1.4 2014/09/16 22:23:21 roy Exp $ */
+/* $NetBSD: if.h,v 1.1.1.5 2014/09/18 20:43:58 roy Exp $ */
/*
* dhcpcd - DHCP client daemon
@@ -96,6 +96,7 @@
#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 *);
+struct interface *if_findindex(struct dhcpcd_ctx *, unsigned int);
void if_free(struct interface *);
int if_domtu(const char *, short int);
#define if_getmtu(iface) if_domtu(iface, 0)
@@ -133,7 +134,7 @@
#endif
#ifdef INET6
-int if_checkipv6(struct dhcpcd_ctx *ctx, const char *, int);
+int if_checkipv6(struct dhcpcd_ctx *ctx, const struct interface *, int);
int if_nd6reachable(const char *ifname, struct in6_addr *addr);
int if_address6(const struct ipv6_addr *, int);
diff -r ccb56efd0aa7 -r 129f8c9e8987 external/bsd/dhcpcd/dist/ipv6.h
--- a/external/bsd/dhcpcd/dist/ipv6.h Thu Sep 18 19:45:24 2014 +0000
+++ b/external/bsd/dhcpcd/dist/ipv6.h Thu Sep 18 20:43:55 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipv6.h,v 1.1.1.10 2014/07/14 11:45:06 roy Exp $ */
+/* $NetBSD: ipv6.h,v 1.1.1.11 2014/09/18 20:43:58 roy Exp $ */
/*
* dhcpcd - DHCP client daemon
@@ -35,7 +35,7 @@
#include <netinet/in.h>
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__)
# define _LINUX_IN6_H
# include <linux/ipv6.h>
#endif
Home |
Main Index |
Thread Index |
Old Index