From 0615e2adaa961cae00a9a361494b04f92ce34c4f Mon Sep 17 00:00:00 2001 From: pali <7141871+pali@users.noreply.github.com> Date: Tue, 26 Jan 2021 03:57:38 +0100 Subject: [PATCH] ipv6cp: Fix ipv6cp-use-persistent option (#239) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- pppd/ipv6cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.2