From: pali <7141871+pali@users.noreply.github.com> Date: Tue, 26 Jan 2021 02:57:38 +0000 (+0100) Subject: ipv6cp: Fix ipv6cp-use-persistent option (#239) X-Git-Tag: ppp-2.5.0~91 X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=0615e2adaa961cae00a9a361494b04f92ce34c4f;p=ppp.git ipv6cp: Fix ipv6cp-use-persistent option (#239) 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 --- diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c index 11be07d..ba7bee5 100644 --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c @@ -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; }