head	1.3;
access;
symbols
	netbsd-11-0-RC4:1.3
	netbsd-11-0-RC3:1.3
	dhcpcd-10_3_1:1.1.1.4
	netbsd-11-0-RC2:1.3
	netbsd-11-0-RC1:1.3
	perseant-exfatfs-base-20250801:1.3
	netbsd-11:1.3.0.4
	netbsd-11-base:1.3
	dhcpcd-10_2_3:1.1.1.4
	dhcpcd-10_2_2:1.1.1.4
	dhcpcd-10_2_0a:1.1.1.4
	dhcpcd-10_2_0:1.1.1.4
	netbsd-10-1-RELEASE:1.2
	perseant-exfatfs-base-20240630:1.3
	perseant-exfatfs:1.3.0.2
	perseant-exfatfs-base:1.3
	dhcpcd-10_0_8:1.1.1.4
	dhcpcd-10_0_7:1.1.1.4
	netbsd-8-3-RELEASE:1.1.1.1.8.2
	netbsd-9-4-RELEASE:1.2
	netbsd-10-0-RELEASE:1.2
	netbsd-10-0-RC6:1.2
	netbsd-10-0-RC5:1.2
	netbsd-10-0-RC4:1.2
	netbsd-10-0-RC3:1.2
	netbsd-10-0-RC2:1.2
	dhcpcd-10_0_6a:1.1.1.4
	dhcpcd-10_0_6:1.1.1.4
	netbsd-10-0-RC1:1.2
	dhcpcd-10_0_4:1.1.1.4
	dhcpcd-10_0_3:1.1.1.4
	dhcpcd-10_0_2:1.1.1.4
	dhcpcd-10_0_1:1.1.1.4
	netbsd-10:1.2.0.10
	netbsd-10-base:1.2
	netbsd-9-3-RELEASE:1.2
	dhcpcd-9_4_1:1.1.1.3
	cjep_sun2x-base1:1.2
	cjep_sun2x:1.2.0.8
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	netbsd-9-2-RELEASE:1.2
	cjep_staticlib_x:1.2.0.6
	cjep_staticlib_x-base:1.2
	dhcpcd-9_4_0:1.1.1.3
	dhcpcd-9_3_4:1.1.1.3
	dhcpcd-9_3_3:1.1.1.3
	dhcpcd-9_3_2:1.1.1.3
	netbsd-9-1-RELEASE:1.2
	dhcpcd-9_3_1:1.1.1.3
	dhcpcd-9_3_0:1.1.1.3
	dhcpcd-9_2_0:1.1.1.3
	dhcpcd-9_1_4:1.1.1.3
	dhcpcd-9_1_3:1.1.1.3
	dhcpcd-9_1_2:1.1.1.3
	dhcpcd-9_1_1:1.1.1.3
	dhcpcd-9_1_0:1.1.1.3
	phil-wifi-20200421:1.2
	dhcpcd-9_0_2:1.1.1.3
	dhcpcd-9_0_1:1.1.1.3
	phil-wifi-20200411:1.2
	is-mlppp:1.2.0.4
	is-mlppp-base:1.2
	phil-wifi-20200406:1.2
	dhcpcd-9_0_0:1.1.1.3
	netbsd-8-2-RELEASE:1.1.1.1.8.2
	netbsd-9-0-RELEASE:1.2
	netbsd-9-0-RC2:1.2
	dhcpcd-8_1_6:1.1.1.3
	dhcpcd-8_1_5:1.1.1.3
	dhcpcd-8_1_4:1.1.1.3
	dhcpcd-8_1_3:1.1.1.3
	netbsd-9-0-RC1:1.2
	phil-wifi-20191119:1.2
	dhcpcd-8_1_2:1.1.1.3
	dhcpcd-8_1_1:1.1.1.3
	dhcpcd-8_1_0:1.1.1.3
	ROY:1.1.1
	dhcpcd-8-0-6:1.1.1.3
	dhcpcd-8-0-5:1.1.1.3
	dhcpcd-8-0-4:1.1.1.3
	dhcpcd-8-0-3:1.1.1.3
	netbsd-9:1.2.0.2
	netbsd-9-base:1.2
	dhcpcd-8-0-2:1.1.1.3
	dhcpcd-8-0-1:1.1.1.3
	dhcpcd-8-0-0:1.1.1.3
	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.3
date	2023.04.21.16.54.26;	author roy;	state Exp;
branches;
next	1.2;
commitid	RSjPPlaT2zc9QZlE;

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	2023.04.21.16.52.46;	author roy;	state Exp;
branches;
next	;
commitid	SzhZ9f5ppzfOOZlE;

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	;
commitid	jtc8rnCzWiEEHGqB;

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.3
log
@Merge changes
@
text
@# Lookup the hostname in DNS if not set

lookup_hostname()
{
	[ -z "$new_ip_address" ] && return 1
	# Silly ISC programs love to send error text to stdout
	if command -v dig >/dev/null 2>&1; then
		h=$(dig +short -x $new_ip_address)
		if [ $? = 0 ]; then
			echo "$h" | sed 's/\.$//'
			return 0
		fi
	elif command -v host >/dev/null 2>&1; then
		h=$(host $new_ip_address)
		if [ $? = 0 ]; then 
			echo "$h" \
			| sed 's/.* domain name pointer \(.*\)./\1/'
			return 0
		fi
	elif command -v getent >/dev/null 2>&1; then
		h=$(getent hosts $new_ip_address)
		if [ $? = 0 ]; then
			echo "$h" | sed 's/[^ ]* *\([^ ]*\).*/\1/'
			return 0
		 fi
	fi
	return 1
}

