diff options
| author | Kevin Cernekee <cernekee@gmail.com> | 2012-12-17 13:33:58 -0500 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-01-17 15:12:44 -0500 |
| commit | 7266507d89991fa1e989283e4e032c6d9357fe26 (patch) | |
| tree | aca858b5ac98c695d8b636a9d27549a3af37e016 /include/linux | |
| parent | 247fa82be1301e4f89eaa5dc10be62a9cc84e8c5 (diff) | |
netfilter: nf_ct_sip: support Cisco 7941/7945 IP phones
Most SIP devices use a source port of 5060/udp on SIP requests, so the
response automatically comes back to port 5060:
phone_ip:5060 -> proxy_ip:5060 REGISTER
proxy_ip:5060 -> phone_ip:5060 100 Trying
The newer Cisco IP phones, however, use a randomly chosen high source
port for the SIP request but expect the response on port 5060:
phone_ip:49173 -> proxy_ip:5060 REGISTER
proxy_ip:5060 -> phone_ip:5060 100 Trying
Standard Linux NAT, with or without nf_nat_sip, will send the reply back
to port 49173, not 5060:
phone_ip:49173 -> proxy_ip:5060 REGISTER
proxy_ip:5060 -> phone_ip:49173 100 Trying
But the phone is not listening on 49173, so it will never see the reply.
This patch modifies nf_*_sip to work around this quirk by extracting
the SIP response port from the Via: header, iff the source IP in the
packet header matches the source IP in the SIP request.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netfilter/nf_conntrack_sip.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 387bdd02945d..ba7f571a2b1c 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
| @@ -4,12 +4,15 @@ | |||
| 4 | 4 | ||
| 5 | #include <net/netfilter/nf_conntrack_expect.h> | 5 | #include <net/netfilter/nf_conntrack_expect.h> |
| 6 | 6 | ||
| 7 | #include <linux/types.h> | ||
| 8 | |||
| 7 | #define SIP_PORT 5060 | 9 | #define SIP_PORT 5060 |
| 8 | #define SIP_TIMEOUT 3600 | 10 | #define SIP_TIMEOUT 3600 |
| 9 | 11 | ||
| 10 | struct nf_ct_sip_master { | 12 | struct nf_ct_sip_master { |
| 11 | unsigned int register_cseq; | 13 | unsigned int register_cseq; |
| 12 | unsigned int invite_cseq; | 14 | unsigned int invite_cseq; |
| 15 | __be16 forced_dport; | ||
| 13 | }; | 16 | }; |
| 14 | 17 | ||
| 15 | enum sip_expectation_classes { | 18 | enum sip_expectation_classes { |
