integ/base/dhcp/centos/patches/dhclient-ipv6-conditionally-set-hostname.patch
zhipengl ffe029ef99 Refactor patches for dhcp package.
Use dhcp-config package to package config files for dhcp package.
Rename files folder to patches
Removed site.h which is not used

Deployment test and ping test between VMs pass
config and script files check pass.

Story: 2003768
Task: 27582

Change-Id: Ib7fd3c0ed6d706f89d08890e90ccee42673b3679
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
2018-10-31 01:55:21 +00:00

38 lines
1.1 KiB
Diff

From 04e5bef0d9bb0e1b3c8bbecccf11228ae809dfd2 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 15:25:21 -0400
Subject: [PATCH 4/7] WRS: Patch104:
dhclient-ipv6-conditionally-set-hostname.patch
---
client/scripts/linux | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/client/scripts/linux b/client/scripts/linux
index 14655f0..59e764f 100755
--- a/client/scripts/linux
+++ b/client/scripts/linux
@@ -254,6 +254,19 @@ if [ x$reason = xPREINIT6 ] ; then
exit_with_hooks 0
fi
+if [ x$reason = xBOUND6 ] || [ x$reason = xRENEW6 ] || \
+ [ x$reason = xREBIND6 ] || [ x$reason = xREBOOT6 ]; then
+ current_hostname=`hostname`
+ if [ x$current_hostname = x ] || \
+ [ x$current_hostname = "x(none)" ] || \
+ [ x$current_hostname = xlocalhost ] || \
+ [ x$current_hostname = x$old_fqdn_hostname ]; then
+ if [ x$new_fqdn_hostname != x$old_fqdn_hostname ]; then
+ hostname "$new_fqdn_hostname"
+ fi
+ fi
+fi
+
if [ x${old_ip6_prefix} != x ] || [ x${new_ip6_prefix} != x ] ; then
echo Prefix ${reason} old=${old_ip6_prefix} new=${new_ip6_prefix}
--
1.9.1