From: Remi Gacogne Date: Mon, 23 May 2022 11:30:47 +0000 (+0200) Subject: dnsdist: Proper handling of scope IDs for MAC addresses X-Git-Tag: auth-4.8.0-alpha0~93^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11591%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Proper handling of scope IDs for MAC addresses Thanks to Peter for the correct check! --- diff --git a/pdns/misc.cc b/pdns/misc.cc index 9af6543b42..4b682489a7 100644 --- a/pdns/misc.cc +++ b/pdns/misc.cc @@ -1211,6 +1211,10 @@ int getMACAddress(const ComboAddress& ca, char* dest, size_t destLen) continue; } + if (ca.sin4.sin_family == AF_INET6 && ca.sin6.sin6_scope_id != 0 && static_cast(ca.sin6.sin6_scope_id) != nd->ndm_ifindex) { + continue; + } + for (; done == false && RTA_OK(rtatp, rtattrlen); rtatp = RTA_NEXT(rtatp, rtattrlen)) { if (rtatp->rta_type == NDA_DST){ if (nd->ndm_family == AF_INET) {