diff options
Diffstat (limited to 'xlators/protocol')
-rw-r--r-- | xlators/protocol/auth/addr/src/addr.c | 6 | ||||
-rw-r--r-- | xlators/protocol/server/src/server.c | 16 |
2 files changed, 16 insertions, 6 deletions
diff --git a/xlators/protocol/auth/addr/src/addr.c b/xlators/protocol/auth/addr/src/addr.c index 0209dd3538f..2bc604de8c0 100644 --- a/xlators/protocol/auth/addr/src/addr.c +++ b/xlators/protocol/auth/addr/src/addr.c @@ -226,14 +226,14 @@ out: struct volume_options options[] = { { .key = {"auth.addr.*.allow"}, - .type = GF_OPTION_TYPE_ANY + .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST }, { .key = {"auth.addr.*.reject"}, - .type = GF_OPTION_TYPE_ANY + .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST }, /* Backword compatibility */ { .key = {"auth.ip.*.allow"}, - .type = GF_OPTION_TYPE_ANY + .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST }, { .key = {NULL} } }; diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index f87e371f1bb..33889fd9b15 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -558,9 +558,8 @@ validate_auth_options (xlator_t *this, dict_t *dict) while (addr) { - if (valid_internet_address (addr) || - valid_wildcard_internet_address (addr)) - { + if (valid_internet_address + (addr, _gf_true)) { error = 0; } else { error = -1; @@ -1140,5 +1139,16 @@ struct volume_options options[] = { .min = GF_MIN_SOCKET_WINDOW_SIZE, .max = GF_MAX_SOCKET_WINDOW_SIZE }, + + /* The following two options are defined in addr.c, redifined here * + * for the sake of validation during volume set from cli */ + + { .key = {"auth.addr.*.allow"}, + .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST + }, + { .key = {"auth.addr.*.reject"}, + .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST + }, + { .key = {NULL} }, }; |