Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 868d13ac authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller
Browse files

[NETNS]: Pass fib_rules_ops into default_pref method.



fib_rules_ops contains operations and the list of configured rules. ops will
become per/namespace soon, so we need them to be known in the default_pref
callback.

Acked-by: default avatarBenjamin Thery <benjamin.thery@bull.net>
Acked-by: default avatarDaniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f8c26b8d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ struct fib_rules_ops
	int			(*fill)(struct fib_rule *, struct sk_buff *,
					struct nlmsghdr *,
					struct fib_rule_hdr *);
	u32			(*default_pref)(void);
	u32			(*default_pref)(struct fib_rules_ops *ops);
	size_t			(*nlmsg_payload)(struct fib_rule *);

	/* Called after modifications to the rules set, must flush
+1 −1
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
	rule->table = frh_get_table(frh, tb);

	if (!rule->pref && ops->default_pref)
		rule->pref = ops->default_pref();
		rule->pref = ops->default_pref(ops);

	err = -EINVAL;
	if (tb[FRA_GOTO]) {
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ static int dn_fib_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
	return -ENOBUFS;
}

static u32 dn_fib_rule_default_pref(void)
static u32 dn_fib_rule_default_pref(struct fib_rules_ops *ops)
{
	struct list_head *pos;
	struct fib_rule *rule;
+1 −1
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ static int fib4_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
	return -ENOBUFS;
}

static u32 fib4_rule_default_pref(void)
static u32 fib4_rule_default_pref(struct fib_rules_ops *ops)
{
	struct list_head *pos;
	struct fib_rule *rule;
+1 −1
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
	return -ENOBUFS;
}

static u32 fib6_rule_default_pref(void)
static u32 fib6_rule_default_pref(struct fib_rules_ops *ops)
{
	return 0x3FFF;
}