summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/quiesce/src/quiesce.c2
-rw-r--r--xlators/protocol/auth/addr/src/addr.c16
2 files changed, 13 insertions, 5 deletions
diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c
index abdb901f356..bfd1116a568 100644
--- a/xlators/features/quiesce/src/quiesce.c
+++ b/xlators/features/quiesce/src/quiesce.c
@@ -95,7 +95,7 @@ gf_quiesce_populate_failover_hosts(xlator_t *this, quiesce_priv_t *priv,
__gf_quiesce_cleanup_failover_hosts(this, priv);
addr_tok = strtok_r(dup_val, ",", &save_ptr);
while (addr_tok) {
- if (!valid_internet_address(addr_tok, _gf_true)) {
+ if (!valid_internet_address(addr_tok, _gf_true, _gf_false)) {
gf_msg(this->name, GF_LOG_INFO, 0, QUIESCE_MSG_INVAL_HOST,
"Specified "
"invalid internet address:%s",
diff --git a/xlators/protocol/auth/addr/src/addr.c b/xlators/protocol/auth/addr/src/addr.c
index 0d995862de4..bf12c455d7c 100644
--- a/xlators/protocol/auth/addr/src/addr.c
+++ b/xlators/protocol/auth/addr/src/addr.c
@@ -65,10 +65,18 @@ compare_addr_and_update(char *option_str, char *peer_addr, char *subvol,
goto out;
}
} else {
- match = fnmatch(addr_str, peer_addr, 0);
- if (negate ? match : !match) {
- *result = status;
- goto out;
+ if (strstr(addr_str, "/")) {
+ match = gf_is_ip_in_net(addr_str, peer_addr);
+ if (negate ? !match : match) {
+ *result = status;
+ goto out;
+ }
+ } else {
+ match = fnmatch(addr_str, peer_addr, 0);
+ if (negate ? match : !match) {
+ *result = status;
+ goto out;
+ }
}
}