head	1.7;
access;
symbols
	netbsd-11-0-RC4:1.6
	netbsd-11-0-RC3:1.6
	dhcpcd-10_3_1:1.1.1.8
	netbsd-11-0-RC2:1.6
	netbsd-11-0-RC1:1.6
	perseant-exfatfs-base-20250801:1.6
	netbsd-11:1.6.0.4
	netbsd-11-base:1.6
	dhcpcd-10_2_3:1.1.1.7
	dhcpcd-10_2_2:1.1.1.7
	dhcpcd-10_2_0a:1.1.1.7
	netbsd-10-1-RELEASE:1.5
	perseant-exfatfs-base-20240630:1.6
	perseant-exfatfs:1.6.0.2
	perseant-exfatfs-base:1.6
	dhcpcd-10_0_8:1.1.1.7
	dhcpcd-10_0_7:1.1.1.7
	netbsd-8-3-RELEASE:1.1.1.1.8.2
	netbsd-9-4-RELEASE:1.3
	netbsd-10-0-RELEASE:1.5
	netbsd-10-0-RC6:1.5
	netbsd-10-0-RC5:1.5
	netbsd-10-0-RC4:1.5
	netbsd-10-0-RC3:1.5
	netbsd-10-0-RC2:1.5
	dhcpcd-10_0_6a:1.1.1.7
	dhcpcd-10_0_6:1.1.1.7
	netbsd-10-0-RC1:1.5
	dhcpcd-10_0_4:1.1.1.7
	dhcpcd-10_0_3:1.1.1.7
	dhcpcd-10_0_2:1.1.1.7
	dhcpcd-10_0_1:1.1.1.7
	netbsd-10:1.5.0.6
	netbsd-10-base:1.5
	netbsd-9-3-RELEASE:1.3
	dhcpcd-9_4_1:1.1.1.6
	cjep_sun2x-base1:1.5
	cjep_sun2x:1.5.0.4
	cjep_sun2x-base:1.5
	cjep_staticlib_x-base1:1.5
	netbsd-9-2-RELEASE:1.3
	cjep_staticlib_x:1.5.0.2
	cjep_staticlib_x-base:1.5
	dhcpcd-9_4_0:1.1.1.6
	dhcpcd-9_3_4:1.1.1.6
	dhcpcd-9_3_3:1.1.1.6
	dhcpcd-9_3_2:1.1.1.5
	netbsd-9-1-RELEASE:1.3
	dhcpcd-9_3_1:1.1.1.5
	dhcpcd-9_3_0:1.1.1.5
	dhcpcd-9_2_0:1.1.1.5
	dhcpcd-9_1_4:1.1.1.5
	dhcpcd-9_1_3:1.1.1.5
	dhcpcd-9_1_2:1.1.1.5
	dhcpcd-9_1_1:1.1.1.5
	dhcpcd-9_1_0:1.1.1.5
	phil-wifi-20200421:1.4
	dhcpcd-9_0_2:1.1.1.5
	dhcpcd-9_0_1:1.1.1.5
	phil-wifi-20200411:1.4
	is-mlppp:1.3.0.4
	is-mlppp-base:1.3
	phil-wifi-20200406:1.4
	dhcpcd-9_0_0:1.1.1.5
	netbsd-8-2-RELEASE:1.1.1.1.8.2
	netbsd-9-0-RELEASE:1.3
	netbsd-9-0-RC2:1.3
	dhcpcd-8_1_6:1.1.1.4
	dhcpcd-8_1_5:1.1.1.4
	dhcpcd-8_1_4:1.1.1.4
	dhcpcd-8_1_3:1.1.1.4
	netbsd-9-0-RC1:1.3
	phil-wifi-20191119:1.3
	dhcpcd-8_1_2:1.1.1.4
	dhcpcd-8_1_1:1.1.1.4
	dhcpcd-8_1_0:1.1.1.4
	ROY:1.1.1
	dhcpcd-8-0-6:1.1.1.4
	dhcpcd-8-0-5:1.1.1.4
	dhcpcd-8-0-4:1.1.1.4
	dhcpcd-8-0-3:1.1.1.4
	netbsd-9:1.3.0.2
	netbsd-9-base:1.3
	dhcpcd-8-0-2:1.1.1.4
	dhcpcd-8-0-1:1.1.1.4
	dhcpcd-8-0-0:1.1.1.4
	dhcpcd-7-2-3a:1.1.1.3
	phil-wifi-20190609:1.2
	netbsd-8-1-RELEASE:1.1.1.1.8.2
	netbsd-8-1-RC1:1.1.1.1.8.2
	dhcpcd-7-2-2:1.1.1.3
	dhcpcd-7-2-1:1.1.1.3
	dhcpcd-7-2-0:1.1.1.3
	dhcpcd-7-1-1:1.1.1.3
	pgoyette-compat-merge-20190127:1.1.1.2.2.1
	pgoyette-compat-20190127:1.2
	dhcpcd-7-1-0:1.1.1.3
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.1.1.2
	netbsd-7-2-RELEASE:1.1.1.2.6.2
	dhcpcd-7-0-8:1.1.1.2
	pgoyette-compat-0728:1.1.1.2
	netbsd-7:1.1.1.2.0.6
	dhcpcd-7-0-7:1.1.1.2
	netbsd-8-0-RELEASE:1.1.1.1.8.1
	phil-wifi:1.1.1.2.0.4
	phil-wifi-base:1.1.1.2
	pgoyette-compat-0625:1.1.1.2
	netbsd-8-0-RC2:1.1.1.1.8.1
	dhcpcd-7-0-6:1.1.1.2
	dhcpcd-7-0-5b:1.1.1.2
	dhcpcd-7-0-5a:1.1.1.2
	dhcpcd-7-0-5:1.1.1.2
	pgoyette-compat-0521:1.1.1.2
	dhcpcd-7-0-4:1.1.1.2
	pgoyette-compat-0502:1.1.1.2
	pgoyette-compat-0422:1.1.1.2
	netbsd-8-0-RC1:1.1.1.1.8.1
	pgoyette-compat-0415:1.1.1.2
	pgoyette-compat-0407:1.1.1.2
	dhcpcd-7-0-3:1.1.1.2
	pgoyette-compat-0330:1.1.1.2
	dhcpcd-7-0-2:1.1.1.2
	pgoyette-compat-0322:1.1.1.2
	pgoyette-compat-0315:1.1.1.2
	pgoyette-compat:1.1.1.2.0.2
	pgoyette-compat-base:1.1.1.2
	dhcpcd-7-0-1:1.1.1.2
	dhcpcd-7-0-0:1.1.1.1
	dhcpcd-7-0-0-rc4:1.1.1.1
	matt-nb8-mediatek:1.1.1.1.0.12
	matt-nb8-mediatek-base:1.1.1.1
	dhcpcd-7-0-0-rc3:1.1.1.1
	dhcpcd-7-0-0-rc2:1.1.1.1
	perseant-stdc-iso10646:1.1.1.1.0.10
	perseant-stdc-iso10646-base:1.1.1.1
	netbsd-8:1.1.1.1.0.8
	netbsd-8-base:1.1.1.1
	prg-localcount2-base3:1.1.1.1
	prg-localcount2-base2:1.1.1.1
	dhcpcd-7-0-0-rc1:1.1.1.1
	prg-localcount2-base1:1.1.1.1
	prg-localcount2:1.1.1.1.0.6
	prg-localcount2-base:1.1.1.1
	pgoyette-localcount:1.1.1.1.0.4
	pgoyette-localcount-20170426:1.1.1.1
	bouyer-socketcan:1.1.1.1.0.2
	bouyer-socketcan-base1:1.1.1.1
	dhcpcd-7-0-0-beta3:1.1.1.1
	dhcpcd-7-0-0-beta2:1.1.1.1
	dhcpcd-7-0-0-beta1:1.1.1.1
	roy:1.1.1;
