Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/ROY]: src/external/bsd/dhcpcd/dist Import dhcpcd-7.0.1 with the followin...
details: https://anonhg.NetBSD.org/src/rev/b6157bd621ac
branches: ROY
changeset: 455206:b6157bd621ac
user: roy <roy%NetBSD.org@localhost>
date: Mon Jan 29 11:11:22 2018 +0000
description:
Import dhcpcd-7.0.1 with the following changes:
* hooks: remove use of local builtin for better portability
* dhcpcd: don't log errors working out carrier for departed interfaces
* ipv4: allow configuration of static broadcast address
* if: don't set MTU during interface discovery
* if: don't activate non matching interfaces to commandline ones
* eloop-bench: fix hangs when using a large number of cycles
* dhcp: don't bind when we've just probed an address to inform
diffstat:
external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant | 8 --
external/bsd/dhcpcd/dist/hooks/15-timezone | 3 +-
external/bsd/dhcpcd/dist/hooks/20-resolv.conf | 8 +-
external/bsd/dhcpcd/dist/hooks/29-lookup-hostname | 1 -
external/bsd/dhcpcd/dist/hooks/30-hostname | 30 +++----
external/bsd/dhcpcd/dist/hooks/50-ntp.conf | 6 +-
external/bsd/dhcpcd/dist/hooks/50-ypbind.in | 11 +-
external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in | 36 +++------
external/bsd/dhcpcd/dist/src/common.h | 9 --
external/bsd/dhcpcd/dist/src/defs.h | 2 +-
external/bsd/dhcpcd/dist/src/dhcp.c | 9 +-
external/bsd/dhcpcd/dist/src/dhcpcd.8.in | 6 +-
external/bsd/dhcpcd/dist/src/dhcpcd.c | 80 +++++++--------------
external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in | 9 +-
external/bsd/dhcpcd/dist/src/if-options.c | 22 +++++-
external/bsd/dhcpcd/dist/src/if-options.h | 1 +
external/bsd/dhcpcd/dist/src/if.c | 18 +---
external/bsd/dhcpcd/dist/src/logerr.h | 2 +-
18 files changed, 109 insertions(+), 152 deletions(-)
diffs (truncated from 776 to 300 lines):
diff -r 68cced455bb4 -r b6157bd621ac external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
--- a/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant Mon Jan 01 11:48:51 2018 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant Mon Jan 29 11:11:22 2018 +0000
@@ -20,8 +20,6 @@
wpa_supplicant_ctrldir()
{
- local dir
-
dir=$(key_get_value "[[:space:]]*ctrl_interface=" \
"$wpa_supplicant_conf")
dir=$(trim "$dir")
@@ -37,8 +35,6 @@
wpa_supplicant_start()
{
- local dir err errn
-
# If the carrier is up, don't bother checking anything
[ "$ifcarrier" = "up" ] && return 0
@@ -72,8 +68,6 @@
wpa_supplicant_reconfigure()
{
- local dir err errn
-
dir=$(wpa_supplicant_ctrldir)
[ -z "$dir" ] && return 1
if ! wpa_cli -p "$dir" -i "$interface" status >/dev/null 2>&1; then
@@ -92,8 +86,6 @@
wpa_supplicant_stop()
{
- local dir err errn
-
dir=$(wpa_supplicant_ctrldir)
[ -z "$dir" ] && return 1
wpa_cli -p "$dir" -i "$interface" status >/dev/null 2>&1 || return 0
diff -r 68cced455bb4 -r b6157bd621ac external/bsd/dhcpcd/dist/hooks/15-timezone
--- a/external/bsd/dhcpcd/dist/hooks/15-timezone Mon Jan 01 11:48:51 2018 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/15-timezone Mon Jan 29 11:11:22 2018 +0000
@@ -4,10 +4,9 @@
set_zoneinfo()
{
- local zoneinfo_dir= zone_file=
-
[ -z "$new_tzdb_timezone" ] && return 0
+ zoneinfo_dir=
for d in \
/usr/share/zoneinfo \
/usr/lib/zoneinfo \
diff -r 68cced455bb4 -r b6157bd621ac external/bsd/dhcpcd/dist/hooks/20-resolv.conf
--- a/external/bsd/dhcpcd/dist/hooks/20-resolv.conf Mon Jan 01 11:48:51 2018 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/20-resolv.conf Mon Jan 29 11:11:22 2018 +0000
@@ -13,8 +13,7 @@
build_resolv_conf()
{
- local cf="$state_dir/resolv.conf.$ifname"
- local interfaces= header= search= srvs= servers= x=
+ cf="$state_dir/resolv.conf.$ifname"
# Build a list of interfaces
interfaces=$(list_interfaces "$resolv_conf_dir")
@@ -77,7 +76,6 @@
# regarding DNS option lifetime in ND messages.
eval_nd_dns()
{
-
eval ltime=\$nd${i}_rdnss${j}_lifetime
if [ -z "$ltime" -o "$ltime" = 0 ]; then
rdnss=
@@ -101,8 +99,8 @@
add_resolv_conf()
{
- local x= conf="$signature$NL" warn=true
- local i j ltime rdnss dnssl new_rdnss new_dnssl
+ conf="$signature$NL"
+ warn=true
# Loop to extract the ND DNS options using our indexed shell values
i=1
diff -r 68cced455bb4 -r b6157bd621ac external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
--- a/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname Mon Jan 01 11:48:51 2018 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname Mon Jan 29 11:11:22 2018 +0000
@@ -3,7 +3,6 @@
lookup_hostname()
{
[ -z "$new_ip_address" ] && return 1
- local h=
# Silly ISC programs love to send error text to stdout
if type dig >/dev/null 2>&1; then
h=$(dig +short -x $new_ip_address)
diff -r 68cced455bb4 -r b6157bd621ac external/bsd/dhcpcd/dist/hooks/30-hostname
--- a/external/bsd/dhcpcd/dist/hooks/30-hostname Mon Jan 01 11:48:51 2018 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/30-hostname Mon Jan 29 11:11:22 2018 +0000
@@ -22,8 +22,6 @@
# Some systems don't have hostname(1)
_hostname()
{
- local name=
-
if [ -z "${1+x}" ]; then
if type hostname >/dev/null 2>&1; then
hostname
@@ -55,10 +53,19 @@
fi
}
+set_hostname_vars()
+{
+ hfqdn=false
+ hshort=false
+ case "$hostname_fqdn" in
+ [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) hfqdn=true;;
+ ""|[Ss][Ee][Rr][Vv][Ee][Rr]) ;;
+ *) hshort=true;;
+ esac
+}
+
need_hostname()
{
- local hfqdn=false hshort=false
-
# Always load the hostname variable for future use
hostname="$(_hostname)"
case "$hostname" in
@@ -70,11 +77,7 @@
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) return 0;;
esac
- case "$hostname_fqdn" in
- [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) hfqdn=true;;
- ""|[Ss][Ee][Rr][Vv][Ee][Rr]) ;;
- *) hshort=true;;
- esac
+ set_hostname_vars
if [ -n "$old_fqdn" ]; then
if ${hfqdn} || ! ${hsort}; then
@@ -105,7 +108,6 @@
try_hostname()
{
-
[ "$hostname" = "$1" ] && return 0
if valid_domainname "$1"; then
syslog info "Setting hostname: $1"
@@ -117,15 +119,9 @@
set_hostname()
{
- local hfqdn=false hshort=false
-
need_hostname || return
- case "$hostname_fqdn" in
- [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) hfqdn=true;;
- ""|[Ss][Ee][Rr][Vv][Ee][Rr]) ;;
- *) hshort=true;;
- esac
+ set_hostname_vars
if [ -n "$new_fqdn" ]; then
if ${hfqdn} || ! ${hshort}; then
diff -r 68cced455bb4 -r b6157bd621ac external/bsd/dhcpcd/dist/hooks/50-ntp.conf
--- a/external/bsd/dhcpcd/dist/hooks/50-ntp.conf Mon Jan 01 11:48:51 2018 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/50-ntp.conf Mon Jan 29 11:11:22 2018 +0000
@@ -57,12 +57,12 @@
build_ntp_conf()
{
- local cf="$state_dir/ntp.conf.$ifname"
- local interfaces= header= srvs= servers= x=
+ cf="$state_dir/ntp.conf.$ifname"
# Build a list of interfaces
interfaces=$(list_interfaces "$ntp_conf_dir")
+ servers=
if [ -n "$interfaces" ]; then
# Build the header
for x in ${interfaces}; do
@@ -107,7 +107,7 @@
add_ntp_conf()
{
- local cf="$ntp_conf_dir/$ifname" x=
+ cf="$ntp_conf_dir/$ifname"
[ -e "$cf" ] && rm "$cf"
[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
diff -r 68cced455bb4 -r b6157bd621ac external/bsd/dhcpcd/dist/hooks/50-ypbind.in
--- a/external/bsd/dhcpcd/dist/hooks/50-ypbind.in Mon Jan 01 11:48:51 2018 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/50-ypbind.in Mon Jan 29 11:11:22 2018 +0000
@@ -10,8 +10,6 @@
best_domain()
{
- local i=
-
for i in "$ypbind_dir/$interface_order".*; do
if [ -f "$i" ]; then
cat "$i"
@@ -29,9 +27,9 @@
if [ -z "$ypdomain_dir" ]; then
false
else
- local cf="$ypdomain_dir/$new_nis_domain$ypdomain_suffix"
+ cf="$ypdomain_dir/$new_nis_domain$ypdomain_suffix"
if [ -n "$new_nis_servers" ]; then
- local ncf="$cf.$ifname" x=
+ ncf="$cf.$ifname"
rm -f "$ncf"
for x in $new_nis_servers; do
echo "$x" >>"$ncf"
@@ -42,7 +40,7 @@
fi
fi
- local nd="$(best_domain)"
+ nd="$(best_domain)"
if [ $? = 0 -a "$nd" != "$(domainname)" ]; then
domainname "$nd"
if [ -n "$ypbind_restart_cmd" ]; then
@@ -53,9 +51,8 @@
restore_yp_binding()
{
-
rm -f "$ypbind_dir/$ifname"
- local nd="$(best_domain)"
+ nd="$(best_domain)"
# We need to stop ypbind if there is no best domain
# otherwise it will just stall as we cannot set domainname
# to blank :/
diff -r 68cced455bb4 -r b6157bd621ac external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
--- a/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in Mon Jan 01 11:48:51 2018 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in Mon Jan 29 11:11:22 2018 +0000
@@ -18,7 +18,7 @@
# Ensure that all arguments are unique
uniqify()
{
- local result= i=
+ result=
for i do
case " $result " in
*" $i "*);;
@@ -34,7 +34,7 @@
# Otherwise we just use what we have.
list_interfaces()
{
- local i= x= ifaces=
+ ifaces=
for i in $interface_order; do
for x in "$1"/$i.*; do
[ -f "$x" ] && ifaces="$ifaces${ifaces:+ }${x##*/}"
@@ -49,8 +49,7 @@
# Trim function
trim()
{
- local var="$*"
-
+ var="$*"
var=${var#"${var%%[![:space:]]*}"}
var=${var%"${var##*[![:space:]]}"}
if [ -z "$var" ]; then
@@ -65,9 +64,9 @@
# but sed may not always be available at the time.
key_get_value()
{
- local key="$1" value= x= line=
+ key="$1"
+ shift
- shift
if type sed >/dev/null 2>&1; then
sed -n "s/^$key//p" $@
else
@@ -85,7 +84,9 @@
# but sed may not always be available at the time.
remove_markers()
{
- local m1="$1" m2="$2" x= line= in_marker=0
+ m1="$1"
+ m2="$2"
+ in_marker=0
shift; shift
if type sed >/dev/null 2>&1; then
@@ -106,7 +107,6 @@
# Compare two files.
comp_file()
{
-
[ -e "$1" -a -e "$2" ] || return 1
Home |
Main Index |
Thread Index |
Old Index