Skip to contentSkip to conversation

Patch for H323 connection tracking for kernel 2.6.14 and Panic with SIP tracking

DISCUSSION Moises Silva 3 participants 12 messages Dec 31, 2005 – Jan 7, 2006 3 messages not in the archive netfilter

lore
Share & tools
lore
#0 lore raw

I was patching my 2.6.14 kernel for SIP and H323 connection tracking support, and got some errors of patch-o-matic h323 patches (i guess is normal since the version supported is 2.6.12 ), i would like some one with enough experience check the patch i made and tell me if it ok, since is compiling just fine, and it makes sense to me, but i could be wrong.

Patch to be applied in the kernel directory directly, something like patch -p1 < blah...

http://galileo.ivsol.net/h323-conntrack-nat-kernel-2.6.14.patch

and a patch for patch-o-matic sources

http://galileo.ivsol.net/patch-o-matic-ng-20051230-h323.patch

Additionally im having kernel panics with SIP conntrack extension. I have it as kernel module (ko). I still does not copy the core dump, but says something about "interrupt error, not syncing" or something like that. I will try to compile it inside the kernel to see if it still panics ( please some one could tell me if this makes any relevant difference?? )

Thanks in advance

- Moises Silva < moy at ivsol dot net >
--
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"

#1 lore raw

still getting kernel panic, copy the whole thing is a time consuming task, for now doing nothing, but i have downgraded the kernel to 2.6.13 and at least it does not kernel panics. Some one has a patch for sip connection tracking for kernel-2.6.14??

Quoted 25 lines · Moises Silva

I was patching my 2.6.14 kernel for SIP and H323 connection tracking support, and got some errors of patch-o-matic h323 patches (i guess is normal since the version supported is 2.6.12 ), i would like some one with enough experience check the patch i made and tell me if it ok, since is compiling just fine, and it makes sense to me, but i could be wrong.

Patch to be applied in the kernel directory directly, something like patch -p1 < blah...

http://galileo.ivsol.net/h323-conntrack-nat-kernel-2.6.14.patch

and a patch for patch-o-matic sources

http://galileo.ivsol.net/patch-o-matic-ng-20051230-h323.patch

Additionally im having kernel panics with SIP conntrack extension. I have it as kernel module (ko). I still does not copy the core dump, but says something about "interrupt error, not syncing" or something like that. I will try to compile it inside the kernel to see if it still panics ( please some one could tell me if this makes any relevant difference?? )

Quoted 6 lines

Thanks in advance

- Moises Silva < moy at ivsol dot net >
--
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"

--
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"

#2 lore raw
Quoted 4 lines · Moises Silva

still getting kernel panic, copy the whole thing is a time consuming task, for now doing nothing, but i have downgraded the kernel to 2.6.13 and at least it does not kernel panics. Some one has a patch for sip connection tracking for kernel-2.6.14??

Most likely you need to change

        ip_ct_refresh_acct(ct, ctinfo, NULL, sip_timeout * HZ);

to

        ip_ct_refresh(ct, *pskb, sip_timeout * HZ);

in net/ipv4/netfilter/ip_conntrack_sip.c. If that doesn't help please post the entire oops.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

I have already done the changes to use ip_ct_refresh() and still panics. But as time passes and i read more stuff, im more confused. I found this patch

http://people.ecsc.co.uk/~matt/patches/kernel/2.6.14/05-netfilter-sip-conntrack-nat.patch

however i didnt check for differences between that patch and the one provided by patch-o-matic, so i made a copy of my previous kernel but with this other patch, and seems to work. I made a diff -Nur between both kernels and didnt find anything particular about the sip conntrack. Then i backed again to the buggy kernel and now is giving the next errors when i try to modprobe ip_nat_sip:

