summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-11-30 00:05:35 +0100
committerDaniil Baturin <daniil@baturin.org>2018-11-30 00:05:35 +0100
commit18fe96de5f9269cbb87cfb1c46d3baadf90eb59a (patch)
tree213943613ae430f8865a119964f2d1af58ae4744
parentf95015ec976933baee5cfa643002fbef2b4a32fe (diff)
parent0ebc3def62c13a19bcfb8d25ae479235ed376268 (diff)
downloadvyatta-cfg-system-18fe96de5f9269cbb87cfb1c46d3baadf90eb59a.tar.gz
vyatta-cfg-system-18fe96de5f9269cbb87cfb1c46d3baadf90eb59a.zip
Merge branch 'current' into crux
-rw-r--r--debian/changelog5
-rwxr-xr-xscripts/vyatta-address6
-rwxr-xr-xscripts/vyatta-dhcpv6-client.pl2
3 files changed, 11 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index bd4efe61..1f14c36e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,8 @@
+vyatta-cfg-system (0.20.44+vyos2+current16) unstable; urgency=low
+
+ * T1053 - Error when re-configuring an interface from DHCP to static IP
+
+ -- hagbard <vyosdev@derith.de> Thu, 29 Nov 2018 14:26:07 -0800
vyatta-cfg-system (0.20.44+vyos2+current15) unstable; urgency=medium
* Virtio network card, no info (maybe not fully supported?)
diff --git a/scripts/vyatta-address b/scripts/vyatta-address
index c3e57856..a35397de 100755
--- a/scripts/vyatta-address
+++ b/scripts/vyatta-address
@@ -29,7 +29,10 @@ case $1 in
# Get current address from interface when using DHCP
if [[ "$3" = "dhcp" ]]; then
lease_file=/var/lib/dhcp/dhclient_"$2".leases;
- ip_address=$(sed -n 's/^\s\sfixed-address\s\(.*\);/\1/p' $lease_file | sed -n '$p');
+ ip=$(sed -n 's/^\s\sfixed-address\s\(.*\);/\1/p' $lease_file | sed -n '$p');
+ #ip_address=$(sed -n 's/^\s\sfixed-address\s\(.*\);/\1/p' $lease_file | sed -n '$p');
+ # T1053 we need IP/prefix for normalize-ip to function
+ ip_address=$(ip a s dev $2 | grep $ip | awk '{print $2}')
elif [[ "$3" = "dhcpv6" ]]; then
lease_file=/var/lib/dhcp/dhclient_v6_"$2".leases;
ip_address=$(sed -n 's/^\s\s\s\siaaddr\s\(.*\)\s{/\1/p' $lease_file | sed -n '$p');
@@ -37,6 +40,7 @@ case $1 in
ip_address=$3;
fi
+ ### T1053 parameter $ip_address needs to be prefixed, not just the IP
ip_address=$(/usr/libexec/vyos/system/normalize-ip $ip_address)
if ! ip address show dev $2 2>/dev/null | grep -q "$ip_address"; then
diff --git a/scripts/vyatta-dhcpv6-client.pl b/scripts/vyatta-dhcpv6-client.pl
index c0b4cfeb..64c6840d 100755
--- a/scripts/vyatta-dhcpv6-client.pl
+++ b/scripts/vyatta-dhcpv6-client.pl
@@ -146,7 +146,7 @@ if (defined($start_flag) || defined ($renew_flag)) {
# https://phabricator.vyos.net/T903
for (my $attempt_count = 0; $attempt_count <= 60; $attempt_count++) {
# Check for any non-tentative addresses (exit code 0 if any exist, 1 otherwise)
- if (system("test -n \"\$(ip -6 -o addr show dev eth0 scope link -tentative)\"") != 0) {
+ if (system("test -n \"\$(ip -6 -o addr show dev $ifname scope link -tentative)\"") != 0) {
# No non-tentative address found, sleep and retry or exit
if ($attempt_count == 0) {
print "Duplicate address detection incomplete, waiting\n"