]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Proper handling of scope IDs for MAC addresses 11591/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 23 May 2022 11:30:47 +0000 (13:30 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 23 May 2022 11:30:47 +0000 (13:30 +0200)
Thanks to Peter for the correct check!

pdns/misc.cc

index 9af6543b4259646a700d8160a485e6f0adb8a3d7..4b682489a7738a3440e653bb63314b78e4f67bef 100644 (file)
@@ -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<int32_t>(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) {