Jan  3 13:17:17 [kernel] kobject_register failed for ip_conntrack_sip (-17)
Jan  3 13:17:17 [kernel] ------------[ cut here ]------------
Jan  3 13:17:17 [kernel] kernel BUG at net/ipv4/netfilter/ip_nat_sip.c:241!
Jan  3 13:17:17 [kernel] invalid operand: 0000 [#1]

Im attaching a copy of the kernel panic it gives me the first time. Notice that i have seen 2 different kernel panics, one when my box is booting up, and other when I load the ip_nat_sip module. The first kernel panic is the one im attaching a copy of, but the second one i havent had the time of copyingit, theres a painless way of copying the dump when panics??

Any help would be appreciated.

Quoted 8 lines · Patrick McHardy
Quoted 4 lines · Moises Silva

still getting kernel panic, copy the whole thing is a time consuming task, for now doing nothing, but i have downgraded the kernel to 2.6.13 and at least it does not kernel panics. Some one has a patch for sip connection tracking for kernel-2.6.14??

Most likely you need to change

Quoted 9 lines
         ip_ct_refresh_acct(ct, ctinfo, NULL, sip_timeout * HZ);

to

         ip_ct_refresh(ct, *pskb, sip_timeout * HZ);

in net/ipv4/netfilter/ip_conntrack_sip.c. If that doesn't help please post the entire oops.

--
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"

--
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"

#5 lore raw
In reply to Patrick McHardy
Quoted 10 lines · Patrick McHardy
Quoted 4 lines · Moises Silva

still getting kernel panic, copy the whole thing is a time consuming task, for now doing nothing, but i have downgraded the kernel to 2.6.13 and at least it does not kernel panics. Some one has a patch for sip connection tracking for kernel-2.6.14??

Most likely you need to change

Quoted 9 lines
        ip_ct_refresh_acct(ct, ctinfo, NULL, sip_timeout * HZ);

to

        ip_ct_refresh(ct, *pskb, sip_timeout * HZ);

in net/ipv4/netfilter/ip_conntrack_sip.c. If that doesn't help please post the entire oops.

This fix works for me!

Regards,
Victor

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

hum, i guess mine is a different problem. The thing that seems to be causing panic is the coexistence of ppp_asyc nad ip_nat_sip (or the consequent ip_conntrack_sip). Im preparing an explanation of the tests i made, i will post it here in a while. Hopefully some developer will be able to know whats the problem.

Regards

Quoted 4 lines · Victor Julien
Quoted 2 lines · Moises Silva

Victor: Did you were getting kernel panics as well?

Quoted 9 lines

Yes, as soon as i loaded the ip_nat_sip module (which in also loaded the ip_conntrack_sip module) it caused a kernel panic when there was SIP traffic. Now it seems to work fine. I had a few conversations, no panics yet :-)

Regards,
Victor

--
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"

#9 lore raw
In reply to Victor Julien
Quoted 19 lines · Victor Julien
Quoted 17 lines · Patrick McHardy
Quoted 4 lines · Moises Silva

still getting kernel panic, copy the whole thing is a time consuming task, for now doing nothing, but i have downgraded the kernel to 2.6.13 and at least it does not kernel panics. Some one has a patch for sip connection tracking for kernel-2.6.14??

Most likely you need to change

        ip_ct_refresh_acct(ct, ctinfo, NULL, sip_timeout * HZ);

to

        ip_ct_refresh(ct, *pskb, sip_timeout * HZ);
Quoted 10 lines
Quoted 3 lines

in net/ipv4/netfilter/ip_conntrack_sip.c. If that doesn't help please post the entire oops.

This fix works for me!

Regards,
Victor

Hmmm, while it still hasn't crashed on me, i can't get it to operate
either. I am using 2.6.15 + pom 20060101 + the above fix. I am trying to get the following setup working:

softphone (lan) --- sip proxy on gateway --- sip server (@isp)

I have rules to allow port 5060/udp. I expected that by loading ip_conntrack_sip this rule, together with accepting all RELATED traffic, sip conversations would work.

If i call a number, i see the following entry appear in /proc/net/ip_conntrack_expect:
176 proto=17 src=217.66.118.164 dst=80.126.xx.xx sport=0 dport=7071 176 proto=17 src=192.168.1.1 dst=192.168.1.2 sport=0 dport=8000

(lan client 192.168.1.2, firewall has 192.168.1.1 and 80.126.xx.xx, sip server is 217.66.118.164).

But the connection does not work. I have added the following rule to all chains in all tables (mangle, nat, filter):
iptables -t <table> -I <chain> 1 -m helper --helper sip
to see if the sip match ever gets reached, but all counters remain on 0 all the time.

