From e9c96727e7e42c0ef6ff8edf79087b81a5fb5082 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Mon, 13 Jun 2022 19:46:36 +0900 Subject: Fix listing of interfaces with ID > 255 get_ifi_info_linuxv6 only reads up to 2 hexadecimal characters for interface indexes, so interface indexes above 255 cannot be used. Use %x instead of %02x to remove this limitation. This is what upstream used up to version 878.270.2, after which mdnsresponder stopped using /proc to list interfaces. Only the interface index reading is changed to keep the change minimal. Test: atest NsdManagerTest --rerun-until-failure 100 Bug: 235797641 Change-Id: Iddca5052e7d76bc7878f0442acb9ccd67cbb620f --- mDNSPosix/mDNSUNP.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mDNSPosix/mDNSUNP.c b/mDNSPosix/mDNSUNP.c index 5379b6b..f5d0c52 100755 --- a/mDNSPosix/mDNSUNP.c +++ b/mDNSPosix/mDNSUNP.c @@ -106,7 +106,7 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases) goto gotError; } while (fscanf(fp, - "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %15s\n", + "%4s%4s%4s%4s%4s%4s%4s%4s %x %02x %02x %02x %15s\n", addr[0],addr[1],addr[2],addr[3], addr[4],addr[5],addr[6],addr[7], &index, &plen, &scope, &flags, ifname) != EOF) { -- cgit v1.2.3