]> git.ozlabs.org Git - ppp.git/commitdiff
ipv6cp: Fix ipv6cp-use-persistent option (#239)
authorpali <7141871+pali@users.noreply.github.com>
Tue, 26 Jan 2021 02:57:38 +0000 (03:57 +0100)
committerGitHub <noreply@github.com>
Tue, 26 Jan 2021 02:57:38 +0000 (13:57 +1100)
There is incorrect logic in ether_to_eui64() function. Persistent id cannot
be found when both sources of persistent id fails, not just one.

This fixes ipv6cp-use-persistent option for non-ethernet PPP connections.

Fixes: 952cfa5acc41ad4ceee160420a188a388bb340cf
Signed-off-by: Pali Rohár <pali@kernel.org>
pppd/ipv6cp.c

index 11be07d5636691266d33e03e04abd4b440a2d7db..ba7bee55da86c312e49e84ca8014cc1b7d12736a 100644 (file)
@@ -1070,7 +1070,7 @@ ether_to_eui64(eui64_t *p_eui64)
 {
     u_char addr[6];
 
-    if (get_if_hwaddr(addr, devnam) < 0 || get_first_ether_hwaddr(addr) < 0) {
+    if (get_if_hwaddr(addr, devnam) < 0 && get_first_ether_hwaddr(addr) < 0) {
         error("ipv6cp: no persistent id can be found");
         return 0;
     }