set_hostname()
{
	if [ -z "${new_host_name}${new_fqdn_name}" ]; then
		export new_host_name="$(lookup_hostname)"
	fi
}

if $if_up; then
	set_hostname
fi
@


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
@d7 1
a7 1
	if type dig >/dev/null 2>&1; then
d13 1
a13 1
	elif type host >/dev/null 2>&1; then
d20 1
a20 1
	elif type getent >/dev/null 2>&1; then
@


1.1
log
@Initial revision
@
text
@a5 1
	local h=
d32 1
a32 1
	if [ -z "$new_host_name" -a -z "$new_fqdn_name" ]; then
@


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
@d6 1
@


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
@d32 1
a32 1
	if [ -z "${new_host_name}${new_fqdn_name}" ]; then
@


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
@d6 1
@


1.1.1.2.4.1
log
@Sync with HEAD
@
text
@d32 1
a32 1
	if [ -z "${new_host_name}${new_fqdn_name}" ]; then
@


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
@d32 1
a32 1
	if [ -z "${new_host_name}${new_fqdn_name}" ]; then
@


1.1.1.4
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
@d7 1
a7 1
	if command -v dig >/dev/null 2>&1; then
d13 1
a13 1
	elif command -v host >/dev/null 2>&1; then
d20 1
a20 1
	elif command -v getent >/dev/null 2>&1; then
@


1.1.1.2.2.1
log
@Ssync with HEAD
@
text
@d32 1
a32 1
	if [ -z "${new_host_name}${new_fqdn_name}" ]; then
@


1.1.1.2.6.1
log
@file 29-lookup-hostname was added on branch netbsd-7 on 2018-07-27 10:43:20 +0000
@
text
@d1 39
@


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 39
# Lookup the hostname in DNS if not set

lookup_hostname()
{
	[ -z "$new_ip_address" ] && return 1
	# 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)
		if [ $? = 0 ]; then
			echo "$h" | sed 's/\.$//'
			return 0
		fi
	elif type host >/dev/null 2>&1; then
		h=$(host $new_ip_address)
		if [ $? = 0 ]; then 
			echo "$h" \
			| sed 's/.* domain name pointer \(.*\)./\1/'
			return 0
		fi
	elif type getent >/dev/null 2>&1; then
		h=$(getent hosts $new_ip_address)
		if [ $? = 0 ]; then
			echo "$h" | sed 's/[^ ]* *\([^ ]*\).*/\1/'
			return 0
		 fi
	fi
	return 1
}

set_hostname()
{
	if [ -z "$new_host_name" -a -z "$new_fqdn_name" ]; then
		export new_host_name="$(lookup_hostname)"
	fi
}

if $if_up; then
	set_hostname
fi
@


1.1.1.1.2.1
log
@file 29-lookup-hostname was added on branch bouyer-socketcan on 2017-03-31 20:51:17 +0000
@
text
@d1 40
@


1.1.1.1.2.2
log
@2552809
@
text
@a0 40
# Lookup the hostname in DNS if not set

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)
		if [ $? = 0 ]; then
			echo "$h" | sed 's/\.$//'
			return 0
		fi
	elif type host >/dev/null 2>&1; then
		h=$(host $new_ip_address)
		if [ $? = 0 ]; then 
			echo "$h" \
			| sed 's/.* domain name pointer \(.*\)./\1/'
			return 0
		fi
	elif type getent >/dev/null 2>&1; then
		h=$(getent hosts $new_ip_address)
		if [ $? = 0 ]; then
			echo "$h" | sed 's/[^ ]* *\([^ ]*\).*/\1/'
			return 0
		 fi
	fi
	return 1
}

set_hostname()
{
	if [ -z "$new_host_name" -a -z "$new_fqdn_name" ]; then
		export new_host_name="$(lookup_hostname)"
	fi
}

if $if_up; then
	set_hostname
fi
@


1.1.1.1.4.1
log
@file 29-lookup-hostname was added on branch pgoyette-localcount on 2017-04-26 02:52:23 +0000
@
text
@d1 40
@


1.1.1.1.4.2
log
@Sync with HEAD
@
text
@a0 40
# Lookup the hostname in DNS if not set

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)
		if [ $? = 0 ]; then
			echo "$h" | sed 's/\.$//'
			return 0
		fi
	elif type host >/dev/null 2>&1; then
		h=$(host $new_ip_address)
		if [ $? = 0 ]; then 
			echo "$h" \
			| sed 's/.* domain name pointer \(.*\)./\1/'
			return 0
		fi
	elif type getent >/dev/null 2>&1; then
		h=$(getent hosts $new_ip_address)
		if [ $? = 0 ]; then
			echo "$h" | sed 's/[^ ]* *\([^ ]*\).*/\1/'
			return 0
		 fi
	fi
	return 1
}

set_hostname()
{
	if [ -z "$new_host_name" -a -z "$new_fqdn_name" ]; then
		export new_host_name="$(lookup_hostname)"
	fi
}

if $if_up; then
	set_hostname
fi
@