locks; strict;
comment	@# @;


1.7
date	2026.03.16.12.26.27;	author roy;	state Exp;
branches;
next	1.6;
commitid	ocYJHBiwJyfNhcyG;

1.6
date	2023.04.21.16.54.26;	author roy;	state Exp;
branches;
next	1.5;
commitid	RSjPPlaT2zc9QZlE;

1.5
date	2020.11.20.13.24.58;	author roy;	state Exp;
branches;
next	1.4;
commitid	zpZxK7weice72DwC;

1.4
date	2020.04.02.12.41.48;	author roy;	state Exp;
branches;
next	1.3;
commitid	f8Wc4BN4taQtfO2C;

1.3
date	2019.07.24.09.57.43;	author roy;	state Exp;
branches;
next	1.2;
commitid	4iib5MRwJY8xthwB;

1.2
date	2018.09.22.13.17.46;	author kre;	state Exp;
branches;
next	1.1;
commitid	DO5SBbZluRbhn6TA;

1.1
date	2017.03.31.20.51.16;	author roy;	state Exp;
branches
	1.1.1.1;
next	;
commitid	2iSri9mccyHffKLz;

1.1.1.1
date	2017.03.31.20.51.16;	author roy;	state Exp;
branches
	1.1.1.1.2.1
	1.1.1.1.4.1
	1.1.1.1.8.1;
next	1.1.1.2;
commitid	2iSri9mccyHffKLz;

1.1.1.2
date	2018.01.29.11.11.23;	author roy;	state Exp;
branches
	1.1.1.2.2.1
	1.1.1.2.4.1
	1.1.1.2.6.1;
next	1.1.1.3;
commitid	ANwLArYxQ3OXfLoA;

1.1.1.3
date	2019.01.22.15.16.25;	author roy;	state Exp;
branches;
next	1.1.1.4;
commitid	ObRHdPr38Oth7N8B;

1.1.1.4
date	2019.07.24.09.54.49;	author roy;	state Exp;
branches;
next	1.1.1.5;
commitid	Nokc5jYoPRhfshwB;

1.1.1.5
date	2020.04.02.12.38.55;	author roy;	state Exp;
branches;
next	1.1.1.6;
commitid	B3wgJaSBzotdeO2C;

1.1.1.6
date	2020.11.20.13.23.39;	author roy;	state Exp;
branches;
next	1.1.1.7;
commitid	wyvM0GHuvNB91DwC;

1.1.1.7
date	2023.04.21.16.52.46;	author roy;	state Exp;
branches;
next	1.1.1.8;
commitid	SzhZ9f5ppzfOOZlE;

1.1.1.8
date	2026.03.16.12.22.55;	author roy;	state Exp;
branches;
next	;
commitid	5hO53qXezJHogcyG;

1.1.1.1.2.1
date	2017.03.31.20.51.16;	author roy;	state dead;
branches;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	2017.03.31.20.51.17;	author roy;	state Exp;
branches;
next	;

1.1.1.1.4.1
date	2017.03.31.20.51.16;	author pgoyette;	state dead;
branches;
next	1.1.1.1.4.2;
commitid	ojV02aOSdzvBqZOz;

1.1.1.1.4.2
date	2017.04.26.02.52.23;	author pgoyette;	state Exp;
branches;
next	;
commitid	ojV02aOSdzvBqZOz;

1.1.1.1.8.1
date	2018.04.09.16.46.34;	author martin;	state Exp;
branches;
next	1.1.1.1.8.2;
commitid	EzvHIuotKE2mSMxA;

1.1.1.1.8.2
date	2019.04.26.19.18.22;	author martin;	state Exp;
branches;
next	;
commitid	ApYO1Wt23frIqTkB;

1.1.1.2.2.1
date	2018.09.30.01.45.11;	author pgoyette;	state Exp;
branches;
next	;
commitid	SQ44grEPCeKPh4UA;

1.1.1.2.4.1
date	2019.06.10.21.44.43;	author christos;	state Exp;
branches;
next	1.1.1.2.4.2;
commitid	jtc8rnCzWiEEHGqB;

1.1.1.2.4.2
date	2020.04.08.14.04.03;	author martin;	state Exp;
branches;
next	1.1.1.2.4.3;
commitid	Qli2aW9E74UFuA3C;

1.1.1.2.4.3
date	2020.04.13.07.45.58;	author martin;	state Exp;
branches;
next	;
commitid	X01YhRUPVUDaec4C;

1.1.1.2.6.1
date	2018.01.29.11.11.23;	author martin;	state dead;
branches;
next	1.1.1.2.6.2;
commitid	HmTKhyRj9OTCmLLA;

1.1.1.2.6.2
date	2018.07.27.10.43.20;	author martin;	state Exp;
branches;
next	;
commitid	HmTKhyRj9OTCmLLA;


desc
@@


1.7
log
@Sync with dhcpcd-10.3.1
@
text
@# Sample dhcpcd hook script for NTP
# It will configure either one of NTP, OpenNTP or Chrony (in that order)
# and will default to NTP if no default config is found.

# Like our resolv.conf hook script, we store a database of ntp.conf files
# and merge into /etc/ntp.conf

# You can set the env var NTP_CONF to override the derived default on
# systems with >1 NTP client installed.
# Here is an example for OpenNTP
#   dhcpcd -e NTP_CONF=/usr/pkg/etc/ntpd.conf
# or by adding this to /etc/dhcpcd.conf
#   env NTP_CONF=/usr/pkg/etc/ntpd.conf
# or by adding this to /etc/dhcpcd.enter-hook
#   NTP_CONF=/usr/pkg/etc/ntpd.conf
# To use Chrony instead, simply change ntpd.conf to chrony.conf in the
# above examples.

: ${ntp_confs:=ntp.conf ntpd.conf chrony.conf}
: ${ntp_conf_dirs=/etc /usr/pkg/etc /usr/local/etc}
ntp_conf_dir="$state_dir/ntp.conf"

# If NTP_CONF is not set, work out a good default
if [ -z "$NTP_CONF" ]; then
	for d in ${ntp_conf_dirs}; do
		for f in ${ntp_confs}; do
			if [ -e "$d/$f" ]; then
				NTP_CONF="$d/$f"
				break 2
			fi
		done
	done
	[ -e "$NTP_CONF" ] || NTP_CONF=/etc/ntp.conf
fi

# Derive service name from configuration
if [ -z "$ntp_service" ]; then
	case "$NTP_CONF" in
	*chrony.conf)		ntp_service=chronyd;;
	*)			ntp_service=ntpd;;
	esac
fi

# Debian has a separate file for DHCP config to avoid stamping on
# the master.
if [ "$ntp_service" = ntpd ] && command -v invoke-rc.d >/dev/null 2>&1; then
	[ -e /var/lib/ntp ] || mkdir /var/lib/ntp
	: ${ntp_service:=ntp}
	: ${NTP_DHCP_CONF:=/var/lib/ntp/ntp.conf.dhcp}
fi

: ${ntp_restart_cmd:=service_condcommand $ntp_service restart}

ntp_conf=${NTP_CONF}
NL="
"

