Description

As per my thread on sr-users: Active/active keepalived - Kamailio includes non-local virtual IP in "myself" which breaks DMQ call routing, I am seeing issues due to the behavior of check_self and more specifically grep_sock_info. I have attached a patch with a proposed new feature that would allow changing this behaviour slightly, although I've avoided changing any default behaviour.

I have a setup with keepalived in active/active mode, with two virtual IPs. The goal is that each VIP is active only one one node at a time, but in the event of a failure, both VIPs would become active on one node.

The issue I am facing is that in order for this to work, I need to have both nodes listen on both virtual IPs at all times, but this means that both nodes always consider traffic to those IPs local to themselves, even when that is not the case. This breaks many things, basically anything with uri == myself. But even internally in Kamailio itself, this is causing problems.

For example: PATH support is broken and this is not easily fixed in the config because lookup() is actually using check_self() internally. I am sure there are many other features which will not work right in the above scenario, and this is why I'm proposing a change in the code itself, instead of just trying to solve it in the config.

I've attached a patch file with my proposed change and would appreciate any feedback as to my overall approach. If this seems OK then I will put together a pull request for your review.

Thanks!

Expected behavior

Kamailio should detect what IP addresses are currently active locally on it's system before considering the socket a match. If the IP is not currently there, it should ignore the match as if it is not currently listening on this IP (because it really is not!)

Actual observed behavior

Right now, Kamailio looks blindly at all "listen" sockets and looks for a match, regardless of if that IP is currently active locally or not, and this causes the false results of check_self

Possible Solutions

As mentioned, I'm attaching a patch showing my overall approach. Basically:

RT59671-kamailio-add-listen-virtual-check2.patch.txt


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/issues/2984@github.com>