Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315012
b: refs/heads/master
c: 51b4c82
h: refs/heads/master
v: v3
  • Loading branch information
Gao feng authored and Pablo Neira Ayuso committed Jun 27, 2012
1 parent ca59d0d commit d4f6481
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dee7364e0e522f9cd90187c28dbb64889a17e191
refs/heads/master: 51b4c824fcd15b73931fdd945cc101b9d4791b17
43 changes: 26 additions & 17 deletions trunk/net/netfilter/nf_conntrack_proto_udplite.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,29 +234,38 @@ static struct ctl_table udplite_sysctl_table[] = {
};
#endif /* CONFIG_SYSCTL */

static int udplite_init_net(struct net *net, u_int16_t proto)
static int udplite_kmemdup_sysctl_table(struct nf_proto_net *pn,
struct udplite_net *un)
{
int i;
struct udplite_net *un = udplite_pernet(net);
struct nf_proto_net *pn = (struct nf_proto_net *)un;
#ifdef CONFIG_SYSCTL
if (!pn->ctl_table) {
#else
if (!pn->users++) {
if (pn->ctl_table)
return 0;

pn->ctl_table = kmemdup(udplite_sysctl_table,
sizeof(udplite_sysctl_table),
GFP_KERNEL);
if (!pn->ctl_table)
return -ENOMEM;

pn->ctl_table[0].data = &un->timeouts[UDPLITE_CT_UNREPLIED];
pn->ctl_table[1].data = &un->timeouts[UDPLITE_CT_REPLIED];
#endif
return 0;
}

static int udplite_init_net(struct net *net, u_int16_t proto)
{
struct udplite_net *un = udplite_pernet(net);
struct nf_proto_net *pn = &un->pn;

if (!pn->users) {
int i;

for (i = 0 ; i < UDPLITE_CT_MAX; i++)
un->timeouts[i] = udplite_timeouts[i];
#ifdef CONFIG_SYSCTL
pn->ctl_table = kmemdup(udplite_sysctl_table,
sizeof(udplite_sysctl_table),
GFP_KERNEL);
if (!pn->ctl_table)
return -ENOMEM;
pn->ctl_table[0].data = &un->timeouts[UDPLITE_CT_UNREPLIED];
pn->ctl_table[1].data = &un->timeouts[UDPLITE_CT_REPLIED];
#endif
}
return 0;

return udplite_kmemdup_sysctl_table(pn, un);
}

static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 __read_mostly =
Expand Down

0 comments on commit d4f6481

Please sign in to comment.