Skip to content

Commit

Permalink
netfilter: nf_ct_sip: fix helper name
Browse files Browse the repository at this point in the history
Commit 3a8fc53 (netfilter: nf_ct_helper: allocate 16 bytes for the helper
and policy names) introduced a bug in the SIP helper, the helper name is
sprinted to the sip_names array instead of instead of into the helper
structure. This breaks the helper match and the /proc/net/nf_conntrack_expect
output.

Signed-off-by: Patrick McHardy <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
kaber authored and ummakynes committed Aug 10, 2012
1 parent a2d6a1d commit e9324b2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/netfilter/nf_conntrack_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,6 @@ static int sip_help_udp(struct sk_buff *skb, unsigned int protoff,
}

static struct nf_conntrack_helper sip[MAX_PORTS][4] __read_mostly;
static char sip_names[MAX_PORTS][4][sizeof("sip-65535")] __read_mostly;

static const struct nf_conntrack_expect_policy sip_exp_policy[SIP_EXPECT_MAX + 1] = {
[SIP_EXPECT_SIGNALLING] = {
Expand Down Expand Up @@ -1585,9 +1584,9 @@ static int __init nf_conntrack_sip_init(void)
sip[i][j].me = THIS_MODULE;

if (ports[i] == SIP_PORT)
sprintf(sip_names[i][j], "sip");
sprintf(sip[i][j].name, "sip");
else
sprintf(sip_names[i][j], "sip-%u", i);
sprintf(sip[i][j].name, "sip-%u", i);

pr_debug("port #%u: %u\n", i, ports[i]);

Expand Down

0 comments on commit e9324b2

Please sign in to comment.