Replace '%{NAS-Port}' with %{NAS-Port:-NULL} because it was
authornbk <nbk>
Sat, 23 Jul 2005 15:41:10 +0000 (15:41 +0000)
committernbk <nbk>
Sat, 23 Jul 2005 15:41:10 +0000 (15:41 +0000)
reported on the bugzilla that some NASes (for example AS5350
IOS 12.3.T) don't send the attribute in Accounting-Request
packets. (closes: #223)

Bug found by Ilia Chipitsine <ilia@rediska.ru>

raddb/postgresql.conf

index 66d5321..685a901 100644 (file)
@@ -1,5 +1,5 @@
 #
-#      Id: postgresql.conf,v 1.8.2.11 2003/07/15 11:15:43 pnixon Exp $
+#  $Id$
 #
 #  Configuration for the SQL module, when using Postgresql.
 #
@@ -229,7 +229,7 @@ sql {
     AcctSessionTime, AcctAuthentic, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, \
     ServiceType, FramedProtocol, FramedIPAddress) \
     values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', \
-    '%{NAS-Port}', '%{NAS-Port-Type}', (now() -  '%{Acct-Delay-Time:-0}'::interval - '%{Acct-Session-Time:-0}'::interval), \
+    %{NAS-Port:-NULL}::integer, '%{NAS-Port-Type}', (now() - '%{Acct-Delay-Time:-0}'::interval - '%{Acct-Session-Time:-0}'::interval), \
     '%{Acct-Session-Time}', '%{Acct-Authentic}', \
     (('%{Acct-Input-Gigawords:-0}'::bigint << 32) + '%{Acct-Input-Octets:-0}'::bigint), \
     (('%{Acct-Output-Gigawords:-0}'::bigint << 32) + '%{Acct-Output-Octets:-0}'::bigint), '%{Called-Station-Id}', \
@@ -239,7 +239,7 @@ sql {
     (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctAuthentic, \
     ConnectInfo_start, CalledStationId, CallingStationId, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay) \
     values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', \
-    '%{NAS-Port}', '%{NAS-Port-Type}', (now() - '%{Acct-Delay-Time:-0}'::interval), '%{Acct-Authentic}', \
+    %{NAS-Port:-NULL}::integer, '%{NAS-Port-Type}', (now() - '%{Acct-Delay-Time:-0}'::interval), '%{Acct-Authentic}', \
     '%{Connect-Info}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', \
     NULLIF('%{Framed-IP-Address}', '')::inet, '%{Acct-Delay-Time:-0}')"
 
@@ -265,7 +265,7 @@ sql {
     AcctSessionTime, AcctAuthentic, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, \
     CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStopDelay) \
     values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', \
-    '%{NAS-Port}', '%{NAS-Port-Type}', (now() -  '%{Acct-Delay-Time:-0}'::interval - '%{Acct-Session-Time:-0}'::interval), \
+    %{NAS-Port:-NULL}::integer, '%{NAS-Port-Type}', (now() - '%{Acct-Delay-Time:-0}'::interval - '%{Acct-Session-Time:-0}'::interval), \
     (now() - '%{Acct-Delay-Time:-0}'::interval), NULLIF('%{Acct-Session-Time}', '')::bigint, '%{Acct-Authentic}', \
     '%{Connect-Info}', (('%{Acct-Input-Gigawords:-0}'::bigint << 32) + '%{Acct-Input-Octets:-0}'::bigint), \
     (('%{Acct-Output-Gigawords:-0}'::bigint << 32) + '%{Acct-Output-Octets:-0}'::bigint), '%{Called-Station-Id}', \