I’m using allow_source_address in my Kamailio config and have been for months/years. I’ve had no issues with it until today.
The issue is that allow_source_address("1”) returns “1" (for $si=123.17.29.201 and $sp=5060) even though we don’t have this IP address in the ‘address’ table for group 1. We have defined this IP address for group 2 but not group 1.
select * from address order by mask;
+----+-----+---------------+------+------+----------+
| id | grp | ip_addr | mask | port | tag |
+----+-----+---------------+------+------+----------+
| 20 | 1 | 123.17.0.0 | 23 | 5061 | Testing |
| 22 | 1 | 123.17.0.0 | 23 | 5062 | Testing |
| 23 | 1 | 123.17.0.0 | 23 | 5063 | Testing |
| 24 | 1 | 123.17.0.0 | 23 | 5064 | Testing |
| 1 | 1 | 123.17.0.0 | 23 | 5060 | |
| 4 | 1 | 20.5.176.0 | 24 | 5060 | |
| 21 | 1 | 123.17.1.235 | 32 | 5060 | Override |
| 46 | 2 | 123.17.29.201 | 32 | 5060 | customer |
+----+-----+---------------+------+------+----------+
Can anyone explain this? I’m wondering if there’s a bug in how allow_source_address does its net mask calculations.