diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/fib_trie.c | 5 | ||||
-rw-r--r-- | net/switchdev/switchdev.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 90955455884e..fcfa9825a816 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1155,6 +1155,7 @@ int fib_table_insert(struct fib_table *tb, struct fib_config *cfg) | |||
1155 | err = netdev_switch_fib_ipv4_add(key, plen, fi, | 1155 | err = netdev_switch_fib_ipv4_add(key, plen, fi, |
1156 | new_fa->fa_tos, | 1156 | new_fa->fa_tos, |
1157 | cfg->fc_type, | 1157 | cfg->fc_type, |
1158 | cfg->fc_nlflags, | ||
1158 | tb->tb_id); | 1159 | tb->tb_id); |
1159 | if (err) { | 1160 | if (err) { |
1160 | netdev_switch_fib_ipv4_abort(fi); | 1161 | netdev_switch_fib_ipv4_abort(fi); |
@@ -1201,7 +1202,9 @@ int fib_table_insert(struct fib_table *tb, struct fib_config *cfg) | |||
1201 | 1202 | ||
1202 | /* (Optionally) offload fib entry to switch hardware. */ | 1203 | /* (Optionally) offload fib entry to switch hardware. */ |
1203 | err = netdev_switch_fib_ipv4_add(key, plen, fi, tos, | 1204 | err = netdev_switch_fib_ipv4_add(key, plen, fi, tos, |
1204 | cfg->fc_type, tb->tb_id); | 1205 | cfg->fc_type, |
1206 | cfg->fc_nlflags, | ||
1207 | tb->tb_id); | ||
1205 | if (err) { | 1208 | if (err) { |
1206 | netdev_switch_fib_ipv4_abort(fi); | 1209 | netdev_switch_fib_ipv4_abort(fi); |
1207 | goto out_free_new_fa; | 1210 | goto out_free_new_fa; |
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index aba6aa2656d8..8cf42a69baf4 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * net/switchdev/switchdev.c - Switch device API | 2 | * net/switchdev/switchdev.c - Switch device API |
3 | * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us> | 3 | * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us> |
4 | * Copyright (c) 2014-2015 Scott Feldman <sfeldma@gmail.com> | ||
4 | * | 5 | * |
5 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -294,12 +295,13 @@ static struct net_device *netdev_switch_get_dev_by_nhs(struct fib_info *fi) | |||
294 | * @fi: route FIB info structure | 295 | * @fi: route FIB info structure |
295 | * @tos: route TOS | 296 | * @tos: route TOS |
296 | * @type: route type | 297 | * @type: route type |
298 | * @nlflags: netlink flags passed in (NLM_F_*) | ||
297 | * @tb_id: route table ID | 299 | * @tb_id: route table ID |
298 | * | 300 | * |
299 | * Add IPv4 route entry to switch device. | 301 | * Add IPv4 route entry to switch device. |
300 | */ | 302 | */ |
301 | int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi, | 303 | int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi, |
302 | u8 tos, u8 type, u32 tb_id) | 304 | u8 tos, u8 type, u32 nlflags, u32 tb_id) |
303 | { | 305 | { |
304 | struct net_device *dev; | 306 | struct net_device *dev; |
305 | const struct net_device_ops *ops; | 307 | const struct net_device_ops *ops; |
@@ -324,7 +326,8 @@ int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi, | |||
324 | 326 | ||
325 | if (ops->ndo_switch_fib_ipv4_add) { | 327 | if (ops->ndo_switch_fib_ipv4_add) { |
326 | err = ops->ndo_switch_fib_ipv4_add(dev, htonl(dst), dst_len, | 328 | err = ops->ndo_switch_fib_ipv4_add(dev, htonl(dst), dst_len, |
327 | fi, tos, type, tb_id); | 329 | fi, tos, type, nlflags, |
330 | tb_id); | ||
328 | if (!err) | 331 | if (!err) |
329 | fi->fib_flags |= RTNH_F_EXTERNAL; | 332 | fi->fib_flags |= RTNH_F_EXTERNAL; |
330 | } | 333 | } |