autofs-5.1.9 - Fix masks in parse_sub.c, so that hosts are correctly matched. From: Thiago Becker In the case local address is 10.x.x.x and one of the replica addresses is 138.x.x.x, MASK_A will make both equal, and get_priority will return PROXIMITY_NET, which is not correct. MASK_A = 0x7F000000 = 01111111 00000000 00000000 00000000 LOCAL = 10.x.x.x = 00001010 00000000 00000000 00000000 REMOTE = 138.x.x.x = 10001010 00000000 00000000 00000000 Signed-off-by: Thiago Becker Signed-off-by: Ian Kent --- CHANGELOG | 1 + lib/parse_subs.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index bd55a2f8f..7e2ebef4e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -82,6 +82,7 @@ - improve handling of missing map entry for mount request. - fix incorrect flags update in update_with_defaults(). - skip expire check for amd nounmount mounts. +- Fix masks in parse_sub.c, so that hosts are correctly matched. 02/11/2023 autofs-5.1.9 - fix kernel mount status notification. diff --git a/lib/parse_subs.c b/lib/parse_subs.c index 2acb056ba..1575e9998 100644 --- a/lib/parse_subs.c +++ b/lib/parse_subs.c @@ -37,9 +37,9 @@ static int volatile ifc_buf_len = MAX_IFC_BUF; static int volatile ifc_last_len = 0; -#define MASK_A 0x7F000000 -#define MASK_B 0xBFFF0000 -#define MASK_C 0xDFFFFF00 +#define MASK_A 0xFF000000 +#define MASK_B 0xFFFF0000 +#define MASK_C 0xFFFFFF00 /* Get numeric value of the n bits starting at position p */ #define getbits(x, p, n) ((x >> (p + 1 - n)) & ~(~0 << n))