diff --git a/base/dhcp/debian/deb_patches/dhclient-dhcp6-set-hostname.patch b/base/dhcp/debian/deb_patches/0001-dhclient-dhcp6-set-hostname.patch similarity index 53% rename from base/dhcp/debian/deb_patches/dhclient-dhcp6-set-hostname.patch rename to base/dhcp/debian/deb_patches/0001-dhclient-dhcp6-set-hostname.patch index 6e0394774..9cea9fdd9 100644 --- a/base/dhcp/debian/deb_patches/dhclient-dhcp6-set-hostname.patch +++ b/base/dhcp/debian/deb_patches/0001-dhclient-dhcp6-set-hostname.patch @@ -1,10 +1,20 @@ +From 023d0adcb43db65e64841af6349a0326d2cb1e14 Mon Sep 17 00:00:00 2001 +From: Dan Voiculeasa +Date: Tue, 19 Apr 2022 11:58:01 +0300 +Subject: [PATCH 1/2] dhclient: dhcp6 set hostname + The dhcp upstream commit 9261cb141 introduces a function set_hostname() set host name, and the commit also implements the DHCPv6 Handlers, so insert the set_hostname to the BOUND6|RENEW6|REBIND6 implementation. -Yue Tao +Signed-off-by: Yue Tao +--- + debian/dhclient-script.linux | 2 ++ + 1 file changed, 2 insertions(+) +diff --git a/debian/dhclient-script.linux b/debian/dhclient-script.linux +index f9b734a..895116c 100644 --- a/debian/dhclient-script.linux +++ b/debian/dhclient-script.linux @@ -393,6 +393,8 @@ case "$reason" in @@ -16,3 +26,6 @@ Yue Tao if [ "${new_ip6_address}" ]; then # set leased IP ip -6 addr add ${new_ip6_address} \ +-- +2.30.0 + diff --git a/base/dhcp/debian/deb_patches/0002-Update-dn-and-dns-only-with-diff-upon-RENEW.patch b/base/dhcp/debian/deb_patches/0002-Update-dn-and-dns-only-with-diff-upon-RENEW.patch new file mode 100644 index 000000000..87e8cd7ee --- /dev/null +++ b/base/dhcp/debian/deb_patches/0002-Update-dn-and-dns-only-with-diff-upon-RENEW.patch @@ -0,0 +1,35 @@ +From ad1e3a89aa561292e745f58508b904cecbf8f928 Mon Sep 17 00:00:00 2001 +From: Dan Voiculeasa +Date: Tue, 19 Apr 2022 12:05:09 +0300 +Subject: [PATCH 2/2] Update dn and dns only with diff upon RENEW + +This prevents resolv.conf being updated on lease renewal. +This aligns to the behavior exhibited on CentOS. +This prevents resolv.conf being changed during bootstrap, which +is in fact the design. + +Signed-off-by: Dan Voiculeasa +--- + debian/dhclient-script.linux | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/debian/dhclient-script.linux b/debian/dhclient-script.linux +index 895116c..8b29988 100644 +--- a/debian/dhclient-script.linux ++++ b/debian/dhclient-script.linux +@@ -40,6 +40,12 @@ wait_for_rw() { + make_resolv_conf() { + local new_resolv_conf + ++ if [ "${reason}" = "RENEW" ] && ++ [ "${new_domain_name}" = "${old_domain_name}" ] && ++ [ "${new_domain_name_servers}" = "${old_domain_name_servers}" ]; then ++ return ++ fi ++ + # DHCPv4 + if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] || + [ -n "$new_domain_name_servers" ]; then +-- +2.30.0 + diff --git a/base/dhcp/debian/deb_patches/series b/base/dhcp/debian/deb_patches/series index 83fb3ea9a..c42669b16 100644 --- a/base/dhcp/debian/deb_patches/series +++ b/base/dhcp/debian/deb_patches/series @@ -1 +1,2 @@ -dhclient-dhcp6-set-hostname.patch +0001-dhclient-dhcp6-set-hostname.patch +0002-Update-dn-and-dns-only-with-diff-upon-RENEW.patch