Commit Graph

51 Commits

Author SHA1 Message Date
christos 1faf623fbf fix clang lint build (except for the programs that enables -T) 2024-05-08 16:53:34 +00:00
christos 2c7f81b1f9 fix the version number. 2024-02-28 18:14:43 +00:00
christos 78193792d6 fix static build 2024-02-19 20:39:13 +00:00
christos 4afad4b7fa Disentangle dhcp from bind by putting enough of bind 9.16.42 for it to build
here. Bind keeps removing the bits that dhcp uses to build and keeping bind
up-to-date and dhcp building is a losing battle.
2024-02-18 20:57:30 +00:00
tnn d06800dd8e dhcpd: move isc_event_free() before isc_timer_destroy() in timer cb
isc_timerevent_destroy() called by isc_event_free() expects to be able to
hold the timer lock, so must run before the timer is destroyed.
PR misc/57491.
2023-07-27 10:32:25 +00:00
martin b01ac68763 isc timer API changed with the recent bind import - use isc_timer_destroy()
instead of isc_timer_detach()
2023-06-27 09:10:25 +00:00
lukem bd392dcb93 adapt to ${CC_WNO_STRINGOP_OVERFLOW}
Use ${CC_WNO_STRINGOP_OVERFLOW} instead of
the older style more complex expressions.

