Page MenuHomePhabricator

'renew dhcpv6 interface <interfaceName>' command fails, but work within config session
Closed, ResolvedPublicBUG

Description

vyos operation command 'renew dhcpv6 interface <interfaceName>' fails, with error
"DEBUG vexit_internal: calling cfgPathExists() without config session
calling cfgPathExists() without config session at /opt/vyatta/share/perl5/Vyatta/Config.pm line 82."
while the same command works within config session as 'run renew dhcpv6 interface <interfaceName>'

Reason: within script vyatta-dhcpv6-client.pl , function gen_conf_file is checking for 'duid' field
but during operation session this checking fails, and return error as above.

"Possible" patch for solution:

-- <unnamed>
+++ vyatta-dhcpv6-client-new.pl
@@ -57,10 +57,14 @@
     my $config = new Vyatta::Config;
     $config->setLevel($level);
 
-    if ($config->exists('duid')) { 
-        my $duid = $config->returnValue('duid');
-        print $FD_WR "        send dhcp6.client-id $duid;\n";
+    if($config->inSession()) {
+	if ($config->exists('duid')) { 
+        	my $duid = $config->returnValue('duid');
+        	print $FD_WR "        send dhcp6.client-id $duid;\n";
+    	}
     }
 #    my $hostname = hostname;
 #    print $FD_WR "        send host-name \"$hostname\";\n";
 #    print $FD_WR "        send dhcp6.oro 1, 2, 7, 12, 13, 23, 24

Details

Difficulty level
Unknown (require assessment)
Version
1.2 Rolling 20180703
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible

Event Timeline

nirmal created this task.Aug 27 2019, 4:48 PM
pasik added a subscriber: pasik.Aug 29 2019, 2:36 PM
syncer assigned this task to Dmitry.Aug 30 2019, 10:18 PM
syncer triaged this task as Low priority.
dmbaturin set Is it a breaking change? to Perfectly compatible.
dmbaturin closed this task as Resolved.Sep 6 2019, 5:27 PM
dmbaturin added a subscriber: dmbaturin.

@nirmal The full fix is a bit more complicated. There are two cases: when it's called from conf mode at commit time, it needs to use the value from the proposed config (that's returnValue). However, in op mode, it also re-generates the config, so your fix would make the send dhcp6.client-id option disappear from the config when a user runs renew dhcpv6 interface .... A full fix needs to handle both cases and use returnEffectiveValue in op mode.

Of course, in a new implementation we likely don't want to re-generate that config at all.

c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.Sun, Oct 13, 3:06 PM