aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--net/netfilter/nf_conntrack_netlink.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 6c3f964de9e1..b909241b668e 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -144,6 +144,8 @@ static inline u_int8_t nf_ct_protonum(const struct nf_conn *ct)
144 return ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum; 144 return ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum;
145} 145}
146 146
147#define nf_ct_tuple(ct, dir) (&(ct)->tuplehash[dir].tuple)
148
147/* get master conntrack via master expectation */ 149/* get master conntrack via master expectation */
148#define master_ct(conntr) (conntr->master) 150#define master_ct(conntr) (conntr->master)
149 151
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 2d7d69ff215d..3553f3941259 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -346,8 +346,6 @@ nla_put_failure:
346 return -1; 346 return -1;
347} 347}
348 348
349#define tuple(ct, dir) (&(ct)->tuplehash[dir].tuple)
350
351static int 349static int
352ctnetlink_fill_info(struct sk_buff *skb, u32 pid, u32 seq, 350ctnetlink_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
353 int event, const struct nf_conn *ct) 351 int event, const struct nf_conn *ct)
@@ -369,14 +367,14 @@ ctnetlink_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
369 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG | NLA_F_NESTED); 367 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG | NLA_F_NESTED);
370 if (!nest_parms) 368 if (!nest_parms)
371 goto nla_put_failure; 369 goto nla_put_failure;
372 if (ctnetlink_dump_tuples(skb, tuple(ct, IP_CT_DIR_ORIGINAL)) < 0) 370 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_ORIGINAL)) < 0)
373 goto nla_put_failure; 371 goto nla_put_failure;
374 nla_nest_end(skb, nest_parms); 372 nla_nest_end(skb, nest_parms);
375 373
376 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY | NLA_F_NESTED); 374 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY | NLA_F_NESTED);
377 if (!nest_parms) 375 if (!nest_parms)
378 goto nla_put_failure; 376 goto nla_put_failure;
379 if (ctnetlink_dump_tuples(skb, tuple(ct, IP_CT_DIR_REPLY)) < 0) 377 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_REPLY)) < 0)
380 goto nla_put_failure; 378 goto nla_put_failure;
381 nla_nest_end(skb, nest_parms); 379 nla_nest_end(skb, nest_parms);
382 380
@@ -509,7 +507,8 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
509 if (!item->report && !nfnetlink_has_listeners(group)) 507 if (!item->report && !nfnetlink_has_listeners(group))
510 return NOTIFY_DONE; 508 return NOTIFY_DONE;
511 509
512 skb = ctnetlink_alloc_skb(tuple(ct, IP_CT_DIR_ORIGINAL), GFP_ATOMIC); 510 skb = ctnetlink_alloc_skb(nf_ct_tuple(ct, IP_CT_DIR_ORIGINAL),
511 GFP_ATOMIC);
513 if (!skb) 512 if (!skb)
514 goto errout; 513 goto errout;
515 514
@@ -528,14 +527,14 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
528 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG | NLA_F_NESTED); 527 nest_parms = nla_nest_start(skb, CTA_TUPLE_ORIG | NLA_F_NESTED);
529 if (!nest_parms) 528 if (!nest_parms)
530 goto nla_put_failure; 529 goto nla_put_failure;
531 if (ctnetlink_dump_tuples(skb, tuple(ct, IP_CT_DIR_ORIGINAL)) < 0) 530 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_ORIGINAL)) < 0)
532 goto nla_put_failure; 531 goto nla_put_failure;
533 nla_nest_end(skb, nest_parms); 532 nla_nest_end(skb, nest_parms);
534 533
535 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY | NLA_F_NESTED); 534 nest_parms = nla_nest_start(skb, CTA_TUPLE_REPLY | NLA_F_NESTED);
536 if (!nest_parms) 535 if (!nest_parms)
537 goto nla_put_failure; 536 goto nla_put_failure;
538 if (ctnetlink_dump_tuples(skb, tuple(ct, IP_CT_DIR_REPLY)) < 0) 537 if (ctnetlink_dump_tuples(skb, nf_ct_tuple(ct, IP_CT_DIR_REPLY)) < 0)
539 goto nla_put_failure; 538 goto nla_put_failure;
540 nla_nest_end(skb, nest_parms); 539 nla_nest_end(skb, nest_parms);
541 540