From 008e368cfd5bd1e23b800f3ac70788775d9b5320 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Sun, 3 Sep 2023 09:03:55 -0400 Subject: [PATCH] Move more Packet-* to Net.* --- raddb/mods-config/files/accounting | 2 +- raddb/mods-config/sql/cui/mysql/queries.conf | 8 ++++---- raddb/mods-config/sql/cui/postgresql/queries.conf | 8 ++++---- raddb/mods-config/sql/cui/sqlite/queries.conf | 8 ++++---- raddb/policy.d/accounting | 4 ++-- raddb/policy.d/cui | 2 +- raddb/sites-available/dhcp | 4 ++-- raddb/sites-available/dynamic-clients | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/raddb/mods-config/files/accounting b/raddb/mods-config/files/accounting index de6f89b6f0e5b..6922da1d66e4f 100644 --- a/raddb/mods-config/files/accounting +++ b/raddb/mods-config/files/accounting @@ -13,7 +13,7 @@ # #DEFAULT Huntgroup-Name == "wifi", Acct-Type := sql_log.wifi # -#DEFAULT Packet-Src-IP-Address == 10.0.0.1, Acct-Type := sql_log.other +#DEFAULT Net.Src.IP == 10.0.0.1, Acct-Type := sql_log.other # #DEFAULT Acct-Status-Type == Start, Acct-Type := sql_log.start diff --git a/raddb/mods-config/sql/cui/mysql/queries.conf b/raddb/mods-config/sql/cui/mysql/queries.conf index 7085b532235af..ce53b4f8b3c02 100644 --- a/raddb/mods-config/sql/cui/mysql/queries.conf +++ b/raddb/mods-config/sql/cui/mysql/queries.conf @@ -9,7 +9,7 @@ post-auth { INSERT INTO ${..cui_table} \ (clientipaddress, callingstationid, username, cui, lastaccounting) \ VALUES \ - ('%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}', '%{Calling-Station-Id}', \ + ('%{Net.Src.IP}', '%{Calling-Station-Id}', \ '%{User-Name}', '%{reply.Chargeable-User-Identity}', NULL) \ ON DUPLICATE KEY UPDATE \ lastaccounting='0000-00-00 00:00:00', \ @@ -24,7 +24,7 @@ accounting { query = "\ UPDATE ${....cui_table} SET \ lastaccounting = CURRENT_TIMESTAMP \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'" @@ -33,7 +33,7 @@ accounting { query ="\ UPDATE ${....cui_table} SET \ lastaccounting = CURRENT_TIMESTAMP \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'" @@ -41,7 +41,7 @@ accounting { stop { query ="\ DELETE FROM ${....cui_table} \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'" diff --git a/raddb/mods-config/sql/cui/postgresql/queries.conf b/raddb/mods-config/sql/cui/postgresql/queries.conf index 373c61ac0306c..d2959e34a44ed 100644 --- a/raddb/mods-config/sql/cui/postgresql/queries.conf +++ b/raddb/mods-config/sql/cui/postgresql/queries.conf @@ -12,7 +12,7 @@ post-auth { INSERT INTO ${..cui_table} \ (clientipaddress, callingstationid, username, cui) \ VALUES \ - ('%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}', '%{Calling-Station-Id}', \ + ('%{Net.Src.IP}', '%{Calling-Station-Id}', \ '%{User-Name}', '%{reply.Chargeable-User-Identity}') \ ON CONFLICT ON CONSTRAINT ${..cui_table}_pkey \ DO UPDATE SET cui = EXCLUDED.cui, lastaccounting = '-infinity'::timestamp" @@ -26,7 +26,7 @@ accounting { query = "\ UPDATE ${....cui_table} SET \ lastaccounting = now() \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'" @@ -35,7 +35,7 @@ accounting { query ="\ UPDATE ${....cui_table} SET \ lastaccounting = now() \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'" @@ -43,7 +43,7 @@ accounting { stop { query ="\ DELETE FROM ${....cui_table} \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'" diff --git a/raddb/mods-config/sql/cui/sqlite/queries.conf b/raddb/mods-config/sql/cui/sqlite/queries.conf index a1a3df8b81fa6..eff87b4f361f1 100644 --- a/raddb/mods-config/sql/cui/sqlite/queries.conf +++ b/raddb/mods-config/sql/cui/sqlite/queries.conf @@ -9,7 +9,7 @@ post-auth { INSERT OR REPLACE INTO ${..cui_table} \ (clientipaddress, callingstationid, username, cui, lastaccounting) \ VALUES \ - ('%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}', '%{Calling-Station-Id}', \ + ('%{Net.Src.IP}', '%{Calling-Station-Id}', \ '%{User-Name}', '%{reply.Chargeable-User-Identity}', NULL)" } @@ -21,7 +21,7 @@ accounting { query = "\ UPDATE ${....cui_table} SET \ lastaccounting = CURRENT_TIMESTAMP \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'" @@ -30,7 +30,7 @@ accounting { query ="\ UPDATE ${....cui_table} SET \ lastaccounting = CURRENT_TIMESTAMP \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'" @@ -38,7 +38,7 @@ accounting { stop { query ="\ DELETE FROM ${....cui_table} \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'" diff --git a/raddb/policy.d/accounting b/raddb/policy.d/accounting index 10e62d4abe724..569ec4aeabb23 100644 --- a/raddb/policy.d/accounting +++ b/raddb/policy.d/accounting @@ -47,7 +47,7 @@ acct_unique { # Using a Class/Session-ID combination is more robust # than using elements in the Accounting-Request, # which may be subject to change, such as - # NAS-IP-Address, Packet-Src-IP-Address and + # NAS-IP-Address, Net.Src.IP and # NAS-Port-ID/NAS-Port. # # This policy should ensure that session data is not @@ -75,7 +75,7 @@ acct_unique { # Insert a (hopefully unique) value into class # insert_acct_class { - &reply.Class = "${policy.class_value_prefix}%{md5:%t,%I,%{Packet-Src-Port},%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}},%{NAS-IP-Address},%{Calling-Station-ID},%{User-Name}}" + &reply.Class = "${policy.class_value_prefix}%{md5:%t,%I,%{Net.Src.Port},%{Net.Src.IP},%{NAS-IP-Address},%{Calling-Station-ID},%{User-Name}}" } # diff --git a/raddb/policy.d/cui b/raddb/policy.d/cui index 5636297bcc4e2..4e1e5532dad8e 100644 --- a/raddb/policy.d/cui +++ b/raddb/policy.d/cui @@ -95,7 +95,7 @@ cui.accounting { if (!&Chargeable-User-Identity) { &request.Chargeable-User-Identity := %{cuisql:\ SELECT cui FROM cui \ - WHERE clientipaddress = '%{%{Packet-Src-IPv6-Address}:-%{Packet-Src-IP-Address}}' \ + WHERE clientipaddress = '%{Net.Src.IP}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}'} } diff --git a/raddb/sites-available/dhcp b/raddb/sites-available/dhcp index bfc0c1bc835c5..e3727e95e0ab9 100644 --- a/raddb/sites-available/dhcp +++ b/raddb/sites-available/dhcp @@ -256,9 +256,9 @@ recv Inform { # For Windows 7 boxes # #recv Inform { -# &reply.Packet-Dst-Port = 67 +# &reply.Net.Dst.Port = 67 # &reply.Message-Type = Ack -# &reply.Server-Identifier = "%{Packet-Dst-IP-Address}" +# &reply.Server-Identifier = "%{Net.Dst.IP}" # &reply.Site-specific-28 = 0x0a00 # ok #} diff --git a/raddb/sites-available/dynamic-clients b/raddb/sites-available/dynamic-clients index cdd897688016d..83d2a48417e01 100644 --- a/raddb/sites-available/dynamic-clients +++ b/raddb/sites-available/dynamic-clients @@ -239,7 +239,7 @@ server dynamic_clients { # Copy the IP address of the client from # the request just received &control += { - &FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}" + &FreeRADIUS-Client-IP-Address = "%{Net.Src.IP}" # require_message_authenticator &FreeRADIUS-Client-Require-MA = no @@ -247,7 +247,7 @@ server dynamic_clients { &FreeRADIUS-Client-Secret = "testing123" # shortname - &FreeRADIUS-Client-Shortname = "%{Packet-Src-IP-Address}" + &FreeRADIUS-Client-Shortname = "%{Net.Src.IP}" # nas_type &FreeRADIUS-Client-NAS-Type = "other"