Remove workarounds if they were only for gcc < 10.
2023-06-03 21:33:01 +00:00
lukem 39588391d2 dhcp: remove gcc 8 workaround
(if it's needed, add it back using ${CC_WNO_FORMAT_OVERFLOW})
2023-06-03 21:27:11 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
christos a2e0c34f12 Apply security fixes:
https://downloads.isc.org/isc/dhcp/4.4.3-P1/patches/CVE-2022-2928.4-4-3.diff
https://downloads.isc.org/isc/dhcp/4.4.3-P1/patches/CVE-2022-2929.4-4-3.diff
2022-10-05 22:20:15 +00:00
christos 1856c2b98e Adjust to new bind libraries 2022-09-23 12:30:52 +00:00
christos f407d9293b Merge conflicts between dhcp-4.4.2P1 and dhcp-4.4.3 2022-04-03 01:10:57 +00:00
christos 41e8421f37 Import dhcp-4.4.3
Changes since 4.4.2-P1 (New Features)

- Two new OMAPI function calls were added, `dhcpctl_timed_connect()`
  and `dhcpctl_timed_wait_for_completion()`. These provide timed
  versions of creating a connection and waiting for an operation
  to complete.
  [GitLab #76]

- The BIND libraries have been updated to the latest version, 9.11.36.
  This fixes a number of compilation issues on various systems, including
  OpenWRT. Thanks to Philip Prindeville for testing on OpenWRT.
  [GitLab #218, #171, #180, #192]

- Support was added for the new DHCPv4 option v6-only-preferred, specified
  in RFC 8925. A new reason code, V6ONLY, was added to the client script
  and the client Linux script sample was updated.
  [GitLab #132]

		Changes since 4.4.2-P1 (Bug Fixes)

- Minor corrections were made to allow compilation under gcc 10.
  [GitLab #117]

- The logic in dhclient that causes it to decline DHCPv4 leases if the
  client script exits abnormally (i.e. crashes) has been corrected.
  [GitLab #123]

- The limit on the size of a lease file that can be loaded at startup
  is now only enforced on 32-bit systems.
  [GitLab #92]

- The PRNG initialization has been improved. It now uses the configure flag
  `--with-randomdev=PATH`, which specifies the device from which to read the
  initial seed. That is typically `/dev/random` (the default value) or
  `/dev/urandom`, but may be specified otherwise on the local system. The old
  behavior can be forced by disabling this feature (`--with-randomdev=no`).
  If the initialization is disabled or reading from the random device fails,
  the previous algorithm (retrieve the last four bytes of hardware addresses
  from all network interfaces that have them, and use the current time and
  process ID) is used.
  [GitLab #197]

- A minor dhclient code fix was made to remove compilation warnings.
  [GitLab #190]

- The hard-coded MD5 algorithm name was removed in OMAPI connection logic.
  Previously, using any other algorithm via a key-algorithm statement would
  allow OMAPI connections to be made, but subsequent actions such as updating
  an object would fail.
  [GitLab #148]

- The parallel build has been improved. Thanks to Sergei Trofimovich for
  the patch. The parallel build is still experimental, as officially the
  BIND 9 code does not support the parallel build for libraries.
  [GitLab #91]

- Handling of LDAP options (`ldap-gssapi-principal` and `ldap-gssapi-keytab`)
  has been improved. This is contributed code that has not been tested by ISC.
  Thank you to Petr Mensik and Pavel Zhukov for the patches!
  [GitLab !56,!75]

- It is now possible to use `option -g ipaddr` in the dhcrelay to replace the
  giaddr sent to clients with the given ipaddr, to work around bogus clients
  like Solaris 11 grub which use giaddr instead of the announced router (3)
  to set up their default route. Thanks to Jens Elkner for the patch!
  [GitLab #223, !86, !92]
2022-04-03 01:08:35 +00:00
christos 4d912a20e8 Bump the number of "workers" to 2 which effectively bumps the number of
contexts to 8. We seem to need 5 contexts so that should stop the error
checking to hp_retire() from triggering.
2022-01-30 19:47:04 +00:00
christos aa8201fa1e Adjust for bind-9.16.20 2021-08-19 11:50:56 +00:00
christos 946275102f merge local changes between dhcp-4.4.2 and dhcp-4.4.2-P1 2021-05-26 22:52:31 +00:00
christos 2e8b2e06c5 Import dhcp-4.4.2-P1:
! Corrected a buffer overwrite possible when parsing hexadecimal
   literals with more than 1024 octets. Reported by Jon Franklin from Dell,
   and also by Pawel Wieczorkiewicz from Amazon Web Services.
   [Gitlab #182]
   CVE: CVE-2021-25217
2021-05-26 22:48:40 +00:00
christos 2f967ad4a3 Add missing call to libdhcp_callbacks_register(). Should stop
dhcrelay() crashing when accessing *libdhcp_callbacks.local_port.
(from mrg@)
2021-05-21 21:07:37 +00:00
mrg 97b36aa771 more GCC 10 fixes.
mDNSResponder: another wrong return local address

dhcp: ignore a seemingly impossible stringop overflow

hpacel: avoid maybe uninitialised error that is wrong.

rsh: avoid impossible malloc(0)

udf: cast pointers through (uintptr_t) to fool invalid boundary checks
2021-04-13 06:25:48 +00:00
mrg 72ab974e26 use -fcommon here too. 2021-04-13 04:14:46 +00:00
christos a10402a4f1 libisc needs libssl now 2021-02-20 01:43:04 +00:00
christos a98351bd74 Reset options on every loop. 2021-01-13 17:01:31 +00:00
christos 7e0da10f84 If an option is not found in the standard table, log it and don't try to
dereference it. This prevents crashes from XenServer VM that PXE boots and
includes option 175 in the DHCP request. Reported by Stephen Borrill.
2021-01-13 15:51:49 +00:00
rin a8c74629f6 Support aarch64eb in */config.guess.
Cherry-picked from upstream:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=commit;h=1c4398015583eb77bc043234f5734be055e64bea

Everything except external/apache2/llvm/dist/llvm/cmake/config.guess
is patched, which is under vendor tag and cannot be modified. I expect
that this file is not actually used as we use hand-crafted version of
configure script instead of cmake for building LLVM.

Note that external/apache2/llvm/autoconf/autoconf/config.guess has
already been committed on Oct. 20, but commit message disappeared as
cvs aborted due to "permission denied" when trying to modify the file
mentioned above. Sorry for confusing you.

Also note that GMP uses its own config.guess Patch for
external/lgpl3/gmp/dist/config.guess is provided by ryo@. Thanks!
2020-11-17 10:35:10 +00:00
christos a7e74f3dc5 Don't use static buffers to store format strings; this is a multi-threaded
program and if we print from multiple threads we can end up overwriting the
formats while printf is formating and that can end up in tears.
2020-11-12 22:11:03 +00:00
christos 56e2dc54c3 Merge conflicts 2020-08-03 21:10:56 +00:00
christos f9d8f0dfa6 Internet Systems Consortium DHCP Distribution
Version 4.4.2
                            22 January 2020
                             Release Notes

                              NEW FEATURES

Please note that that ISC DHCP is now licensed under the Mozilla Public License,
MPL 2.0. Please see https://www.mozilla.org/en-US/MPL/2.0/ to read the MPL 2.0
license terms.

While release 4.4.2 is primarily a maintenance release that addresses a number
of defects, it does introduce a few new features:

- Keama - Keama is a migration utility that assists in converting ISC DHCP
  server configuration files to Kea configuration files.  It is found in the
  keama subdirectory and includes a README.md file with instructions on how
  to build it as well as a manpage on its usage.

- Two new server parameters related to ping checking were added:

1. ping-cltt-secs which allows the user to specify the number of seconds
   that must elapse since CLTT before a ping check is conducted.

2. ping-timeout-ms which allows the user to specify the amount of time the
   server waits for a ping-check response in milliseconds rather than in
   seconds.

In general, the areas of focus for ISC DHCP 4.4 were:

1. Dynamic DNS additions
2. dhclient improvements
3. Support for dynamic shared libraries

Dynamic DNS Improvements:

- We added three new server configuration parameters which influence DDNS
  conflict resolution:

    1. ddns-dual-stack-mixed-mode - alters DNS conflict resolution behavior
    to mitigate issues with non-compliant clients in dual stack environments.

    2. ddns-guard-id-must-match - relaxes the DHCID RR client id matching
    requirement of DNS conflict resolution.

    3. ddns-other-guard-is-dynamic - alters dual-stack-mixed-mode behavior to
    allow unguarded DNS entries to be overwritten in certain cases

- The server now honors update-static-leases parameter for static DHCPv6
  hosts.

dhclient Improvements:

  - We've added three command line parameters to dhclient:

    1. --prefix-len-hint - directs dhclient to use the given length as
    the prefix length hint when requesting prefixes

    2. --decline-wait-time - instructs the client to wait the given number
    of seconds after declining an IPv4 address before issuing a discover

    3. --address-prefix-len - specifies the prefix length passed by dhclient
    into the client script (via the environment variable ip6_prefixlen) with
    each IPv6 address.  We added this parameter because we have changed the
    default value from 64 to 128 in order to be compliant with RFC3315bis
    draft (-09, page 64) and RFC5942, Section 4, point 1.
    **WARNING**: The new default value of 128 may not be backwardly compatible
    with your environment. If you are operating without a router, such as
    between VMs on a host, you may find they cannot see each other with prefix
    length of 128. In such cases, you'll need to either provide routing or use
    the command line parameter to set the value to 64. Alternatively you may
    change the default at compile time by setting DHCLIENT_DEFAULT_PREFIX_LEN
    in includes/site.h.

  - dhclient will now generate a DHCPv6 DECLINE message when the client script
    indicates a DAD failure

Dynamic shared library support:

  Configure script, configure.ac+lt, which supports libtool is now provided
  with the source tar ball.  This script can be used to configure ISC DHCP
  to build with libtool and thus use dynamic shared libraries.

Other Highlights:

 - The server now supports dhcp-cache-threshold for DHCPv6 operations
 - The server now supports DHPv6 address allocation based on EUI-64 DUIDs
 - Experimental support for alternate relay port in the both the server
   and relay for IPv4, IPv6 and 4o6 (see: draft-ietf-dhc-relay-port-10.txt)

For information on how to install, configure and run this software, as
well as how to find documentation and report bugs, please consult the
README file.

ISC DHCP uses standard GNU configure for installation. Please review the
output of "./configure --help" to see what options are available.

The system has only been tested on Linux, FreeBSD, and Solaris, and may not
work on other platforms. Please report any problems and suggested fixes to
<dhcp-users@isc.org>.

ISC DHCP is open source software maintained by Internet Systems
Consortium.  This product includes cryptographic software written
by Eric Young (eay@cryptsoft.com).

		Changes since 4.4.2b1 (Bug Fixes)

- Added a clarification on DHCPINFORMs and server authority to
  dhcpd.conf.5
  [Gitlab #37]

- Only emit lease scrubbing log messages when DEBUG_FAILOVER_MESSAGES
  is defined.
  [Gitlab #72]

- Added the interface name to socket initialization failure log messages.
  Prior to this the log messages stated only the error reason without
  stating the target interface.
  [Gitlab #75]

- Corrected buffer pointer logic in dhcrelay functions that manipulate
  agent relay options. Thanks to Thomas Imbert of MSRC Vulnerabilities
  & Mitigations for reporting the issue.
  [#71]

- Corrected unresolved symbol errors building relay_unittests when
  configured to build using libtool.
  [#80]

		Changes since 4.4.1 (New Features)

- A new configuration parameter, ping-cltt-secs (v4 operation only), has
  been added to allow the user to specify the number of seconds that must
  elapse since CLTT before a ping check is conducted.  Prior to this, the
  value was hard coded at 60 seconds.  Please see the server man pages for
  a more detailed discussion.
  [ISC-Bugs #36283]

- A new configuration parameter, ping-timeout-ms (v4 operation only),
  has been added that allows the user to specify the amount of time
  the server waits for a ping-check response in milliseconds rather
  than in seconds (via ping-timeout). When greater than zero, the value
  of ping-timeout-ms will override the value of ping-timeout.  Thanks
  to Jay Doran from Bluecat Networks for suggesting this feature.
  [Gitlab #10]

- An experimental tool called, Keama (KEA Migration Assistant), which helps
  translate ISC DHCP configurations to Kea configurations, is now included
  in the distribution.
  [Gitlab #34]

		Changes since 4.4.1 (Bug Fixes)

- Corrected a misuse of the BIND9 DDNS API which caused DDNS updates to be
  carried out over TCP rather than UDP. The coding error was exposed by
  migration to BIND9 9.11.  Thanks to Jinmei Tatuya at Infoblox for
  reporting the issue.
  [ISC-Bugs #47757]

- Bind9 now defaults to requiring python to build. The Makefile for
  building Bind9 when bundled with ISC DHCP was modified to turn off
  this dependency.
  [Gitlab #3]

- Corrected a dual-stack mixed-mode issue that occurs when both
  ddns-guard-id-must-match and ddns-other-guard-is-dynamic
  are enabled and that caused the server to incorrectly interpret
  the presence of a guard record belonging to another client as
  a case of no guard record at all.  Thanks to Fernando Soto
  from BlueCat Networks for reporting this issue.
  [Gitlab #1]

- Corrected a compilation issue that occurred when building without DNS
  update ability (e.g. by undefining NSUPDATE).
  [Gitlab #16]

- Corrected an issue that was causing the server, when running in
  DHPCv4 mode, to segfault when class lease limits are reached.
  Thanks to Peter Nagy at Porion-Digital for reporting the matter
  and submitting a patch.
  [Gitlab #13]

- Made minor changes to eliminate warnings when compiled with GCC 9.
  Thanks to Brett Neumeier for bringing the matter to our attention.
  [Gitlab #15]

- Fixed potential memory leaks in parser error message generation
  spotted by Coverity, CIDs: 1448191, 1448193, 1448194, 1448195
  [Gitlab #30]

- Updated URL of IEEE oui.txt in contrib/dhcp-lease-list.pl. Thanks
  to Tommy Smith for contributing the patch.
  [Gitlab #26]

- Fixed define flags when using SO_BINDTODEVICE. Thanks to Joe LeVeque for
  reporting the issue.
  [GitLab #19]

- Applied a patch from OpenBSD to always set the scope id of outbound
  DHPCv6 packets.  Note this change only applies when compiling under
  OpenBSD.  Thanks to Brad Smith at OpenBSD from bringing it to our
  attention.
  [Gitlab #33]

- Modified dhclient to not discard config file leases that are
  duplicates of server-provided leases and to retain such leases
  after they have been used as the fallback active lease and
  DHCP service has been restored.  This allows them to be used
  more than once during the lifetime of a dhclient instance.
  This applies to DHCPv4 operation only.
  [Gitlab #9]

- Corrected a number of reference counter and zero-length buffer leaks.
  Thanks to Christopher Ertl of MSRC Vulnerabilities & Mitigations for
  pointing them out.
  [Gitlab #57]

- Closed a small window of time between the installation of graceful
  shutdown signal handlers and application context startup, during which
  the receipt of shutdown signal would cause a REQUIRE() assertion to
  occur.  Note this issue is only visible when compiling with
  ENABLE_GENTLE_SHUTDOWN defined.
  [Gitlab #53]

- Corrected a buffer overflow that can occur when retrieving zone
  names that are more than 255 characters in length.
  [Gitlab #20]

- The "d" domain name option format was incorrectly handled as text
  instead of RFC 1035 wire format. Thanks to Jay Doran at BlueCat Networks
  for reporting this issue.
  [Gitlab #2]

- Improved the error message issued when a host declaration has both
  a uid and a dhcp-client-identifier. Server configuration parsing will
  now fail if a host declaration specifies more than one uid.
  [Gitlab #7]

- Updated developer's documentation on building and running unit tests.
  Removed support for --with-atf=bind as BIND9 no longer bundles in ATF
  source.
  [Gitlab #35]

- Fixed a syntax error in ldap.c which cropped up under Ubuntu
  18.04.1/gcc 7.4.0. Thanks to Charles Hedrick for pointing it out.
  [Gitlab #51]

- Added clarification to dhcp-options.5 section on ip-address values
  describing the first-use DNS resolution of options with hostnames as
  values (e.g. next-server).
  [Gitlab #28]

- The option format for the server option omapi-key was changed to a
  format type 'k' (key name); while server options ldap-port and
  ldap-init-retry were changed to 'L' (unsigned 32-bit integer). These
  three options were inadvertantly broken when the 'd' format content
  was changed to comply with RFC 1035 wire format (see Gitlab #2).
  [Gitlab #68]
2020-08-03 21:09:06 +00:00
fox 6ed49867f1 external/mpl/dhcp: Suppress -Werror=stringop-truncation error
This logic correctly uses strncpy(3) to fully initialize a fixed-width field, and also ensures
NUL-termination on the next line as other users of the field expect.

Add -Werror=stringop-truncation to prevent build failure, when run with MKSANITIZER=yes.

Error was reported when build.sh was run with MKSANITIZER=yes flag.

Reviewed by: kamil@
2020-06-07 23:29:16 +00:00
christos e4bfa5b301 Make libuv private, requested by joerg@ 2020-05-30 20:47:58 +00:00
christos 87a2227e1c Fix static build 2020-05-25 15:37:50 +00:00
christos 89d8187610 Adjust for bind-9.16.3 2020-05-24 19:50:12 +00:00
rin 10afa7e5af GCC8 needs -Wno-stringop-overflow also for m68000 (sun2). 2020-05-23 00:32:42 +00:00
manu 96922cbd05 crunchgen fix
Make sure local_port is not shared within a crunchgen binary. There is
more to do to get full functionnality in crunchgen, but at least this
change makes dhcpd listen on the right port again.
2020-05-15 12:31:03 +00:00
fox e7f517aadc external/mpl/dhcp: Fix build failure under LLVM.
-Wno-error= flag now only applies to gcc 8 and not to LLVM based builds.

Reviewed by: kamil@
2020-02-12 00:41:50 +00:00
fox 84139b589c external/mpl/dhcp: Suppress -Werror=format-overflow error.
Add -Wno-error=format-overflow mdb6.c to prevent build failure.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
2020-02-09 07:59:44 +00:00
christos 5f3439069b Looks like builtin_object_size does not work properly on sh3... 2019-10-30 00:25:00 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
christos 99911da960 Catch up with bind 2019-02-25 02:31:57 +00:00
christos 42d33e97c5 Remove the copy of bind?!?! used for its libraries... 2019-02-08 20:29:05 +00:00
mrg fd676684f8 - avoid uninitialised memory usage 2019-02-04 04:37:50 +00:00
christos 9807f7d153 apparently the fdwatch crap is needed, so undo the ifdefs. 2019-01-27 01:51:50 +00:00
christos 2221858336 Gut omapip support since the socket stuff to support it is gone, and
adjust to the new isc library reality.
2019-01-10 17:41:47 +00:00
christos 7de69a40b6 Add libz for new libisc needing it. 2018-08-12 15:39:22 +00:00
roy b729dec75a Remove dhclient from the base system.
Discussed here:
https://mail-index.netbsd.org/tech-userlevel/2018/06/21/msg011233.html
2018-06-29 12:34:13 +00:00
christos d91bf8b52c Explain the -Bstatic -Bdynamic dance. 2018-06-22 20:48:43 +00:00
kamil 69ca0c2f24 Make building of dhcp compatible with MKSANITIZER
Disable LD flags (-Wl,-Bstatic and -Wl,-Bdynamic) with enabled MKSANITIZER.
These options are incompatible with the current design of sanitizers,
because they cause duplication of symbols into programs and thus symbols
from the interceptors from sanitizers cannot be linked.

This change makes effectively mounting /usr required for dhcp programs like
dhclient(8).
2018-06-21 11:02:48 +00:00
christos bbc1fb973a PR/50893: Bruce Lilly: Handle carp interfaces.
XXX: pullup-8 (in src/external/bsd/dhcp/dist/common/bpf.c)
2018-06-01 00:42:49 +00:00
christos ce893c7eea sync our changes. 2018-04-07 22:37:29 +00:00
christos a41ce0a430 now mpl 2018-04-07 22:34:51 +00:00
christos 6fb29d2928 import dhcp-4.4.1 2018-04-07 22:34:17 +00:00