History

netfilter: nf_ct_sip: fix IPv6 address parsing

Within SIP messages IPv6 addresses are enclosed in square brackets in most cases, with the exception of the "received=" header parameter. Currently the helper fails to parse enclosed addresses. This patch: - changes the SIP address parsing function to enforce square brackets when required, and accept them when not required but present, as recommended by RFC 5118. - adds a new SDP address parsing function that never accepts square brackets since SDP doesn't use them. With these changes, the SIP helper correctly parses all test messages from RFC 5118 (Session Initiation Protocol (SIP) Torture Test Messages for Internet Protocol Version 6 (IPv6)).

Patrick McHardy committed 14 years ago

Commit 02b69cb1 parent e9324b23 files · +73 −20Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/netfilter/nf_conntrack_sip.h+1−1
@@ -164,7 +164,7 @@ extern int ct_sip_parse_address_param(const struct nf_conn *ct, const char *dptr · 163 unmodified lines
164164 unsigned int dataoff, unsigned int datalen,
165165 const char *name,
166166 unsigned int *matchoff, unsigned int *matchlen,
167− union nf_inet_addr *addr);
167+ union nf_inet_addr *addr, bool delim);
168168 extern int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr,
169169 unsigned int off, unsigned int datalen,
170170 const char *name,