If i do the same for ftp, i can see the counters increase.

Does anyone have an idea what is going wrong?

Regards,
Victor

#10 lore raw
Quoted 16 lines · Victor Julien

Hmmm, while it still hasn't crashed on me, i can't get it to operate
either. I am using 2.6.15 + pom 20060101 + the above fix. I am trying to get the following setup working:

softphone (lan) --- sip proxy on gateway --- sip server (@isp)

I have rules to allow port 5060/udp. I expected that by loading ip_conntrack_sip this rule, together with accepting all RELATED traffic, sip conversations would work.

If i call a number, i see the following entry appear in /proc/net/ip_conntrack_expect:
176 proto=17 src=217.66.118.164 dst=80.126.xx.xx sport=0 dport=7071 176 proto=17 src=192.168.1.1 dst=192.168.1.2 sport=0 dport=8000

(lan client 192.168.1.2, firewall has 192.168.1.1 and 80.126.xx.xx, sip server is 217.66.118.164).

Quoted 7 lines

But the connection does not work. I have added the following rule to all chains in all tables (mangle, nat, filter):
iptables -t <table> -I <chain> 1 -m helper --helper sip
to see if the sip match ever gets reached, but all counters remain on 0 all the time.

If i do the same for ftp, i can see the counters increase.

Does anyone have an idea what is going wrong?

Try to find out if the expectations ports are correct by logging the incoming traffic or using tcpdump.

#11 lore raw
Quoted 3 lines

Try to find out if the expectations ports are correct by logging the incoming traffic or using tcpdump.

When making a call:

# cat /proc/net/ip_conntrack_expect
174 proto=17 src=217.66.118.164 dst=80.126.43.45 sport=0 dport=7071
174 proto=17 src=192.168.1.1 dst=192.168.1.2 sport=0 dport=8000

tcpdump:
13:05:46.220869 IP 192.168.1.2.8000 > 192.168.1.1.7072: UDP, length: 172

syslog:

Jan  6 13:05:46 sanctorium kernel: vrmr: REJECT reject-in IN=eth0 OUT= MAC=aa:00:04:00:0a:04:00:90:27:57:31:29:08:00 SRC=192.168.1.2 DST=192.168.1.1 LEN=200 TOS=0x00 PREC=0x00 TTL=64 ID=401 DF PROTO=UDP SPT=8000 DPT=7072 LEN=180

REJECT is the default policy for lan to firewall traffic.

Can it be that the expectation direction is wrong? dropped traffic is src 192.168.1.2:8000 to dst 192.168.1.1:7072 expect is src 192.168.1.1 to dst 192.168.1.2:8000

On the other hand, the dropped traffic looks the same as the expectation, only in the opposite direction...

Regards,
Victor

#12 lore raw
Quoted 13 lines · Victor Julien
Quoted 3 lines

Try to find out if the expectations ports are correct by logging the incoming traffic or using tcpdump.

When making a call:

# cat /proc/net/ip_conntrack_expect
174 proto=17 src=217.66.118.164 dst=80.126.43.45 sport=0 dport=7071
174 proto=17 src=192.168.1.1 dst=192.168.1.2 sport=0 dport=8000

tcpdump:
13:05:46.220869 IP 192.168.1.2.8000 > 192.168.1.1.7072: UDP, length: 172

Quoted 8 lines

syslog:

Jan  6 13:05:46 sanctorium kernel: vrmr: REJECT reject-in IN=eth0 OUT= MAC=aa:00:04:00:0a:04:00:90:27:57:31:29:08:00 SRC=192.168.1.2 DST=192.168.1.1 LEN=200 TOS=0x00 PREC=0x00 TTL=64 ID=401 DF PROTO=UDP SPT=8000 DPT=7072 LEN=180

REJECT is the default policy for lan to firewall traffic.

Can it be that the expectation direction is wrong? dropped traffic is src 192.168.1.2:8000 to dst 192.168.1.1:7072 expect is src 192.168.1.1 to dst 192.168.1.2:8000

Possible. In which direction (relative to registration) does the call go?

#13 lore raw
Quoted 20 lines · Patrick McHardy
Quoted 18 lines · Victor Julien
Quoted 3 lines

