update buildroot to 2017.02.11
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
bind cross compile support integration
|
||||
|
||||
Pass system types from dhcp configure to bind configure.
|
||||
|
||||
This patch is submitted upstream as part of a cross compiling enhancement
|
||||
suggestion to dhcp-suggest@isc.org. Reference ISC-Bugs #41502.
|
||||
|
||||
Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
|
||||
|
||||
Index: dhcp-4.3.3-P1/bind/Makefile.in
|
||||
===================================================================
|
||||
--- dhcp-4.3.3-P1.orig/bind/Makefile.in
|
||||
+++ dhcp-4.3.3-P1/bind/Makefile.in
|
||||
@@ -30,7 +30,9 @@ bindconfig = --disable-kqueue --disable-
|
||||
--without-openssl --without-libxml2 --enable-exportlib \
|
||||
--with-gssapi=no --enable-threads=no @BINDCONFIG@ \
|
||||
--with-export-includedir=${binddir}/include \
|
||||
- --with-export-libdir=${binddir}/lib
|
||||
+ --with-export-libdir=${binddir}/lib \
|
||||
+ --target=@target_alias@ --host=@host_alias@ \
|
||||
+ --build=@build_alias@
|
||||
|
||||
@BIND_ATF_FALSE@cleandirs = ./lib ./include
|
||||
@BIND_ATF_TRUE@cleandirs = ./lib ./include ./atf
|
||||
@@ -0,0 +1,51 @@
|
||||
From 5097bc0559f592683faac1f67bf350e1bddf6ed4 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Markwalder <tmark@isc.org>
|
||||
Date: Thu, 7 Dec 2017 11:39:30 -0500
|
||||
Subject: [PATCH] [v4_3] Plugs a socket descriptor leak in OMAPI
|
||||
|
||||
Merges in rt46767.
|
||||
|
||||
[baruch: drop RELNOTES hunk]
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
---
|
||||
Patch status: upstream commit 5097bc0559f
|
||||
|
||||
omapip/buffer.c | 9 +++++++++
|
||||
omapip/message.c | 2 +-
|
||||
|
||||
diff --git a/omapip/buffer.c b/omapip/buffer.c
|
||||
index f7fdc3250e82..809034d1317b 100644
|
||||
--- a/omapip/buffer.c
|
||||
+++ b/omapip/buffer.c
|
||||
@@ -566,6 +566,15 @@ isc_result_t omapi_connection_writer (omapi_object_t *h)
|
||||
omapi_buffer_dereference (&buffer, MDL);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ /* If we had data left to write when we're told to disconnect,
|
||||
+ * we need recall disconnect, now that we're done writing.
|
||||
+ * See rt46767. */
|
||||
+ if (c->out_bytes == 0 && c->state == omapi_connection_disconnecting) {
|
||||
+ omapi_disconnect (h, 1);
|
||||
+ return ISC_R_SHUTTINGDOWN;
|
||||
+ }
|
||||
+
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
diff --git a/omapip/message.c b/omapip/message.c
|
||||
index 59ccdc2c05cf..21bcfc3822e7 100644
|
||||
--- a/omapip/message.c
|
||||
+++ b/omapip/message.c
|
||||
@@ -339,7 +339,7 @@ isc_result_t omapi_message_unregister (omapi_object_t *mo)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_PROTOCOL
|
||||
-static const char *omapi_message_op_name(int op) {
|
||||
+const char *omapi_message_op_name(int op) {
|
||||
switch (op) {
|
||||
case OMAPI_OP_OPEN: return "OMAPI_OP_OPEN";
|
||||
case OMAPI_OP_REFRESH: return "OMAPI_OP_REFRESH";
|
||||
--
|
||||
2.15.1
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
From b8c29336bd5401a5f962bc6ddfa4ebb6f0274f3c Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Markwalder <tmark@isc.org>
|
||||
Date: Sat, 10 Feb 2018 12:15:27 -0500
|
||||
Subject: [PATCH 1/2] Correct buffer overrun in pretty_print_option
|
||||
|
||||
Merges in rt47139.
|
||||
|
||||
[baruch: drop RELNOTES and test; address CVE-2018-5732]
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
---
|
||||
Upstream status: backported from commit c5931725b48
|
||||
---
|
||||
common/options.c | 15 ++++++++++++---
|
||||
1 file changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/common/options.c b/common/options.c
|
||||
index 5547287fb6e5..2ed6b16c6412 100644
|
||||
--- a/common/options.c
|
||||
+++ b/common/options.c
|
||||
@@ -1758,7 +1758,8 @@ format_min_length(format, oc)
|
||||
|
||||
|
||||
/* Format the specified option so that a human can easily read it. */
|
||||
-
|
||||
+/* Maximum pretty printed size */
|
||||
+#define MAX_OUTPUT_SIZE 32*1024
|
||||
const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
|
||||
struct option *option;
|
||||
const unsigned char *data;
|
||||
@@ -1766,8 +1767,9 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
|
||||
int emit_commas;
|
||||
int emit_quotes;
|
||||
{
|
||||
- static char optbuf [32768]; /* XXX */
|
||||
- static char *endbuf = &optbuf[sizeof(optbuf)];
|
||||
+ /* We add 128 byte pad so we don't have to add checks everywhere. */
|
||||
+ static char optbuf [MAX_OUTPUT_SIZE + 128]; /* XXX */
|
||||
+ static char *endbuf = optbuf + MAX_OUTPUT_SIZE;
|
||||
int hunksize = 0;
|
||||
int opthunk = 0;
|
||||
int hunkinc = 0;
|
||||
@@ -2193,7 +2195,14 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
|
||||
log_error ("Unexpected format code %c",
|
||||
fmtbuf [j]);
|
||||
}
|
||||
+
|
||||
op += strlen (op);
|
||||
+ if (op >= endbuf) {
|
||||
+ log_error ("Option data exceeds"
|
||||
+ " maximum size %d", MAX_OUTPUT_SIZE);
|
||||
+ return ("<error>");
|
||||
+ }
|
||||
+
|
||||
if (dp == data + len)
|
||||
break;
|
||||
if (j + 1 < numelem && comma != ':')
|
||||
--
|
||||
2.16.1
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 93b5b67dd31b9efcbfaabc2df1e1d9d164a5e04a Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Markwalder <tmark@isc.org>
|
||||
Date: Fri, 9 Feb 2018 14:46:08 -0500
|
||||
Subject: [PATCH 2/2] Corrected refcnt loss in option parsing
|
||||
|
||||
Merges in 47140.
|
||||
|
||||
[baruch: drop RELNOTES and tests; address CVE-2018-5733]
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
---
|
||||
Upstream status: backported from commit 197b26f25309
|
||||
---
|
||||
common/options.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/common/options.c b/common/options.c
|
||||
index 2ed6b16c6412..25b29a6be7bb 100644
|
||||
--- a/common/options.c
|
||||
+++ b/common/options.c
|
||||
@@ -3,7 +3,7 @@
|
||||
DHCP options parsing and reassembly. */
|
||||
|
||||
/*
|
||||
- * Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
|
||||
+ * Copyright (c) 2004-2018 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1995-2003 by Internet Software Consortium
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -177,6 +177,8 @@ int parse_option_buffer (options, buffer, length, universe)
|
||||
|
||||
/* If the length is outrageous, the options are bad. */
|
||||
if (offset + len > length) {
|
||||
+ /* Avoid reference count overflow */
|
||||
+ option_dereference(&option, MDL);
|
||||
reason = "option length exceeds option buffer length";
|
||||
bogus:
|
||||
log_error("parse_option_buffer: malformed option "
|
||||
--
|
||||
2.16.1
|
||||
|
||||
36
bsp/buildroot-2017.02.11/package/dhcp/Config.in
Normal file
36
bsp/buildroot-2017.02.11/package/dhcp/Config.in
Normal file
@@ -0,0 +1,36 @@
|
||||
config BR2_PACKAGE_DHCP
|
||||
bool "dhcp (ISC)"
|
||||
# fork()
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
|
||||
help
|
||||
DHCP relay agent from the ISC DHCP distribution.
|
||||
|
||||
http://www.isc.org/products/DHCP
|
||||
|
||||
if BR2_PACKAGE_DHCP
|
||||
|
||||
config BR2_PACKAGE_DHCP_SERVER
|
||||
bool "dhcp server"
|
||||
select BR2_PACKAGE_SYSTEMD_TMPFILES if BR2_PACKAGE_SYSTEMD
|
||||
help
|
||||
DHCP server from the ISC DHCP distribution.
|
||||
|
||||
config BR2_PACKAGE_DHCP_SERVER_DELAYED_ACK
|
||||
bool "Enable delayed ACK feature"
|
||||
depends on BR2_PACKAGE_DHCP_SERVER
|
||||
help
|
||||
Enable delayed ACK feature in the ISC DHCP server.
|
||||
|
||||
config BR2_PACKAGE_DHCP_RELAY
|
||||
bool "dhcp relay"
|
||||
help
|
||||
DHCP relay agent from the ISC DHCP distribution.
|
||||
|
||||
|
||||
config BR2_PACKAGE_DHCP_CLIENT
|
||||
bool "dhcp client"
|
||||
help
|
||||
DHCP client from the ISC DHCP distribution.
|
||||
|
||||
endif
|
||||
53
bsp/buildroot-2017.02.11/package/dhcp/S80dhcp-relay
Executable file
53
bsp/buildroot-2017.02.11/package/dhcp/S80dhcp-relay
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
|
||||
#
|
||||
|
||||
# What servers should the DHCP relay forward requests to?
|
||||
# e.g: SERVERS="192.168.0.1"
|
||||
SERVERS=""
|
||||
|
||||
# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
|
||||
INTERFACES=""
|
||||
|
||||
# Additional options that are passed to the DHCP relay daemon?
|
||||
OPTIONS=""
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
CFG_FILE="/etc/default/dhcrelay"
|
||||
[ -r "${CFG_FILE}" ] && . "${CFG_FILE}"
|
||||
|
||||
# Sanity checks
|
||||
test -f /usr/sbin/dhcrelay || exit 0
|
||||
test -n "$INTERFACES" || exit 0
|
||||
test -n "$SERVERS" || exit 0
|
||||
|
||||
# Build command line for interfaces (will be passed to dhrelay below.)
|
||||
IFCMD=""
|
||||
for I in $INTERFACES; do
|
||||
IFCMD=${IFCMD}"-i "${I}" "
|
||||
done
|
||||
|
||||
DHCRELAYPID=/var/run/dhcrelay.pid
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting DHCP relay: "
|
||||
start-stop-daemon -S -q -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping DHCP relay: "
|
||||
start-stop-daemon -K -q -x /usr/sbin/dhcrelay
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
restart | force-reload)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|force-reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
49
bsp/buildroot-2017.02.11/package/dhcp/S80dhcp-server
Executable file
49
bsp/buildroot-2017.02.11/package/dhcp/S80dhcp-server
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
|
||||
#
|
||||
|
||||
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
|
||||
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
|
||||
INTERFACES=""
|
||||
|
||||
# Additional options that are passed to the DHCP server daemon?
|
||||
OPTIONS=""
|
||||
|
||||
NAME="dhcpd"
|
||||
DAEMON="/usr/sbin/${NAME}"
|
||||
CFG_FILE="/etc/default/${NAME}"
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r "${CFG_FILE}" ] && . "${CFG_FILE}"
|
||||
|
||||
# Sanity checks
|
||||
test -f /usr/sbin/dhcpd || exit 0
|
||||
test -f /etc/dhcp/dhcpd.conf || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting DHCP server: "
|
||||
test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
|
||||
test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
|
||||
start-stop-daemon -S -q -x ${DAEMON} -- -q $OPTIONS $INTERFACES
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping DHCP server: "
|
||||
start-stop-daemon -K -q -x ${DAEMON}
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
restart | force-reload)
|
||||
$0 stop
|
||||
$0 start
|
||||
if [ "$?" != "0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|force-reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
284
bsp/buildroot-2017.02.11/package/dhcp/dhclient-script
Executable file
284
bsp/buildroot-2017.02.11/package/dhcp/dhclient-script
Executable file
@@ -0,0 +1,284 @@
|
||||
#!/bin/sh
|
||||
|
||||
# dhclient-script from OpenWRT project
|
||||
# http://git.openwrt.org/?p=packages.git;a=blob;f=net/isc-dhcp/files/dhclient-script;h=4afebc0ad20ebac51c5baae5ed01c6713e3a0fd0;hb=HEAD
|
||||
|
||||
make_resolv_conf() {
|
||||
if [ x"$new_domain_name_servers" != x ]; then
|
||||
cat /dev/null > /etc/resolv.conf.dhclient
|
||||
chmod 644 /etc/resolv.conf.dhclient
|
||||
if [ x"$new_domain_search" != x ]; then
|
||||
echo search $new_domain_search >> /etc/resolv.conf.dhclient
|
||||
elif [ x"$new_domain_name" != x ]; then
|
||||
# Note that the DHCP 'Domain Name Option' is really just a domain
|
||||
# name, and that this practice of using the domain name option as
|
||||
# a search path is both nonstandard and deprecated.
|
||||
echo search $new_domain_name >> /etc/resolv.conf.dhclient
|
||||
fi
|
||||
for nameserver in $new_domain_name_servers; do
|
||||
echo nameserver $nameserver >>/etc/resolv.conf.dhclient
|
||||
done
|
||||
|
||||
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
|
||||
cat /dev/null > /etc/resolv.conf.dhclient6
|
||||
chmod 644 /etc/resolv.conf.dhclient6
|
||||
|
||||
if [ "x${new_dhcp6_domain_search}" != x ] ; then
|
||||
echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
|
||||
fi
|
||||
for nameserver in ${new_dhcp6_name_servers} ; do
|
||||
echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
|
||||
done
|
||||
fi
|
||||
|
||||
# if both v4 and v6 clients are running, concatenate results
|
||||
cat /etc/resolv.conf.* > /etc/resolv.conf
|
||||
}
|
||||
|
||||
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
|
||||
exit_with_hooks() {
|
||||
exit_status=$1
|
||||
if [ -f /etc/dhclient-exit-hooks ]; then
|
||||
. /etc/dhclient-exit-hooks
|
||||
fi
|
||||
# probably should do something with exit status of the local script
|
||||
exit $exit_status
|
||||
}
|
||||
|
||||
# Invoke the local dhcp client enter hooks, if they exist.
|
||||
if [ -f /etc/dhclient-enter-hooks ]; then
|
||||
exit_status=0
|
||||
. /etc/dhclient-enter-hooks
|
||||
# allow the local script to abort processing of this state
|
||||
# local script must set exit_status variable to nonzero.
|
||||
if [ $exit_status -ne 0 ]; then
|
||||
exit $exit_status
|
||||
fi
|
||||
fi
|
||||
|
||||
###
|
||||
### DHCPv4 Handlers
|
||||
###
|
||||
|
||||
if [ x$new_broadcast_address != x ]; then
|
||||
new_broadcast_arg="broadcast $new_broadcast_address"
|
||||
fi
|
||||
if [ x$new_subnet_mask != x ]; then
|
||||
new_subnet_arg="netmask $new_subnet_mask"
|
||||
fi
|
||||
if [ x$alias_subnet_mask != x ]; then
|
||||
alias_subnet_arg="netmask $alias_subnet_mask"
|
||||
fi
|
||||
|
||||
if [ x$reason = xMEDIUM ]; then
|
||||
# Linux doesn't do mediums (ok, ok, media).
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xPREINIT ]; then
|
||||
if [ x$alias_ip_address != x ]; then
|
||||
# Bring down alias interface. Its routes will disappear too.
|
||||
ifconfig $interface:0- 0.0.0.0
|
||||
fi
|
||||
ifconfig $interface 0.0.0.0 up
|
||||
|
||||
# We need to give the kernel some time to get the interface up.
|
||||
sleep 1
|
||||
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
||||
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
|
||||
current_hostname=`hostname`
|
||||
if [ x$current_hostname = x ] || \
|
||||
[ x$current_hostname = x$old_host_name ]; then
|
||||
if [ x$current_hostname = x ] || \
|
||||
[ x$new_host_name != x$old_host_name ]; then
|
||||
hostname $new_host_name
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
|
||||
[ x$alias_ip_address != x$old_ip_address ]; then
|
||||
# Possible new alias. Remove old alias.
|
||||
ifconfig $interface:0- 0.0.0.0
|
||||
fi
|
||||
if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
|
||||
# IP address changed. Bringing down the interface will delete all routes,
|
||||
# and clear the ARP cache.
|
||||
ifconfig $interface 0.0.0.0 down
|
||||
|
||||
fi
|
||||
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
|
||||
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
|
||||
|
||||
ifconfig $interface $new_ip_address $new_subnet_arg \
|
||||
$new_broadcast_arg
|
||||
for router in $new_routers; do
|
||||
if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
|
||||
route add -host $router dev $interface
|
||||
fi
|
||||
route add default gw $router
|
||||
done
|
||||
fi
|
||||
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
|
||||
then
|
||||
ifconfig $interface:0- 0.0.0.0
|
||||
ifconfig $interface:0 $alias_ip_address $alias_subnet_arg
|
||||
route add -host $alias_ip_address $interface:0
|
||||
fi
|
||||
make_resolv_conf
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
|
||||
|| [ x$reason = xSTOP ]; then
|
||||
if [ x$alias_ip_address != x ]; then
|
||||
# Turn off alias interface.
|
||||
ifconfig $interface:0- 0.0.0.0
|
||||
fi
|
||||
if [ x$old_ip_address != x ]; then
|
||||
# Shut down interface, which will delete routes and clear arp cache.
|
||||
ifconfig $interface 0.0.0.0 down
|
||||
fi
|
||||
if [ x$alias_ip_address != x ]; then
|
||||
ifconfig $interface:0 $alias_ip_address $alias_subnet_arg
|
||||
route add -host $alias_ip_address $interface:0
|
||||
fi
|
||||
|
||||
# remove v4 dns configuration for this interface
|
||||
rm /etc/resolv.conf.dhclient
|
||||
cat /etc/resolv.conf.* > /etc/resolv.conf
|
||||
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xTIMEOUT ]; then
|
||||
if [ x$alias_ip_address != x ]; then
|
||||
ifconfig $interface:0- 0.0.0.0
|
||||
fi
|
||||
ifconfig $interface $new_ip_address $new_subnet_arg \
|
||||
$new_broadcast_arg
|
||||
set $new_routers
|
||||
if ping -q -c 1 $1; then
|
||||
if [ x$new_ip_address != x$alias_ip_address ] && \
|
||||
[ x$alias_ip_address != x ]; then
|
||||
ifconfig $interface:0 $alias_ip_address $alias_subnet_arg
|
||||
route add -host $alias_ip_address dev $interface:0
|
||||
fi
|
||||
for router in $new_routers; do
|
||||
if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
|
||||
route add -host $router dev $interface
|
||||
fi
|
||||
route add default gw $router
|
||||
done
|
||||
make_resolv_conf
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
ifconfig $interface 0.0.0.0 down
|
||||
exit_with_hooks 1
|
||||
fi
|
||||
|
||||
###
|
||||
### DHCPv6 Handlers
|
||||
###
|
||||
|
||||
if [ x$reason = xPREINIT6 ]; then
|
||||
# Ensure interface is up.
|
||||
ifconfig ${interface} up
|
||||
|
||||
# Remove any stale addresses from aborted clients.
|
||||
ip -f inet6 addr flush dev ${interface} scope global
|
||||
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x${old_ip6_prefix} != x ] || [ x${new_ip6_prefix} != x ] ; then
|
||||
echo Prefix ${reason} old=${old_ip6_prefix} new=${new_ip6_prefix}
|
||||
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xBOUND6 ]; then
|
||||
if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then
|
||||
exit_with_hooks 2;
|
||||
fi
|
||||
|
||||
ifconfig ${interface} add ${new_ip6_address}/${new_ip6_prefixlen}
|
||||
|
||||
# Check for nameserver options.
|
||||
make_resolv_conf
|
||||
|
||||
### <<
|
||||
# Set up softwire tunnel
|
||||
if [ x${new_dhcp6_softwire} != x ] ; then
|
||||
/etc/init.d/dhclient stop
|
||||
ifconfig ${interface} 0.0.0.0
|
||||
ip -6 tunnel add tun0 mode ipip6 \
|
||||
remote ${new_dhcp6_softwire} \
|
||||
local ${new_ip6_address} \
|
||||
dev ${interface} encaplimit none
|
||||
ip link set tun0 up
|
||||
ip route add default dev tun0
|
||||
fi
|
||||
### >>
|
||||
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xRENEW6 ] || [ x$reason = xREBIND6 ]; then
|
||||
if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then
|
||||
exit_with_hooks 2;
|
||||
fi
|
||||
|
||||
ifconfig ${interface} add ${new_ip6_address}/${new_ip6_prefixlen}
|
||||
|
||||
# Make sure nothing has moved around on us.
|
||||
|
||||
# Nameservers/domains/etc.
|
||||
if [ "x${new_dhcp6_name_servers}" != "x${old_dhcp6_name_servers}" ] ||
|
||||
[ "x${new_dhcp6_domain_search}" != "x${old_dhcp6_domain_search}" ] ; then
|
||||
make_resolv_conf
|
||||
fi
|
||||
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xDEPREF6 ]; then
|
||||
if [ x${new_ip6_address} = x ] ; then
|
||||
exit_with_hooks 2;
|
||||
fi
|
||||
|
||||
# Busybox ifconfig has no way to communicate this to the kernel, so ignore it
|
||||
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xEXPIRE6 -o x$reason = xRELEASE6 -o x$reason = xSTOP6 ]; then
|
||||
if [ x${old_ip6_address} = x ] || [ x${old_ip6_prefixlen} = x ] ; then
|
||||
exit_with_hooks 2;
|
||||
fi
|
||||
|
||||
ifconfig ${interface} del ${old_ip6_address}/${old_ip6_prefixlen}
|
||||
|
||||
# remove v6 dns configuration for this interface
|
||||
rm /etc/resolv.conf.dhclient6
|
||||
cat /etc/resolv.conf.* > /etc/resolv.conf
|
||||
|
||||
### <<
|
||||
# Tear down softwire tunnel
|
||||
if [ x${old_dhcp6_softwire} != x ] ; then
|
||||
ip link set tun0 down
|
||||
ip tunnel del tun0
|
||||
fi
|
||||
### >>
|
||||
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
exit_with_hooks 0
|
||||
50
bsp/buildroot-2017.02.11/package/dhcp/dhclient.conf
Normal file
50
bsp/buildroot-2017.02.11/package/dhcp/dhclient.conf
Normal file
@@ -0,0 +1,50 @@
|
||||
# Configuration file for /sbin/dhclient, which is included in Debian's
|
||||
# dhcp3-client package.
|
||||
#
|
||||
# This is a sample configuration file for dhclient. See dhclient.conf's
|
||||
# man page for more information about the syntax of this file
|
||||
# and a more comprehensive list of the parameters understood by
|
||||
# dhclient.
|
||||
#
|
||||
# Normally, if the DHCP server provides reasonable information and does
|
||||
# not leave anything out (like the domain name, for example), then
|
||||
# few changes must be made to this file, if any.
|
||||
#
|
||||
|
||||
#send host-name "andare.fugue.com";
|
||||
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
|
||||
#send dhcp-lease-time 3600;
|
||||
#supersede domain-name "fugue.com home.vix.com";
|
||||
#prepend domain-name-servers 127.0.0.1;
|
||||
request subnet-mask, broadcast-address, time-offset, routers,
|
||||
domain-name, domain-name-servers, host-name,
|
||||
netbios-name-servers, netbios-scope;
|
||||
#require subnet-mask, domain-name-servers;
|
||||
#timeout 60;
|
||||
#retry 60;
|
||||
#reboot 10;
|
||||
#select-timeout 5;
|
||||
#initial-interval 2;
|
||||
#script "/etc/dhcp3/dhclient-script";
|
||||
#media "-link0 -link1 -link2", "link0 link1";
|
||||
#reject 192.33.137.209;
|
||||
|
||||
#alias {
|
||||
# interface "eth0";
|
||||
# fixed-address 192.5.5.213;
|
||||
# option subnet-mask 255.255.255.255;
|
||||
#}
|
||||
|
||||
#lease {
|
||||
# interface "eth0";
|
||||
# fixed-address 192.33.137.200;
|
||||
# medium "link0 link1";
|
||||
# option host-name "andare.swiftmedia.com";
|
||||
# option subnet-mask 255.255.255.0;
|
||||
# option broadcast-address 192.33.137.255;
|
||||
# option routers 192.33.137.250;
|
||||
# option domain-name-servers 127.0.0.1;
|
||||
# renew 2 2000/1/12 00:00:01;
|
||||
# rebind 2 2000/1/12 00:00:01;
|
||||
# expire 2 2000/1/12 00:00:01;
|
||||
#}
|
||||
4
bsp/buildroot-2017.02.11/package/dhcp/dhcp.hash
Normal file
4
bsp/buildroot-2017.02.11/package/dhcp/dhcp.hash
Normal file
@@ -0,0 +1,4 @@
|
||||
# Verified from https://ftp.isc.org/isc/dhcp/4.3.6/dhcp-4.3.6.tar.gz.sha256.asc
|
||||
sha256 a41eaf6364f1377fe065d35671d9cf82bbbc8f21207819b2b9f33f652aec6f1b dhcp-4.3.6.tar.gz
|
||||
# Locally calculated
|
||||
sha256 dd7ae2201c0c11c3c1e2510d731c67b2f4bc8ba735707d7348ddd65f7b598562 LICENSE
|
||||
121
bsp/buildroot-2017.02.11/package/dhcp/dhcp.mk
Normal file
121
bsp/buildroot-2017.02.11/package/dhcp/dhcp.mk
Normal file
@@ -0,0 +1,121 @@
|
||||
################################################################################
|
||||
#
|
||||
# dhcp
|
||||
#
|
||||
################################################################################
|
||||
|
||||
DHCP_VERSION = 4.3.6
|
||||
DHCP_SITE = http://ftp.isc.org/isc/dhcp/$(DHCP_VERSION)
|
||||
DHCP_INSTALL_STAGING = YES
|
||||
DHCP_LICENSE = ISC
|
||||
DHCP_LICENSE_FILES = LICENSE
|
||||
DHCP_CONF_ENV = \
|
||||
CPPFLAGS='-D_PATH_DHCPD_CONF=\"/etc/dhcp/dhcpd.conf\" \
|
||||
-D_PATH_DHCLIENT_CONF=\"/etc/dhcp/dhclient.conf\"' \
|
||||
CFLAGS='$(TARGET_CFLAGS) -DISC_CHECK_NONE=1'
|
||||
|
||||
DHCP_CONF_OPTS = \
|
||||
--with-randomdev=/dev/random \
|
||||
--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
|
||||
--with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \
|
||||
--with-cli-lease-file=/var/lib/dhcp/dhclient.leases \
|
||||
--with-cli6-lease-file=/var/lib/dhcp/dhclient6.leases \
|
||||
--with-srv-pid-file=/var/run/dhcpd.pid \
|
||||
--with-srv6-pid-file=/var/run/dhcpd6.pid \
|
||||
--with-cli-pid-file=/var/run/dhclient.pid \
|
||||
--with-cli6-pid-file=/var/run/dhclient6.pid \
|
||||
--with-relay-pid-file=/var/run/dhcrelay.pid \
|
||||
--with-relay6-pid-file=/var/run/dhcrelay6.pid
|
||||
|
||||
# The source for the bind libraries used by dhcp are embedded in the dhcp source
|
||||
# as a tar-ball. Extract the bind source to allow any patches to be applied
|
||||
# during the patch phase.
|
||||
define DHCP_EXTRACT_BIND
|
||||
cd $(@D)/bind; tar -xvf bind.tar.gz
|
||||
endef
|
||||
DHCP_POST_EXTRACT_HOOKS += DHCP_EXTRACT_BIND
|
||||
|
||||
# The patchset requires configure et.al. to be regenerated.
|
||||
DHCP_AUTORECONF = YES
|
||||
|
||||
# bind does not support parallel builds.
|
||||
DHCP_MAKE = $(MAKE1)
|
||||
|
||||
# bind configure is called via dhcp make instead of dhcp configure. The make env
|
||||
# needs extra values for bind configure.
|
||||
DHCP_MAKE_ENV = \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
BUILD_CC="$(HOSTCC)" \
|
||||
BUILD_CFLAGS="$(HOST_CFLAGS)" \
|
||||
BUILD_CPPFLAGS="$(HOST_CPPFLAGS)" \
|
||||
BUILD_LDFLAGS="$(HOST_LDFLAGS)"
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DHCP_SERVER_DELAYED_ACK),y)
|
||||
DHCP_CONF_OPTS += --enable-delayed-ack
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
|
||||
define DHCP_INSTALL_SERVER
|
||||
mkdir -p $(TARGET_DIR)/var/lib
|
||||
(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
|
||||
$(INSTALL) -m 0755 -D $(@D)/server/dhcpd $(TARGET_DIR)/usr/sbin/dhcpd
|
||||
$(INSTALL) -m 0644 -D package/dhcp/dhcpd.conf \
|
||||
$(TARGET_DIR)/etc/dhcp/dhcpd.conf
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DHCP_RELAY),y)
|
||||
define DHCP_INSTALL_RELAY
|
||||
mkdir -p $(TARGET_DIR)/var/lib
|
||||
(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
|
||||
$(INSTALL) -m 0755 -D $(DHCP_DIR)/relay/dhcrelay \
|
||||
$(TARGET_DIR)/usr/sbin/dhcrelay
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DHCP_CLIENT),y)
|
||||
define DHCP_INSTALL_CLIENT
|
||||
mkdir -p $(TARGET_DIR)/var/lib
|
||||
(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
|
||||
$(INSTALL) -m 0755 -D $(DHCP_DIR)/client/dhclient \
|
||||
$(TARGET_DIR)/sbin/dhclient
|
||||
$(INSTALL) -m 0644 -D package/dhcp/dhclient.conf \
|
||||
$(TARGET_DIR)/etc/dhcp/dhclient.conf
|
||||
$(INSTALL) -m 0755 -D package/dhcp/dhclient-script \
|
||||
$(TARGET_DIR)/sbin/dhclient-script
|
||||
endef
|
||||
endif
|
||||
|
||||
# Options don't matter, scripts won't start if binaries aren't there
|
||||
define DHCP_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 0755 -D package/dhcp/S80dhcp-server \
|
||||
$(TARGET_DIR)/etc/init.d/S80dhcp-server
|
||||
$(INSTALL) -m 0755 -D package/dhcp/S80dhcp-relay \
|
||||
$(TARGET_DIR)/etc/init.d/S80dhcp-relay
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
|
||||
define DHCP_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 644 package/dhcp/dhcpd.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/dhcpd.service
|
||||
|
||||
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
||||
|
||||
ln -sf ../../../../usr/lib/systemd/system/dhcpd.service \
|
||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dhcpd.service
|
||||
|
||||
mkdir -p $(TARGET_DIR)/usr/lib/tmpfiles.d
|
||||
echo "d /var/lib/dhcp 0755 - - - -" > \
|
||||
$(TARGET_DIR)/usr/lib/tmpfiles.d/dhcpd.conf
|
||||
echo "f /var/lib/dhcp/dhcpd.leases - - - - -" >> \
|
||||
$(TARGET_DIR)/usr/lib/tmpfiles.d/dhcpd.conf
|
||||
endef
|
||||
endif
|
||||
|
||||
define DHCP_INSTALL_TARGET_CMDS
|
||||
$(DHCP_INSTALL_RELAY)
|
||||
$(DHCP_INSTALL_SERVER)
|
||||
$(DHCP_INSTALL_CLIENT)
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
108
bsp/buildroot-2017.02.11/package/dhcp/dhcpd.conf
Normal file
108
bsp/buildroot-2017.02.11/package/dhcp/dhcpd.conf
Normal file
@@ -0,0 +1,108 @@
|
||||
#
|
||||
# Sample configuration file for ISC dhcpd for Debian
|
||||
#
|
||||
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
|
||||
#
|
||||
|
||||
# The ddns-updates-style parameter controls whether or not the server will
|
||||
# attempt to do a DNS update when a lease is confirmed. We default to the
|
||||
# behavior of the version 2 packages ('none', since DHCP v2 didn't
|
||||
# have support for DDNS.)
|
||||
ddns-update-style none;
|
||||
|
||||
# option definitions common to all supported networks...
|
||||
option domain-name "example.org";
|
||||
option domain-name-servers ns1.example.org, ns2.example.org;
|
||||
|
||||
default-lease-time 600;
|
||||
max-lease-time 7200;
|
||||
|
||||
# If this DHCP server is the official DHCP server for the local
|
||||
# network, the authoritative directive should be uncommented.
|
||||
#authoritative;
|
||||
|
||||
# Use this to send dhcp log messages to a different log file (you also
|
||||
# have to hack syslog.conf to complete the redirection).
|
||||
log-facility local7;
|
||||
|
||||
# No service will be given on this subnet, but declaring it helps the
|
||||
# DHCP server to understand the network topology.
|
||||
|
||||
#subnet 10.152.187.0 netmask 255.255.255.0 {
|
||||
#}
|
||||
|
||||
# This is a very basic subnet declaration.
|
||||
|
||||
#subnet 10.254.239.0 netmask 255.255.255.224 {
|
||||
# range 10.254.239.10 10.254.239.20;
|
||||
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
|
||||
#}
|
||||
|
||||
# This declaration allows BOOTP clients to get dynamic addresses,
|
||||
# which we don't really recommend.
|
||||
|
||||
#subnet 10.254.239.32 netmask 255.255.255.224 {
|
||||
# range dynamic-bootp 10.254.239.40 10.254.239.60;
|
||||
# option broadcast-address 10.254.239.31;
|
||||
# option routers rtr-239-32-1.example.org;
|
||||
#}
|
||||
|
||||
# A slightly different configuration for an internal subnet.
|
||||
#subnet 10.5.5.0 netmask 255.255.255.224 {
|
||||
# range 10.5.5.26 10.5.5.30;
|
||||
# option domain-name-servers ns1.internal.example.org;
|
||||
# option domain-name "internal.example.org";
|
||||
# option routers 10.5.5.1;
|
||||
# option broadcast-address 10.5.5.31;
|
||||
# default-lease-time 600;
|
||||
# max-lease-time 7200;
|
||||
#}
|
||||
|
||||
# Hosts which require special configuration options can be listed in
|
||||
# host statements. If no address is specified, the address will be
|
||||
# allocated dynamically (if possible), but the host-specific information
|
||||
# will still come from the host declaration.
|
||||
|
||||
#host passacaglia {
|
||||
# hardware ethernet 0:0:c0:5d:bd:95;
|
||||
# filename "vmunix.passacaglia";
|
||||
# server-name "toccata.fugue.com";
|
||||
#}
|
||||
|
||||
# Fixed IP addresses can also be specified for hosts. These addresses
|
||||
# should not also be listed as being available for dynamic assignment.
|
||||
# Hosts for which fixed IP addresses have been specified can boot using
|
||||
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
|
||||
# be booted with DHCP, unless there is an address range on the subnet
|
||||
# to which a BOOTP client is connected which has the dynamic-bootp flag
|
||||
# set.
|
||||
#host fantasia {
|
||||
# hardware ethernet 08:00:07:26:c0:a5;
|
||||
# fixed-address fantasia.fugue.com;
|
||||
#}
|
||||
|
||||
# You can declare a class of clients and then do address allocation
|
||||
# based on that. The example below shows a case where all clients
|
||||
# in a certain class get addresses on the 10.17.224/24 subnet, and all
|
||||
# other clients get addresses on the 10.0.29/24 subnet.
|
||||
|
||||
#class "foo" {
|
||||
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
|
||||
#}
|
||||
|
||||
#shared-network 224-29 {
|
||||
# subnet 10.17.224.0 netmask 255.255.255.0 {
|
||||
# option routers rtr-224.example.org;
|
||||
# }
|
||||
# subnet 10.0.29.0 netmask 255.255.255.0 {
|
||||
# option routers rtr-29.example.org;
|
||||
# }
|
||||
# pool {
|
||||
# allow members of "foo";
|
||||
# range 10.17.224.10 10.17.224.250;
|
||||
# }
|
||||
# pool {
|
||||
# deny members of "foo";
|
||||
# range 10.0.29.10 10.0.29.230;
|
||||
# }
|
||||
#}
|
||||
13
bsp/buildroot-2017.02.11/package/dhcp/dhcpd.service
Normal file
13
bsp/buildroot-2017.02.11/package/dhcp/dhcpd.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=DHCP server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/dhcpd.pid
|
||||
ExecStart=/usr/sbin/dhcpd -q -pf /run/dhcpd.pid $OPTIONS $INTERFACES
|
||||
KillSignal=SIGINT
|
||||
EnvironmentFile=-/etc/default/dhcpd
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user