Commit 8b0a231d authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by pablo

netfilter: ctnetlink: remove nowait parameter from *fill_info()

This patch is a cleanup, it removes the `nowait' parameter
from all *fill_info() function since it is always set to one.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent f49c857f
...@@ -350,8 +350,7 @@ ctnetlink_dump_use(struct sk_buff *skb, const struct nf_conn *ct) ...@@ -350,8 +350,7 @@ ctnetlink_dump_use(struct sk_buff *skb, const struct nf_conn *ct)
static int static int
ctnetlink_fill_info(struct sk_buff *skb, u32 pid, u32 seq, ctnetlink_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
int event, int nowait, int event, const struct nf_conn *ct)
const struct nf_conn *ct)
{ {
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
struct nfgenmsg *nfmsg; struct nfgenmsg *nfmsg;
...@@ -362,7 +361,7 @@ ctnetlink_fill_info(struct sk_buff *skb, u32 pid, u32 seq, ...@@ -362,7 +361,7 @@ ctnetlink_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(struct nfgenmsg)); nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(struct nfgenmsg));
nfmsg = NLMSG_DATA(nlh); nfmsg = NLMSG_DATA(nlh);
nlh->nlmsg_flags = (nowait && pid) ? NLM_F_MULTI : 0; nlh->nlmsg_flags = pid ? NLM_F_MULTI : 0;
nfmsg->nfgen_family = nf_ct_l3num(ct); nfmsg->nfgen_family = nf_ct_l3num(ct);
nfmsg->version = NFNETLINK_V0; nfmsg->version = NFNETLINK_V0;
nfmsg->res_id = 0; nfmsg->res_id = 0;
...@@ -637,8 +636,7 @@ ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -637,8 +636,7 @@ ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
} }
if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid, if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq,
IPCTNL_MSG_CT_NEW, IPCTNL_MSG_CT_NEW, ct) < 0) {
1, ct) < 0) {
cb->args[1] = (unsigned long)ct; cb->args[1] = (unsigned long)ct;
goto out; goto out;
} }
...@@ -880,7 +878,7 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb, ...@@ -880,7 +878,7 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
rcu_read_lock(); rcu_read_lock();
err = ctnetlink_fill_info(skb2, NETLINK_CB(skb).pid, nlh->nlmsg_seq, err = ctnetlink_fill_info(skb2, NETLINK_CB(skb).pid, nlh->nlmsg_seq,
IPCTNL_MSG_CT_NEW, 1, ct); IPCTNL_MSG_CT_NEW, ct);
rcu_read_unlock(); rcu_read_unlock();
nf_ct_put(ct); nf_ct_put(ct);
if (err <= 0) if (err <= 0)
...@@ -1503,9 +1501,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb, ...@@ -1503,9 +1501,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb,
static int static int
ctnetlink_exp_fill_info(struct sk_buff *skb, u32 pid, u32 seq, ctnetlink_exp_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
int event, int event, const struct nf_conntrack_expect *exp)
int nowait,
const struct nf_conntrack_expect *exp)
{ {
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
struct nfgenmsg *nfmsg; struct nfgenmsg *nfmsg;
...@@ -1515,7 +1511,7 @@ ctnetlink_exp_fill_info(struct sk_buff *skb, u32 pid, u32 seq, ...@@ -1515,7 +1511,7 @@ ctnetlink_exp_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(struct nfgenmsg)); nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(struct nfgenmsg));
nfmsg = NLMSG_DATA(nlh); nfmsg = NLMSG_DATA(nlh);
nlh->nlmsg_flags = (nowait && pid) ? NLM_F_MULTI : 0; nlh->nlmsg_flags = pid ? NLM_F_MULTI : 0;
nfmsg->nfgen_family = exp->tuple.src.l3num; nfmsg->nfgen_family = exp->tuple.src.l3num;
nfmsg->version = NFNETLINK_V0; nfmsg->version = NFNETLINK_V0;
nfmsg->res_id = 0; nfmsg->res_id = 0;
...@@ -1617,10 +1613,11 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -1617,10 +1613,11 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
continue; continue;
cb->args[1] = 0; cb->args[1] = 0;
} }
if (ctnetlink_exp_fill_info(skb, NETLINK_CB(cb->skb).pid, if (ctnetlink_exp_fill_info(skb,
NETLINK_CB(cb->skb).pid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq,
IPCTNL_MSG_EXP_NEW, IPCTNL_MSG_EXP_NEW,
1, exp) < 0) { exp) < 0) {
if (!atomic_inc_not_zero(&exp->use)) if (!atomic_inc_not_zero(&exp->use))
continue; continue;
cb->args[1] = (unsigned long)exp; cb->args[1] = (unsigned long)exp;
...@@ -1689,8 +1686,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb, ...@@ -1689,8 +1686,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,
rcu_read_lock(); rcu_read_lock();
err = ctnetlink_exp_fill_info(skb2, NETLINK_CB(skb).pid, err = ctnetlink_exp_fill_info(skb2, NETLINK_CB(skb).pid,
nlh->nlmsg_seq, IPCTNL_MSG_EXP_NEW, nlh->nlmsg_seq, IPCTNL_MSG_EXP_NEW, exp);
1, exp);
rcu_read_unlock(); rcu_read_unlock();
if (err <= 0) if (err <= 0)
goto free; goto free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment