aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/fib_rules.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/fib_rules.c')
-rw-r--r--net/core/fib_rules.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 7b2e9bb1a605..a99d87d82b7f 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -161,9 +161,6 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
161 if (err < 0) 161 if (err < 0)
162 goto errout; 162 goto errout;
163 163
164 if (tb[FRA_IFNAME] && nla_len(tb[FRA_IFNAME]) > IFNAMSIZ)
165 goto errout;
166
167 rule = kzalloc(ops->rule_size, GFP_KERNEL); 164 rule = kzalloc(ops->rule_size, GFP_KERNEL);
168 if (rule == NULL) { 165 if (rule == NULL) {
169 err = -ENOMEM; 166 err = -ENOMEM;
@@ -177,10 +174,7 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
177 struct net_device *dev; 174 struct net_device *dev;
178 175
179 rule->ifindex = -1; 176 rule->ifindex = -1;
180 if (nla_strlcpy(rule->ifname, tb[FRA_IFNAME], 177 nla_strlcpy(rule->ifname, tb[FRA_IFNAME], IFNAMSIZ);
181 IFNAMSIZ) >= IFNAMSIZ)
182 goto errout_free;
183
184 dev = __dev_get_by_name(rule->ifname); 178 dev = __dev_get_by_name(rule->ifname);
185 if (dev) 179 if (dev)
186 rule->ifindex = dev->ifindex; 180 rule->ifindex = dev->ifindex;