Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 55973
b: refs/heads/master
c: df293bb
h: refs/heads/master
i:
  55971: 3f400a1
v: v3
  • Loading branch information
Yasuyuki Kozakai authored and David S. Miller committed May 11, 2007
1 parent 44d032c commit 55b5293
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 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: fda61436835f6d46b6d85d4fe9206ffe682fe7f0
refs/heads/master: df293bbb6ff80f40a2308140ba4cbc2d3c1b18da
40 changes: 22 additions & 18 deletions trunk/net/netfilter/nf_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,11 +830,6 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nfattr *cda[])
char *helpname;
int err;

if (!help) {
/* FIXME: we need to reallocate and rehash */
return -EBUSY;
}

/* don't change helper of sibling connections */
if (ct->master)
return -EINVAL;
Expand All @@ -843,25 +838,34 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nfattr *cda[])
if (err < 0)
return err;

helper = __nf_conntrack_helper_find_byname(helpname);
if (!helper) {
if (!strcmp(helpname, ""))
helper = NULL;
else
return -EINVAL;
}

if (help->helper) {
if (!helper) {
if (!strcmp(helpname, "")) {
if (help && help->helper) {
/* we had a helper before ... */
nf_ct_remove_expectations(ct);
help->helper = NULL;
} else {
/* need to zero data of old helper */
memset(&help->help, 0, sizeof(help->help));
}

return 0;
}

if (!help) {
/* FIXME: we need to reallocate and rehash */
return -EBUSY;
}

helper = __nf_conntrack_helper_find_byname(helpname);
if (helper == NULL)
return -EINVAL;

if (help->helper == helper)
return 0;

if (help->helper)
/* we had a helper before ... */
nf_ct_remove_expectations(ct);

/* need to zero data of old helper */
memset(&help->help, 0, sizeof(help->help));
help->helper = helper;

return 0;
Expand Down

0 comments on commit 55b5293

Please sign in to comment.