Goutham Pacha Ravi has uploaded this change for review. (
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1237448?usp=email )
Change subject: Allow /0 CIDR prefix in export client blocks
......................................................................
Allow /0 CIDR prefix in export client blocks
The lexer regex patterns for CIDR suffixes reject prefix
length 0 because they require the first digit to be [1-9].
This prevents valid CIDR notation like 0.0.0.0/0 and ::/0
(RFC 4632, RFC 4291) from being used in export client
blocks to match all addresses in an address family.
Fix the regex to accept /0 while still disallowing leading
zeros. Also fix undefined behavior in cidr_contains_ip()
for IPv4 with mask=0, where a 32-bit shift of an int is
performed (UB in C). Add test cases for /0 parsing and
containment.
Change-Id: Ibd5364266e7a5afe1b2749f9a5fc2c1dc7478ba3
Fixes:
https://github.com/nfs-ganesha/nfs-ganesha/issues/1396
Signed-off-by: Goutham Pacha Ravi <gouthampravi(a)gmail.com>
---
M src/config_parsing/conf_lex.l
M src/support/ip_utils.c
M src/test/test_cidr.c
3 files changed, 11 insertions(+), 2 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/48/1237448/1
--
To view, visit
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1237448?usp=email
To unsubscribe, or for help writing mail filters, visit
https://review.gerrithub.io/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Ibd5364266e7a5afe1b2749f9a5fc2c1dc7478ba3
Gerrit-Change-Number: 1237448
Gerrit-PatchSet: 1
Gerrit-Owner: Goutham Pacha Ravi <gouthampravi(a)gmail.com>