From: Arran Cudbard-Bell Date: Sun, 29 Nov 2020 20:54:18 +0000 (-0700) Subject: Fixup references to Pool-Range X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c55af36fc2ee9506b6ade28dcee1a7cf5e2ebc0;p=thirdparty%2Ffreeradius-server.git Fixup references to Pool-Range --- diff --git a/doc/antora/modules/raddb/pages/mods-available/redis_ippool.adoc b/doc/antora/modules/raddb/pages/mods-available/redis_ippool.adoc index 74f8cd70aec..a383d68421d 100644 --- a/doc/antora/modules/raddb/pages/mods-available/redis_ippool.adoc +++ b/doc/antora/modules/raddb/pages/mods-available/redis_ippool.adoc @@ -78,9 +78,9 @@ allocated_address_attr:: List and attribute where the allocated address is writt -range_attr:: List and attribute where the `Pool-Range` ID (if set) is written to. +range_attr:: List and attribute where the `IP-Pool.Range` ID (if set) is written to. -The idea of the `Pool-Range` is that it provides a key into other datastores +The idea of the `IP-Pool.Range` is that it provides a key into other datastores or caches, which store the additional options associated with the range an IP address belongs to. @@ -126,7 +126,7 @@ redis_ippool { requested_address = "%{%{Requested-IP-Address}:-%{DHCP-Client-IP-Address}}" # ipv4_integer = yes allocated_address_attr = &reply.DHCP-Your-IP-Address - range_attr = &reply.Pool-Range + range_attr = &reply.IP-Pool.Range expiry_attr = &reply.DHCP-IP-Address-Lease-Time copy_on_update = yes redis { diff --git a/raddb/mods-available/redis_ippool b/raddb/mods-available/redis_ippool index 1b079b82dfe..f5f26c34e15 100644 --- a/raddb/mods-available/redis_ippool +++ b/raddb/mods-available/redis_ippool @@ -116,16 +116,16 @@ redis_ippool { allocated_address_attr = &reply.DHCP-Your-IP-Address # - # range_attr:: List and attribute where the `Pool-Range` ID (if set) is written to. + # range_attr:: List and attribute where the `IP-Pool.Range` ID (if set) is written to. # - # The idea of the `Pool-Range` is that it provides a key into other datastores + # The idea of the `IP-Pool.Range` is that it provides a key into other datastores # or caches, which store the additional options associated with the range an # IP address belongs to. # # There may be multiple ranges of IP address contained within any given pool, # which is why this is provided in addition to the pool name. # - range_attr = &reply.Pool-Range + range_attr = &reply.IP-Pool.Range # # expiry_attr:: If set - the list and attribute to write the remaining lease time to. diff --git a/src/modules/rlm_redis_ippool/rlm_redis_ippool.c b/src/modules/rlm_redis_ippool/rlm_redis_ippool.c index 506d9706936..7e17c1965e9 100644 --- a/src/modules/rlm_redis_ippool/rlm_redis_ippool.c +++ b/src/modules/rlm_redis_ippool/rlm_redis_ippool.c @@ -125,7 +125,7 @@ static CONF_PARSER module_config[] = { { FR_CONF_OFFSET("allocated_address_attr", FR_TYPE_TMPL | FR_TYPE_ATTRIBUTE | FR_TYPE_REQUIRED, rlm_redis_ippool_t, allocated_address_attr), .dflt = "&reply.DHCP-Your-IP-Address", .quote = T_BARE_WORD }, { FR_CONF_DEPRECATED("reply_attr", FR_TYPE_TMPL | FR_TYPE_ATTRIBUTE | FR_TYPE_REQUIRED, rlm_redis_ippool_t, NULL) }, - { FR_CONF_OFFSET("range_attr", FR_TYPE_TMPL | FR_TYPE_ATTRIBUTE | FR_TYPE_REQUIRED, rlm_redis_ippool_t, range_attr), .dflt = "&reply.Pool-Range", .quote = T_BARE_WORD }, + { FR_CONF_OFFSET("range_attr", FR_TYPE_TMPL | FR_TYPE_ATTRIBUTE | FR_TYPE_REQUIRED, rlm_redis_ippool_t, range_attr), .dflt = "&reply.IP-Pool.Range", .quote = T_BARE_WORD }, { FR_CONF_OFFSET("expiry_attr", FR_TYPE_TMPL | FR_TYPE_ATTRIBUTE, rlm_redis_ippool_t, expiry_attr) }, { FR_CONF_OFFSET("ipv4_integer", FR_TYPE_BOOL, rlm_redis_ippool_t, ipv4_integer) }, diff --git a/src/tests/modules/redis_ippool/alloc.unlang b/src/tests/modules/redis_ippool/alloc.unlang index c6537ff4ac2..73e7c7d7412 100644 --- a/src/tests/modules/redis_ippool/alloc.unlang +++ b/src/tests/modules/redis_ippool/alloc.unlang @@ -70,7 +70,7 @@ if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{reply.Framed-IP-Address} range test_fail } -if (&reply.Pool-Range == '192.168.0.0') { +if (&reply.IP-Pool.Range == '192.168.0.0') { test_pass } else { test_fail @@ -95,7 +95,7 @@ if (&reply.Session-Timeout == 30) { } update { - &request.Pool-Range := &reply.Pool-Range + &request.IP-Pool.Range := &reply.IP-Pool.Range &request.Framed-IP-Address := &reply.Framed-IP-Address &request.Session-Timeout := &reply.Session-Timeout # We should get the same lease time &reply !* ANY @@ -121,7 +121,7 @@ if (updated) { # # Check the ranges are the same # -if (&request.Pool-Range == &reply.Pool-Range) { +if (&request.IP-Pool.Range == &reply.IP-Pool.Range) { test_pass } else { test_fail diff --git a/src/tests/modules/redis_ippool/module.conf b/src/tests/modules/redis_ippool/module.conf index 1df0071de9f..0ce3b8c9c89 100644 --- a/src/tests/modules/redis_ippool/module.conf +++ b/src/tests/modules/redis_ippool/module.conf @@ -17,7 +17,7 @@ redis_ippool { requested_address = &Framed-IP-Address allocated_address_attr = &reply.Framed-IP-address - range_attr = &reply.Pool-Range + range_attr = &reply.IP-Pool.Range expiry_attr = &reply.Session-Timeout # This messes with the tests if enabled diff --git a/src/tests/modules/redis_ippool/update.unlang b/src/tests/modules/redis_ippool/update.unlang index 36a44b80320..b1811c8f92c 100644 --- a/src/tests/modules/redis_ippool/update.unlang +++ b/src/tests/modules/redis_ippool/update.unlang @@ -108,7 +108,7 @@ if ("%{redis:HGET {%{control.IP-Pool.Name}%}:ip:%{request.Framed-IP-Address} gat } # 13. and that the range attribute was set -if (&reply.Pool-Range && (&reply.Pool-Range == '192.168.0.0')) { +if (&reply.IP-Pool.Range && (&reply.IP-Pool.Range == '192.168.0.0')) { test_pass } else { test_fail