build_ntp_conf()
{
	cf="$state_dir/ntp.conf.$ifname"

	# Build a list of interfaces
	interfaces=$(list_interfaces "$ntp_conf_dir")

	header=
	servers=
	if [ -n "$interfaces" ]; then
		# Build the header
		for x in ${interfaces}; do
			header="$header${header:+, }$x"
		done

		# Build a server list
		srvs=$(cd "$ntp_conf_dir";
			key_get_value "server " $interfaces)
		if [ -n "$srvs" ]; then
			for x in $(uniqify $srvs); do
				servers="${servers}server $x$NL"
			done
		fi
	fi

	# Merge our config into ntp.conf
	[ -e "$cf" ] && rm -f "$cf"
	[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"

	if [ -n "$NTP_DHCP_CONF" ]; then
		[ -e "$ntp_conf" ] && cp "$ntp_conf" "$cf"
		ntp_conf="$NTP_DHCP_CONF"
	elif [ -e "$ntp_conf" ]; then
		remove_markers "$signature_base" "$signature_base_end" \
			"$ntp_conf" > "$cf"
	fi

	if [ -n "$servers" ]; then
		echo "$signature_base${header:+ $from }$header" >> "$cf"
		printf %s "$servers" >> "$cf"
		echo "$signature_base_end${header:+ $from }$header" >> "$cf"
	else
		[ -e "$ntp_conf" ] && [ -e "$cf" ] || return
	fi

	# If we changed anything, restart ntpd
	if change_file "$ntp_conf" "$cf"; then
		[ -n "$ntp_restart_cmd" ] && eval $ntp_restart_cmd
	fi
}

add_ntp_conf()
{
	cf="$ntp_conf_dir/$ifname"

	[ -e "$cf" ] && rm "$cf"
	[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
	if [ -n "$new_ntp_servers" ]; then
		for x in $(uniqify $new_ntp_servers); do
			echo "server $x" >> "$cf"
		done
	fi
	build_ntp_conf
}

remove_ntp_conf()
{
	if [ -e "$ntp_conf_dir/$ifname" ]; then
		rm "$ntp_conf_dir/$ifname"
	fi
	build_ntp_conf
}

# For ease of use, map DHCP6 names onto our DHCP4 names
case "$reason" in
BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
	new_ntp_servers="$new_dhcp6_sntp_servers"
	new_ntp_servers="$new_ntp_servers${new_ntp_servers:+ }$new_dhcp6_ntp_server_addr"
	new_ntp_servers="$new_ntp_servers${new_ntp_servers:+ }$new_dhcp6_ntp_server_fqdn"
;;
esac

if $if_configured; then
	if $if_up; then
		add_ntp_conf
	elif $if_down; then
		remove_ntp_conf
	fi
fi
@


1.6
log
@Merge changes
@
text
@d134 3
a136 1
	new_ntp_servers="$new_dhcp6_sntp_servers $new_dhcp6_ntp_server_addr $new_dhcp6_ntp_server_fqdn"
@


1.5
log
@Sync with dhcpcd-9.3.3
@
text
@d46 1
a46 1
if [ "$ntp_service" = ntpd ] && type invoke-rc.d >/dev/null 2>&1; then
d116 1
a116 1
		for x in $new_ntp_servers; do
d134 1
a134 1
	new_ntp_servers="$new_dhcp6_sntp_servers"
@


1.4
log
@Sync
@
text
@d138 6
a143 4
if $if_up; then
	add_ntp_conf
elif $if_down; then
	remove_ntp_conf
@


1.3
log
@Sync
@
text
@d44 1
a44 1
# Debian has a seperate file for DHCP config to avoid stamping on
@


1.2
log
@
PR install/53622  (probably)

When used as part of a network based install kernel, the SMALL "test" (aka [)
does not support -a or -o, so rewrite these scripts to avoid using that.
@
text
@d65 1
@


1.1
log
@Initial revision
@
text
@d60 1
a60 2
	local cf="$state_dir/ntp.conf.$ifname"
	local interfaces= header= srvs= servers= x=
d65 1
d99 1
a99 1
		[ -e "$ntp_conf" -a -e "$cf" ] || return
d110 1
a110 1
	local cf="$ntp_conf_dir/$ifname" x=
@


1.1.1.1
log
@Import dhcpcd-7.0.0-beta. Changes from prior version include:

  *  source file locations reworked:
       dhcpcd source is in src
       dhcpcd hooks are in hooks
       compat is in compat
  *  README split into README.md and BUILDING.md
  *  internal routing is now protocol agnostic
  *  avoid using __packed and use compile time asserts instead
  *  addresses some alignment issues
  *  disable some ARP code on kernels which support RFC5227
  *  BSD IPv6 kernel settings are now updated to reflect dhcpcd config
  *  custom logger has been removed, syslog handles everything
     as such, the --logfile option has been removed as well.
     If you need better/earlier logging, get a better syslogger!
  *  distinfo and signed distinfo files are now available alongside
     release taraballs from this point onwards
  *  default DBDIR has changed from /var/db to /var/db/dhcpcd
  *  /etc/dhcpcd.duid moves to DBDIR/duid
  *  /etc/dhcpcd.secret moves to DBDIR/secret
  *  lease file names have dhcpcd removed from them as they are now
     inside a directory of the same name
  *  fixed issues with reject routes not working on some platforms
  *  improved nl80211 support on Linux for working out the SSID
  *  no longer request NTP by default in dhcpcd.conf
  *  BPF filtering vastly improved so dhcpcd only wake up on
     ARP or DHCP packets destined for it
  *  support for MUD URL (draft-ietf-opsawg-mud-05)
  *  if the kernel isn't doing DAD, don't insist on waiting for it
     to actually do it
  *  fix a potential crash where the DHCP or ARP states could be
     freed before the packet processing loop naturally breaks
  *  removed gateway and nogateway options
     (these can be controlled by the nooption directive which
     works for more than just gateways)
  *  removed ipv6ra_own and ipv6ra_own_default options
     (these can be controled by the ipv6rs/noipv6rs directive)
  *  fix a crash receiving SIGUSR1
@
text
@@


1.1.1.1.8.1
log
@Catch up to current in external/bsd/dhcpcd/, requested by roy in ticket #707:

external/bsd/dhcpcd/dist/configure              up to 1.1.1.7
external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/15-timezone      up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/20-resolv.conf   up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/29-lookup-hostname up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/30-hostname      up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/50-ntp.conf      up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/50-yp.conf       up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/50-ypbind.in     up to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in up to 1.1.1.4
external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in up to 1.1.1.4
external/bsd/dhcpcd/dist/src/arp.c              up to 1.1.1.6
external/bsd/dhcpcd/dist/src/common.h           up to 1.1.1.4
external/bsd/dhcpcd/dist/src/defs.h             up to 1.1.1.11
external/bsd/dhcpcd/dist/src/dhcp.c             up to 1.9
external/bsd/dhcpcd/dist/src/dhcp.h             up to 1.1.1.5
external/bsd/dhcpcd/dist/src/dhcp6.c            up to 1.1.1.10
external/bsd/dhcpcd/dist/src/dhcp6.h            up to 1.1.1.4
external/bsd/dhcpcd/dist/src/dhcpcd.8.in        up to 1.1.1.8
external/bsd/dhcpcd/dist/src/dhcpcd.c           up to 1.10
external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in   up to 1.1.1.7
external/bsd/dhcpcd/dist/src/dhcpcd.h           up to 1.1.1.5
external/bsd/dhcpcd/dist/src/if-bsd.c           up to 1.1.1.7
external/bsd/dhcpcd/dist/src/if-linux.c         up to 1.1.1.8
external/bsd/dhcpcd/dist/src/if-options.c       up to 1.8
external/bsd/dhcpcd/dist/src/if-options.h       up to 1.1.1.7
external/bsd/dhcpcd/dist/src/if-sun.c           up to 1.1.1.4
external/bsd/dhcpcd/dist/src/if.c               up to 1.1.1.8
external/bsd/dhcpcd/dist/src/if.h               up to 1.1.1.5
external/bsd/dhcpcd/dist/src/ipv4.c             up to 1.1.1.9
external/bsd/dhcpcd/dist/src/ipv4.h             up to 1.1.1.4
external/bsd/dhcpcd/dist/src/ipv6.c             up to 1.1.1.8
external/bsd/dhcpcd/dist/src/ipv6.h             up to 1.1.1.6
external/bsd/dhcpcd/dist/src/ipv6nd.c           up to 1.1.1.7
external/bsd/dhcpcd/dist/src/ipv6nd.h           up to 1.1.1.5
external/bsd/dhcpcd/dist/src/logerr.h           up to 1.1.1.3
external/bsd/dhcpcd/dist/src/route.c            up to 1.1.1.6
external/bsd/dhcpcd/dist/src/route.h            up to 1.1.1.4
external/bsd/dhcpcd/dist/src/dev/udev.c         up to 1.1.1.2
external/bsd/dhcpcd/dist/tests/eloop-bench/eloop-bench.c up to 1.1.1.3
external/bsd/dhcpcd/include/config.h            up to 1.3
external/bsd/dhcpcd/sbin/dhcpcd/Makefile        up to 1.43

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

Import dhcpcd-7.0.2 with the following changes:

  *  Added support for setproctitle(3)
  *  Kernel RA is no longer disabled when IPv6 is disabled in dhcpcd
  *  DHCPv6 PD is no longer stopped if no Routers are found
  *  If the DHCP leased address is deleted, enter the reboot state
  *  DHCPv6 unicast is no longer performed when not in master mode
  *  dhcpcd will now detect netlink/route socket overflows ad re-sync

Import dhcpcd-7.0.3 with the following changes:

  *  dhcp6: fix a null termination overflow on status messages
  *  options: static routes can be setup in global context again
  *  routes: dhcpcd added host routes are now reported correctly
@
text
@d60 2
a61 1
	cf="$state_dir/ntp.conf.$ifname"
a65 1
	servers=
d110 1
a110 1
	cf="$ntp_conf_dir/$ifname"
@


1.1.1.1.8.2
log
@Sync to head, requested by roy in ticket #1250:

	external/bsd/dhcpcd/dist/compat/consttime_memequal.h up to 1.1.1.1
	external/bsd/dhcpcd/dist/.arcconfig             delete
	external/bsd/dhcpcd/dist/BUILDING.md            up to 1.1.1.3
	external/bsd/dhcpcd/dist/LICENSE                up to 1.1.1.3
	external/bsd/dhcpcd/dist/Makefile               up to 1.1.1.6
	external/bsd/dhcpcd/dist/configure              up to 1.1.1.11
	external/bsd/dhcpcd/dist/iconfig.mk             up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/20-resolv.conf   up to 1.2
	external/bsd/dhcpcd/dist/hooks/29-lookup-hostname up to 1.2
	external/bsd/dhcpcd/dist/hooks/30-hostname      up to 1.2
	external/bsd/dhcpcd/dist/hooks/50-ntp.conf      up to 1.2
	external/bsd/dhcpcd/dist/hooks/50-yp.conf       up to 1.2
	external/bsd/dhcpcd/dist/hooks/50-ypbind.in     up to 1.2
	external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in up to 1.3
	external/bsd/dhcpcd/dist/src/Makefile           up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/arp.c              up to 1.1.1.10
	external/bsd/dhcpcd/dist/src/arp.h              up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/auth.c             up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/auth.h             up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/bpf.c              up to 1.8
	external/bsd/dhcpcd/dist/src/bpf.h              up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/common.c           up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/common.h           up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/control.c          up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/control.h          up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/defs.h             up to 1.1.1.20
	external/bsd/dhcpcd/dist/src/dev.c              up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/dev.h              up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/dhcp-common.c      up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/dhcp-common.h      up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/dhcp.c             up to 1.18
	external/bsd/dhcpcd/dist/src/dhcp.h             up to 1.1.1.9
	external/bsd/dhcpcd/dist/src/dhcp6.c            up to 1.6
	external/bsd/dhcpcd/dist/src/dhcp6.h            up to 1.1.1.9
	external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c.in up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h.in up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/dhcpcd.8.in        up to 1.1.1.12
	external/bsd/dhcpcd/dist/src/dhcpcd.c           up to 1.18
	external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in   up to 1.1.1.12
	external/bsd/dhcpcd/dist/src/dhcpcd.h           up to 1.1.1.9
	external/bsd/dhcpcd/dist/src/duid.c             up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/eloop.c            up to 1.1.1.6
	external/bsd/dhcpcd/dist/src/eloop.h            up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/if-bsd.c           up to 1.6
	external/bsd/dhcpcd/dist/src/if-linux-wext.c    up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/if-linux.c         up to 1.1.1.12
	external/bsd/dhcpcd/dist/src/if-options.c       up to 1.13
	external/bsd/dhcpcd/dist/src/if-options.h       up to 1.1.1.8
	external/bsd/dhcpcd/dist/src/if-sun.c           up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/if.c               up to 1.1.1.12
	external/bsd/dhcpcd/dist/src/if.h               up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/ipv4.c             up to 1.1.1.13
	external/bsd/dhcpcd/dist/src/ipv4.h             up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/ipv4ll.c           up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/ipv4ll.h           up to 1.1.1.6
	external/bsd/dhcpcd/dist/src/ipv6.c             up to 1.1.1.16
	external/bsd/dhcpcd/dist/src/ipv6.h             up to 1.1.1.10
	external/bsd/dhcpcd/dist/src/ipv6nd.c           up to 1.6
	external/bsd/dhcpcd/dist/src/ipv6nd.h           up to 1.1.1.9
	external/bsd/dhcpcd/dist/src/logerr.c           up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/logerr.h           up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/route.c            up to 1.1.1.10
	external/bsd/dhcpcd/dist/src/route.h            up to 1.1.1.6
	external/bsd/dhcpcd/dist/src/sa.c               up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/sa.h               up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/script.c           up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/script.h           up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/dev/udev.c         up to 1.1.1.3
	external/bsd/dhcpcd/dist/tests/Makefile         up to 1.1.1.2
	external/bsd/dhcpcd/sbin/dhcpcd/Makefile        up to 1.45

Import dhcpcd-7.2.1 with the following changes:
*  auth: Use consttime_memequal to avoid latency attack
*  DHCP: Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED
*  DHCPv6: Fix a potential buffer overflow reading NA/TA addresses
@
text
@d99 1
a99 1
		[ -e "$ntp_conf" ] && [ -e "$cf" ] || return
@


1.1.1.2
log
@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
@
text
@d60 2
a61 1
	cf="$state_dir/ntp.conf.$ifname"
a65 1
	servers=
d110 1
a110 1
	cf="$ntp_conf_dir/$ifname"
@


1.1.1.2.4.1
log
@Sync with HEAD
@
text
@d99 1
a99 1
		[ -e "$ntp_conf" ] && [ -e "$cf" ] || return
@


1.1.1.2.4.2
log
@Merge changes from current as of 20200406
@
text
@d44 1
a44 1
# Debian has a separate file for DHCP config to avoid stamping on
@


1.1.1.2.4.3
log
@Mostly merge changes from HEAD upto 20200411
@
text
@a64 1
	header=
@


1.1.1.3
log
@Import dhcpcd-7.1.0 with the following changes:

* NetBSD: sets SO_RERROR on to detect receive socket overflow
* BSD: route improvements to avoid listening for own changes
* IP6: implement IP6 address sharing
* BSD: catch UP/DOWN events when interfaces does support media changes
* IPv4LL: remember old address when carrier is lost
@
text
@d99 1
a99 1
		[ -e "$ntp_conf" ] && [ -e "$cf" ] || return
@


1.1.1.4
log
@Import dhcpcd-8.0.0 with the following changes:

  *  ARP now supports many requests
  *  Routing tables now use Red-Black Trees
  *  Script variables are no longer allocated manually
@
text
@a64 1
	header=
@


1.1.1.5
log
@Update to dhcpcd-9.0.0 with the following changes:

 * Decode interface complex interface names eth0.100:2 eth0i100:2.
   This allows us to ignore some virtual interfaces by default
 * ARP: Report L2 header address on conflict for more clarity
 * DHCP: Support jumbo frames (untested)
 * DHCP6: Clean up old lease on failure to confirm/rebind, etc
 * RA: Prefer older routers
 * INET6: Obscure prefixes are now calculated correctly

 * Privilege Separation
 * default hostname is now a blank string rather than localhost
 * Leases are now dumped over the control socket - you get RA's now as well.
 * Better support for many IPv6 routers
 * RTM_MISS filtering
 * RA: Deprecate stale addresses by setting pltime 0
 * DHCP6: Deprecate stale addresses by setting pltime 0
@
text
@d44 1
a44 1
# Debian has a separate file for DHCP config to avoid stamping on
@


1.1.1.6
log
@Update to dhcpcd-9.3.3 with the following changes:

 * dhcpcd: Don't create a launcher process if keeping in foreground
 * dhcpcd: Add --noconfigure option
 * control: Create an unpriv socket for non master mode
 * options: Don't log unknown ones when printing pidfile location
@
text
@d138 4
a141 6
if $if_configured; then
	if $if_up; then
		add_ntp_conf
	elif $if_down; then
		remove_ntp_conf
	fi
@


1.1.1.7
log
@Update to dhcpcd-10.0.1 with the following changes:

 * privsep: keep resources open rather than open/close
 * dhcp6: OPTION_NTP_SERVER is now preferred over OPTION_SNTP_SERVER
 * Misc bug fixes mainly around privsep for many platforms.
 * Fix for reading the some BSD routing table entries.
 * Fix reading authtokens from config.

Big new release, mainly around better privsep process management
which allows us to detect when they exit unexpectedly.
@
text
@d46 1
a46 1
if [ "$ntp_service" = ntpd ] && command -v invoke-rc.d >/dev/null 2>&1; then
d116 1
a116 1
		for x in $(uniqify $new_ntp_servers); do
d134 1
a134 1
	new_ntp_servers="$new_dhcp6_sntp_servers $new_dhcp6_ntp_server_addr $new_dhcp6_ntp_server_fqdn"
@


1.1.1.8
log
@Update to dhcpcd-10.3.1 with the following changes:

* BSD: don't send uninitialised memory using ps_root_indirectioctl
* Fix fallback_time option by @@ColinMcInnes
* IPv4: Ignore DHCP state when building routes
* options: Ensure ldop is not NULL dereferenced
* route: Routes may not have an interface assinged
* options: Ensure that an overly long bitflag string does not crash
* options: Don't assume vsio options have an argument
* common: Cast via uintptr_t rather than unsigned long in UNCONST
* privsep: Ensure we recv for real after a successful recv MSG_PEEK
* DHCP: Add parentheses to macro definitions
* ipv6nd: empty IPV6RA_EXPIRE eloop queue when dropping
@
text
@d134 1
a134 3
	new_ntp_servers="$new_dhcp6_sntp_servers"
	new_ntp_servers="$new_ntp_servers${new_ntp_servers:+ }$new_dhcp6_ntp_server_addr"
	new_ntp_servers="$new_ntp_servers${new_ntp_servers:+ }$new_dhcp6_ntp_server_fqdn"
@


1.1.1.2.2.1
log
@Ssync with HEAD
@
text
@d99 1
a99 1
		[ -e "$ntp_conf" ] && [ -e "$cf" ] || return
@


1.1.1.2.6.1
log
@file 50-ntp.conf was added on branch netbsd-7 on 2018-07-27 10:43:20 +0000
@
text
@d1 141
@


1.1.1.2.6.2
log
@Pull up following revision(s) (requested by roy in ticket #1621):

	external/bsd/dhcpcd/dist/compat/crypt/sha256.c  up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/crypt/md5.c     up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/crypt/md5.h     up to 1.1.1.2
	external/bsd/dhcpcd/dist/compat/crypt/sha256.h  up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/crypt/hmac.c    up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/crypt/hmac.h    up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/_strtoi.h       up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/arc4random.c    up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/arc4random.h    up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/arc4random_uniform.c up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/arc4random_uniform.h up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/bitops.h        up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/dprintf.c       up to 1.1.1.2
	external/bsd/dhcpcd/dist/compat/dprintf.h       up to 1.1.1.2
	external/bsd/dhcpcd/dist/compat/endian.h        up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/pidfile.c       up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/pidfile.h       up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/queue.h         up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/reallocarray.c  up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/reallocarray.h  up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/strtoi.c        up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/strtoi.h        up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/strtou.c        up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/strlcpy.c       up to 1.1.1.1
	external/bsd/dhcpcd/dist/compat/strlcpy.h       up to 1.1.1.1
	external/bsd/dhcpcd/dist/config-null.mk         up to 1.1.1.1
	external/bsd/dhcpcd/dist/configure              up to 1.1.1.8
	external/bsd/dhcpcd/dist/iconfig.mk             up to 1.1.1.1
	external/bsd/dhcpcd/dist/hooks/01-test          up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/02-dump          up to 1.1.1.1
	external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/15-timezone      up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/20-resolv.conf   up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/29-lookup-hostname up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/30-hostname      up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/50-dhcpcd-compat up to 1.1.1.1
	external/bsd/dhcpcd/dist/hooks/50-ntp.conf      up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/50-yp.conf       up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/50-ypbind.in     up to 1.1.1.2
	external/bsd/dhcpcd/dist/hooks/Makefile         up to 1.1.1.1
	external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in up to 1.1.1.4
	external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/GNUmakefile        up to 1.1.1.1
	external/bsd/dhcpcd/dist/src/Makefile           up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/arp.c              up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/arp.h              up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/auth.c             up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/auth.h             up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/bpf.c              up to 1.7
	external/bsd/dhcpcd/dist/src/bpf.h              up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/common.c           up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/common.h           up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/control.c          up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/control.h          up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/defs.h             up to 1.1.1.15
	external/bsd/dhcpcd/dist/src/dev.c              up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/dev.h              up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/dhcp-common.c      up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/dhcp-common.h      up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/dhcp.c             up to 1.11
	external/bsd/dhcpcd/dist/src/dhcp.h             up to 1.1.1.6
	external/bsd/dhcpcd/dist/src/dhcp6.c            up to 1.1.1.12
	external/bsd/dhcpcd/dist/src/dhcp6.h            up to 1.1.1.6
	external/bsd/dhcpcd/dist/src/dhcpcd-definitions-small.conf up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/dhcpcd-definitions.conf up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c.in up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h.in up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/dhcpcd.8.in        up to 1.1.1.10
	external/bsd/dhcpcd/dist/src/dhcpcd.c           up to 1.13
	external/bsd/dhcpcd/dist/src/dhcpcd.conf        up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in   up to 1.1.1.10
	external/bsd/dhcpcd/dist/src/dhcpcd.h           up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/duid.c             up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/duid.h             up to 1.1.1.1
	external/bsd/dhcpcd/dist/src/eloop.c            up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/eloop.h            up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/genembedc          up to 1.1.1.1
	external/bsd/dhcpcd/dist/src/genembedh          up to 1.1.1.1
	external/bsd/dhcpcd/dist/src/if-bsd.c           up to 1.1.1.8
	external/bsd/dhcpcd/dist/src/if-linux-wext.c    up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/if-linux.c         up to 1.1.1.10
	external/bsd/dhcpcd/dist/src/if-options.c       up to 1.10
	external/bsd/dhcpcd/dist/src/if-options.h       up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/if-sun.c           up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/if.c               up to 1.1.1.8
	external/bsd/dhcpcd/dist/src/if.h               up to 1.1.1.5
	external/bsd/dhcpcd/dist/src/ipv4.c             up to 1.1.1.9
	external/bsd/dhcpcd/dist/src/ipv4.h             up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/ipv4ll.c           up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/ipv4ll.h           up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/ipv6.c             up to 1.1.1.11
	external/bsd/dhcpcd/dist/src/ipv6.h             up to 1.1.1.7
	external/bsd/dhcpcd/dist/src/ipv6nd.c           up to 1.1.1.8
	external/bsd/dhcpcd/dist/src/ipv6nd.h           up to 1.1.1.6
	external/bsd/dhcpcd/dist/src/logerr.c           up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/logerr.h           up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/route.c            up to 1.1.1.8
	external/bsd/dhcpcd/dist/src/route.h            up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/sa.c               up to 1.1.1.3
	external/bsd/dhcpcd/dist/src/sa.h               up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/script.c           up to 1.1.1.4
	external/bsd/dhcpcd/dist/src/script.h           up to 1.1.1.2
	external/bsd/dhcpcd/dist/src/dev/Makefile       up to 1.1.1.1
	external/bsd/dhcpcd/dist/src/dev/udev.c         up to 1.1.1.2
	external/bsd/dhcpcd/dist/tests/crypt/.gitignore up to 1.1.1.1
	external/bsd/dhcpcd/dist/tests/crypt/GNUmakefile up to 1.1.1.1
	external/bsd/dhcpcd/dist/tests/crypt/Makefile   up to 1.1.1.2
	external/bsd/dhcpcd/dist/tests/crypt/README.md  up to 1.1.1.1
	external/bsd/dhcpcd/dist/tests/crypt/run-test.c up to 1.1.1.2
	external/bsd/dhcpcd/dist/tests/crypt/test.h     up to 1.1.1.2
	external/bsd/dhcpcd/dist/tests/crypt/test_hmac_md5.c up to 1.1.1.3
	external/bsd/dhcpcd/dist/tests/Makefile         up to 1.1.1.1
	external/bsd/dhcpcd/dist/tests/eloop-bench/.gitignore up to 1.1.1.1
	external/bsd/dhcpcd/dist/tests/eloop-bench/Makefile up to 1.1.1.2
	external/bsd/dhcpcd/dist/tests/eloop-bench/README.md up to 1.1.1.1
	external/bsd/dhcpcd/dist/tests/eloop-bench/eloop-bench.c up to 1.1.1.3
	external/bsd/dhcpcd/dist/.arcconfig             up to 1.1.1.1
	external/bsd/dhcpcd/dist/.gitignore             up to 1.4
	external/bsd/dhcpcd/dist/BUILDING.md            up to 1.1.1.2
	external/bsd/dhcpcd/dist/LICENSE                up to 1.1.1.2
	external/bsd/dhcpcd/dist/Makefile               up to 1.1.1.5
	external/bsd/dhcpcd/dist/Makefile.inc           up to 1.1.1.2
	external/bsd/dhcpcd/dist/README.md              up to 1.1.1.3
	external/bsd/dhcpcd/dist/bpf-filter.h           delete
	external/bsd/dhcpcd/dist/common.c               delete
	external/bsd/dhcpcd/dist/arp.c                  delete
	external/bsd/dhcpcd/dist/arp.h                  delete
	external/bsd/dhcpcd/dist/auth.c                 delete
	external/bsd/dhcpcd/dist/auth.h                 delete
	external/bsd/dhcpcd/dist/dhcpcd.c               delete
	external/bsd/dhcpcd/dist/control.c              delete
	external/bsd/dhcpcd/dist/common.h               delete
	external/bsd/dhcpcd/dist/config.h               delete
	external/bsd/dhcpcd/dist/dhcp-common.c          delete
	external/bsd/dhcpcd/dist/control.h              delete
	external/bsd/dhcpcd/dist/defs.h                 delete
	external/bsd/dhcpcd/dist/dev.h                  delete
	external/bsd/dhcpcd/dist/dhcpcd-definitions.conf delete
	external/bsd/dhcpcd/dist/dhcp-common.h          delete
	external/bsd/dhcpcd/dist/dhcp.c                 delete
	external/bsd/dhcpcd/dist/dhcp.h                 delete
	external/bsd/dhcpcd/dist/dhcp6.c                delete
	external/bsd/dhcpcd/dist/dhcp6.h                delete
	external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in  delete
	external/bsd/dhcpcd/dist/dhcpcd-embedded.c      delete
	external/bsd/dhcpcd/dist/dhcpcd.8.in            delete
	external/bsd/dhcpcd/dist/dhcpcd-embedded.c.in   delete
	external/bsd/dhcpcd/dist/dhcpcd-embedded.h      delete
	external/bsd/dhcpcd/dist/dhcpcd-embedded.h.in   delete
	external/bsd/dhcpcd/dist/ipv4.c                 delete
	external/bsd/dhcpcd/dist/if.c                   delete
	external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in    delete
	external/bsd/dhcpcd/dist/dhcpcd.h               delete
	external/bsd/dhcpcd/dist/dhcpcd.conf            delete
	external/bsd/dhcpcd/dist/dhcpcd.conf.5.in       delete
	external/bsd/dhcpcd/dist/duid.c                 delete
	external/bsd/dhcpcd/dist/duid.h                 delete
	external/bsd/dhcpcd/dist/eloop.c                delete
	external/bsd/dhcpcd/dist/eloop.h                delete
	external/bsd/dhcpcd/dist/if-bsd.c               delete
	external/bsd/dhcpcd/dist/if-options.c           delete
	external/bsd/dhcpcd/dist/if-options.h           delete
	external/bsd/dhcpcd/dist/if.h                   delete
	external/bsd/dhcpcd/dist/crypt/hmac_md5.c       delete
	external/bsd/dhcpcd/dist/crypt/crypt.h          delete
	external/bsd/dhcpcd/dist/ipv4.h                 delete
	external/bsd/dhcpcd/dist/ipv4ll.c               delete
	external/bsd/dhcpcd/dist/ipv6.c                 delete
	external/bsd/dhcpcd/dist/ipv4ll.h               delete
	external/bsd/dhcpcd/dist/ipv6.h                 delete
	external/bsd/dhcpcd/dist/ipv6nd.c               delete
	external/bsd/dhcpcd/dist/ipv6nd.h               delete
	external/bsd/dhcpcd/dist/script.c               delete
	external/bsd/dhcpcd/dist/script.h               delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/15-timezone delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test   delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump   delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/10-mtu    delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/10-wpa_supplicant delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf delete
	external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind delete
	usr.sbin/postinstall/postinstall: revision 1.211-1.213
	etc/rc.d/dhcpcd					upto 1.5
	doc/3RDPARTY					manual edit

Import dhcpcd-7.0.7.
Adjust postinstal and rc file.
@
text
@a0 141
# Sample dhcpcd hook script for NTP
# It will configure either one of NTP, OpenNTP or Chrony (in that order)
# and will default to NTP if no default config is found.

# Like our resolv.conf hook script, we store a database of ntp.conf files
# and merge into /etc/ntp.conf

# You can set the env var NTP_CONF to override the derived default on
# systems with >1 NTP client installed.
# Here is an example for OpenNTP
#   dhcpcd -e NTP_CONF=/usr/pkg/etc/ntpd.conf
# or by adding this to /etc/dhcpcd.conf
#   env NTP_CONF=/usr/pkg/etc/ntpd.conf
# or by adding this to /etc/dhcpcd.enter-hook
#   NTP_CONF=/usr/pkg/etc/ntpd.conf
# To use Chrony instead, simply change ntpd.conf to chrony.conf in the
# above examples.

: ${ntp_confs:=ntp.conf ntpd.conf chrony.conf}
: ${ntp_conf_dirs=/etc /usr/pkg/etc /usr/local/etc}
ntp_conf_dir="$state_dir/ntp.conf"

# If NTP_CONF is not set, work out a good default
if [ -z "$NTP_CONF" ]; then
	for d in ${ntp_conf_dirs}; do
		for f in ${ntp_confs}; do
			if [ -e "$d/$f" ]; then
				NTP_CONF="$d/$f"
				break 2
			fi
		done
	done
	[ -e "$NTP_CONF" ] || NTP_CONF=/etc/ntp.conf
fi

# Derive service name from configuration
if [ -z "$ntp_service" ]; then
	case "$NTP_CONF" in
	*chrony.conf)		ntp_service=chronyd;;
	*)			ntp_service=ntpd;;
	esac
fi

# Debian has a seperate file for DHCP config to avoid stamping on
# the master.
if [ "$ntp_service" = ntpd ] && type invoke-rc.d >/dev/null 2>&1; then
	[ -e /var/lib/ntp ] || mkdir /var/lib/ntp
	: ${ntp_service:=ntp}
	: ${NTP_DHCP_CONF:=/var/lib/ntp/ntp.conf.dhcp}
fi

: ${ntp_restart_cmd:=service_condcommand $ntp_service restart}

ntp_conf=${NTP_CONF}
NL="
"

build_ntp_conf()
{
	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
			header="$header${header:+, }$x"
		done

		# Build a server list
		srvs=$(cd "$ntp_conf_dir";
			key_get_value "server " $interfaces)
		if [ -n "$srvs" ]; then
			for x in $(uniqify $srvs); do
				servers="${servers}server $x$NL"
			done
		fi
	fi

	# Merge our config into ntp.conf
	[ -e "$cf" ] && rm -f "$cf"
	[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"

	if [ -n "$NTP_DHCP_CONF" ]; then
		[ -e "$ntp_conf" ] && cp "$ntp_conf" "$cf"
		ntp_conf="$NTP_DHCP_CONF"
	elif [ -e "$ntp_conf" ]; then
		remove_markers "$signature_base" "$signature_base_end" \
			"$ntp_conf" > "$cf"
	fi

	if [ -n "$servers" ]; then
		echo "$signature_base${header:+ $from }$header" >> "$cf"
		printf %s "$servers" >> "$cf"
		echo "$signature_base_end${header:+ $from }$header" >> "$cf"
	else
		[ -e "$ntp_conf" -a -e "$cf" ] || return
	fi

	# If we changed anything, restart ntpd
	if change_file "$ntp_conf" "$cf"; then
		[ -n "$ntp_restart_cmd" ] && eval $ntp_restart_cmd
	fi
}

add_ntp_conf()
{
	cf="$ntp_conf_dir/$ifname"

	[ -e "$cf" ] && rm "$cf"
	[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
	if [ -n "$new_ntp_servers" ]; then
		for x in $new_ntp_servers; do
			echo "server $x" >> "$cf"
		done
	fi
	build_ntp_conf
}

remove_ntp_conf()
{
	if [ -e "$ntp_conf_dir/$ifname" ]; then
		rm "$ntp_conf_dir/$ifname"
	fi
	build_ntp_conf
}

# For ease of use, map DHCP6 names onto our DHCP4 names
case "$reason" in
BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
	new_ntp_servers="$new_dhcp6_sntp_servers"
;;
esac

if $if_up; then
	add_ntp_conf
elif $if_down; then
	remove_ntp_conf
fi
@


1.1.1.1.2.1
log
@file 50-ntp.conf was added on branch bouyer-socketcan on 2017-03-31 20:51:17 +0000
@
text
@d1 141
@


1.1.1.1.2.2
log
@2552809
@
text
@a0 141
# Sample dhcpcd hook script for NTP
# It will configure either one of NTP, OpenNTP or Chrony (in that order)
# and will default to NTP if no default config is found.

# Like our resolv.conf hook script, we store a database of ntp.conf files
# and merge into /etc/ntp.conf

# You can set the env var NTP_CONF to override the derived default on
# systems with >1 NTP client installed.
# Here is an example for OpenNTP
#   dhcpcd -e NTP_CONF=/usr/pkg/etc/ntpd.conf
# or by adding this to /etc/dhcpcd.conf
#   env NTP_CONF=/usr/pkg/etc/ntpd.conf
# or by adding this to /etc/dhcpcd.enter-hook
#   NTP_CONF=/usr/pkg/etc/ntpd.conf
# To use Chrony instead, simply change ntpd.conf to chrony.conf in the
# above examples.

: ${ntp_confs:=ntp.conf ntpd.conf chrony.conf}
: ${ntp_conf_dirs=/etc /usr/pkg/etc /usr/local/etc}
ntp_conf_dir="$state_dir/ntp.conf"

# If NTP_CONF is not set, work out a good default
if [ -z "$NTP_CONF" ]; then
	for d in ${ntp_conf_dirs}; do
		for f in ${ntp_confs}; do
			if [ -e "$d/$f" ]; then
				NTP_CONF="$d/$f"
				break 2
			fi
		done
	done
	[ -e "$NTP_CONF" ] || NTP_CONF=/etc/ntp.conf
fi

# Derive service name from configuration
if [ -z "$ntp_service" ]; then
	case "$NTP_CONF" in
	*chrony.conf)		ntp_service=chronyd;;
	*)			ntp_service=ntpd;;
	esac
fi

# Debian has a seperate file for DHCP config to avoid stamping on
# the master.
if [ "$ntp_service" = ntpd ] && type invoke-rc.d >/dev/null 2>&1; then
	[ -e /var/lib/ntp ] || mkdir /var/lib/ntp
	: ${ntp_service:=ntp}
	: ${NTP_DHCP_CONF:=/var/lib/ntp/ntp.conf.dhcp}
fi

: ${ntp_restart_cmd:=service_condcommand $ntp_service restart}

ntp_conf=${NTP_CONF}
NL="
"

build_ntp_conf()
{
	local cf="$state_dir/ntp.conf.$ifname"
	local interfaces= header= srvs= servers= x=

	# Build a list of interfaces
	interfaces=$(list_interfaces "$ntp_conf_dir")

	if [ -n "$interfaces" ]; then
		# Build the header
		for x in ${interfaces}; do
			header="$header${header:+, }$x"
		done

		# Build a server list
		srvs=$(cd "$ntp_conf_dir";
			key_get_value "server " $interfaces)
		if [ -n "$srvs" ]; then
			for x in $(uniqify $srvs); do
				servers="${servers}server $x$NL"
			done
		fi
	fi

	# Merge our config into ntp.conf
	[ -e "$cf" ] && rm -f "$cf"
	[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"

	if [ -n "$NTP_DHCP_CONF" ]; then
		[ -e "$ntp_conf" ] && cp "$ntp_conf" "$cf"
		ntp_conf="$NTP_DHCP_CONF"
	elif [ -e "$ntp_conf" ]; then
		remove_markers "$signature_base" "$signature_base_end" \
			"$ntp_conf" > "$cf"
	fi

	if [ -n "$servers" ]; then
		echo "$signature_base${header:+ $from }$header" >> "$cf"
		printf %s "$servers" >> "$cf"
		echo "$signature_base_end${header:+ $from }$header" >> "$cf"
	else
		[ -e "$ntp_conf" -a -e "$cf" ] || return
	fi

	# If we changed anything, restart ntpd
	if change_file "$ntp_conf" "$cf"; then
		[ -n "$ntp_restart_cmd" ] && eval $ntp_restart_cmd
	fi
}

add_ntp_conf()
{
	local cf="$ntp_conf_dir/$ifname" x=

	[ -e "$cf" ] && rm "$cf"
	[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
	if [ -n "$new_ntp_servers" ]; then
		for x in $new_ntp_servers; do
			echo "server $x" >> "$cf"
		done
	fi
	build_ntp_conf
}

remove_ntp_conf()
{
	if [ -e "$ntp_conf_dir/$ifname" ]; then
		rm "$ntp_conf_dir/$ifname"
	fi
	build_ntp_conf
}

# For ease of use, map DHCP6 names onto our DHCP4 names
case "$reason" in
BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
	new_ntp_servers="$new_dhcp6_sntp_servers"
;;
esac

if $if_up; then
	add_ntp_conf
elif $if_down; then
	remove_ntp_conf
fi
@


1.1.1.1.4.1
log
@file 50-ntp.conf was added on branch pgoyette-localcount on 2017-04-26 02:52:23 +0000
@
text
@d1 141
@


1.1.1.1.4.2
log
@Sync with HEAD
@
text
@a0 141
# Sample dhcpcd hook script for NTP
# It will configure either one of NTP, OpenNTP or Chrony (in that order)
# and will default to NTP if no default config is found.

# Like our resolv.conf hook script, we store a database of ntp.conf files
# and merge into /etc/ntp.conf

# You can set the env var NTP_CONF to override the derived default on
# systems with >1 NTP client installed.
# Here is an example for OpenNTP
#   dhcpcd -e NTP_CONF=/usr/pkg/etc/ntpd.conf
# or by adding this to /etc/dhcpcd.conf
#   env NTP_CONF=/usr/pkg/etc/ntpd.conf
# or by adding this to /etc/dhcpcd.enter-hook
#   NTP_CONF=/usr/pkg/etc/ntpd.conf
# To use Chrony instead, simply change ntpd.conf to chrony.conf in the
# above examples.

: ${ntp_confs:=ntp.conf ntpd.conf chrony.conf}
: ${ntp_conf_dirs=/etc /usr/pkg/etc /usr/local/etc}
ntp_conf_dir="$state_dir/ntp.conf"

# If NTP_CONF is not set, work out a good default
if [ -z "$NTP_CONF" ]; then
	for d in ${ntp_conf_dirs}; do
		for f in ${ntp_confs}; do
			if [ -e "$d/$f" ]; then
				NTP_CONF="$d/$f"
				break 2
			fi
		done
	done
	[ -e "$NTP_CONF" ] || NTP_CONF=/etc/ntp.conf
fi

# Derive service name from configuration
if [ -z "$ntp_service" ]; then
	case "$NTP_CONF" in
	*chrony.conf)		ntp_service=chronyd;;
	*)			ntp_service=ntpd;;
	esac
fi

# Debian has a seperate file for DHCP config to avoid stamping on
# the master.
if [ "$ntp_service" = ntpd ] && type invoke-rc.d >/dev/null 2>&1; then
	[ -e /var/lib/ntp ] || mkdir /var/lib/ntp
	: ${ntp_service:=ntp}
	: ${NTP_DHCP_CONF:=/var/lib/ntp/ntp.conf.dhcp}
fi

: ${ntp_restart_cmd:=service_condcommand $ntp_service restart}

ntp_conf=${NTP_CONF}
NL="
"

build_ntp_conf()
{
	local cf="$state_dir/ntp.conf.$ifname"
	local interfaces= header= srvs= servers= x=

	# Build a list of interfaces
	interfaces=$(list_interfaces "$ntp_conf_dir")

	if [ -n "$interfaces" ]; then
		# Build the header
		for x in ${interfaces}; do
			header="$header${header:+, }$x"
		done

		# Build a server list
		srvs=$(cd "$ntp_conf_dir";
			key_get_value "server " $interfaces)
		if [ -n "$srvs" ]; then
			for x in $(uniqify $srvs); do
				servers="${servers}server $x$NL"
			done
		fi
	fi

	# Merge our config into ntp.conf
	[ -e "$cf" ] && rm -f "$cf"
	[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"

	if [ -n "$NTP_DHCP_CONF" ]; then
		[ -e "$ntp_conf" ] && cp "$ntp_conf" "$cf"
		ntp_conf="$NTP_DHCP_CONF"
	elif [ -e "$ntp_conf" ]; then
		remove_markers "$signature_base" "$signature_base_end" \
			"$ntp_conf" > "$cf"
	fi

	if [ -n "$servers" ]; then
		echo "$signature_base${header:+ $from }$header" >> "$cf"
		printf %s "$servers" >> "$cf"
		echo "$signature_base_end${header:+ $from }$header" >> "$cf"
	else
		[ -e "$ntp_conf" -a -e "$cf" ] || return
	fi

	# If we changed anything, restart ntpd
	if change_file "$ntp_conf" "$cf"; then
		[ -n "$ntp_restart_cmd" ] && eval $ntp_restart_cmd
	fi
}

add_ntp_conf()
{
	local cf="$ntp_conf_dir/$ifname" x=

	[ -e "$cf" ] && rm "$cf"
	[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
	if [ -n "$new_ntp_servers" ]; then
		for x in $new_ntp_servers; do
			echo "server $x" >> "$cf"
		done
	fi
	build_ntp_conf
}

remove_ntp_conf()
{
	if [ -e "$ntp_conf_dir/$ifname" ]; then
		rm "$ntp_conf_dir/$ifname"
	fi
	build_ntp_conf
}

# For ease of use, map DHCP6 names onto our DHCP4 names
case "$reason" in
BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
	new_ntp_servers="$new_dhcp6_sntp_servers"
;;
esac

if $if_up; then
	add_ntp_conf
elif $if_down; then
	remove_ntp_conf
fi
@