Try to find out if the expectations ports are correct by logging the incoming traffic or using tcpdump.

When making a call:

# cat /proc/net/ip_conntrack_expect
174 proto=17 src=217.66.118.164 dst=80.126.43.45 sport=0 dport=7071
174 proto=17 src=192.168.1.1 dst=192.168.1.2 sport=0 dport=8000

tcpdump:
13:05:46.220869 IP 192.168.1.2.8000 > 192.168.1.1.7072: UDP, length: 172

syslog:

Jan  6 13:05:46 sanctorium kernel: vrmr: REJECT reject-in IN=eth0 OUT= MAC=aa:00:04:00:0a:04:00:90:27:57:31:29:08:00 SRC=192.168.1.2 DST=192.168.1.1 LEN=200 TOS=0x00 PREC=0x00 TTL=64 ID=401 DF PROTO=UDP SPT=8000 DPT=7072 LEN=180

REJECT is the default policy for lan to firewall traffic.

Quoted 8 lines
Quoted 3 lines

Can it be that the expectation direction is wrong? dropped traffic is src 192.168.1.2:8000 to dst 192.168.1.1:7072 expect is src 192.168.1.1 to dst 192.168.1.2:8000

Possible. In which direction (relative to registration) does the call go?

From 192.168.1.2 to 217.66.118.164 via proxy 192.168.1.1. The registration is in the same direction. The expectation seems to be in the opposite direction.

Regards,
Victor

#14 lore raw

sip connection tracking & expectations

In reply to Patrick McHardy

Hello people,

I have retried getting sip working. I have tried to create manual expectations, to see which one works, since the default onces created by the sip conntrack module in pom don't work for me.

For simplicity (only one expectation) i have tried a nat setup:

lan client ---- nat gateway ---- sip server

lan client has: 192.168.1.2
nat gateway: 192.168.1.1 and 80.126.43.45
sip server: 217.66.118.164

Kernel 2.6.15, pom 20060101 with ip_ct_refresh fix.

ip_conntrack_sip and ip_nat_sip loaded, all RELATED is accepted.

The client (192.168.1.2) registers at the sip server sip.xs4all.nl (217.66.118.164).

When i call my voicemail [email protected] i see the following expectations getting generated automaticly:
180 proto=17 src=217.66.118.164 dst=80.126.43.45 sport=0 dport=7078
180 proto=17 src=217.66.118.164 dst=80.126.43.45 sport=0 dport=10500

After the call was initiated, i started to see REJECTs on the lan side of my firewall like this:
192.168.1.2:7078 -> 217.66.118.146:34106
(note the different ipaddress, this is not a typo)

Then i manually added this expectation using the conntrack tool:
180 proto=17 src=192.168.1.2 dst=217.66.118.146 sport=7078 dport=34106

And the REJECT messages stopped, and i suddenly heard the audio!

Next to the REJECTs above, i saw in a low frequency (about 1 for 30 of above) the following REJECTs:
192.168.1.2:7079 -> 217.66.118.146:34107

So i added that expectation as well:
180 proto=17 src=192.168.1.2 dst=217.66.118.146 sport=7079 dport=34107

Now no REJECTs were showing at the firewall anymore.

When all is working i see the following connections in /proc/net/ip_conntrack

udp 17 3562 src=192.168.1.2 dst=217.66.118.164 sport=5060 dport=5060 packets=8 bytes=4714 src=217.66.118.164 dst=80.126.43.45 sport=5060 dport=5060 packets=12 bytes=4003 [ASSURED] mark=0 use=3

udp 17 29 src=192.168.1.2 dst=217.66.118.146 sport=7079 dport=34107 packets=7 bytes=1036 [UNREPLIED] src=217.66.118.146 dst=80.126.43.45 sport=34107 dport=7079 packets=0 bytes=0 mark=0 use=1

udp 17 179 src=192.168.1.2 dst=217.66.118.146 sport=7078 dport=334106 packets=2283 bytes=455820 src=217.66.118.146 dst=80.126.43.45 sport=34106 dport=7078 packets=2278 bytes=455600 [ASSURED] mark=0 use=1

If you need more info, let me know.

Regards,
Victor