Skip to content

Commit

Permalink
em_ipset: use dev_net() accessor
Browse files Browse the repository at this point in the history
Randy found that if network namespace not enabled then
nd_net does not exist and would cause compilation failure.

This is handled correctly by using the dev_net() macro.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Oct 18, 2013
1 parent 675297c commit b1eda2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sched/em_ipset.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static int em_ipset_change(struct tcf_proto *tp, void *data, int data_len,
{
struct xt_set_info *set = data;
ip_set_id_t index;
struct net *net = qdisc_dev(tp->q)->nd_net;
struct net *net = dev_net(qdisc_dev(tp->q));

if (data_len != sizeof(*set))
return -EINVAL;
Expand All @@ -46,7 +46,7 @@ static void em_ipset_destroy(struct tcf_proto *p, struct tcf_ematch *em)
{
const struct xt_set_info *set = (const void *) em->data;
if (set) {
ip_set_nfnl_put(qdisc_dev(p->q)->nd_net, set->index);
ip_set_nfnl_put(dev_net(qdisc_dev(p->q)), set->index);
kfree((void *) em->data);
}
}
Expand Down

0 comments on commit b1eda2a

Please sign in to comment.