adamm
May 23, 2019Altostratus
Radius Persistence iRule error (bad field specifier)
Having some difficulties implementing a hash persistence irule for Radius auth.
when CLIENT_ACCEPTED {
binary scan [UDP::payload] ccSH32cc code ident len auth attr_code1 attr_len1
set index 22
while { $index < $len } {
set hsize [expr ( $attr_len1 - 2 ) * 2]
binary scan [UDP::payload] @${index}H${hsize}cc attr_value next_attr_code2 next_attr_len2
# If it is Calling-Station-Id (31) attribute...
if { $attr_code1 == 31 } {
persist uie $attr_value 30
return
}
set index [ expr { $index + $attr_len1 } ]
set attr_len1 $next_attr_len2
set attr_code1 $next_attr_code2
}
}
Utilizing this iRule results in the below error:
err tmm[29577]: 01220001:3: TCL error: /Common/Radius_CallingStationId <CLIENT_ACCEPTED> - bad field specifier "-" while executing "binary scan [UDP::payload] @${index}H${hsize}cc attr_value next_attr_code2 next_attr_len2"
I can't find the "-" specifier it's referencing from the line:
binary scan [UDP::payload] @${index}H${hsize}cc attr_value next_attr_code2 next_attr_len2
Any help would be much appreciated.
Edit: Also getting these errors:
err tmm1[29577]: 01220001:3: TCL error: /Common/Radius_CallingStationId <CLIENT_ACCEPTED> - can't read "next_attr_len2": no such variable while executing "set attr_len1 $next_attr_len2"