nexthop.c (e95f2592f633a334b175003f13f42d3c217dc657) nexthop.c (732d167bf5f53a8c1e8c53cf7dbffe2a13f63752)
1// SPDX-License-Identifier: GPL-2.0
2/* Generic nexthop implementation
3 *
4 * Copyright (c) 2017-19 Cumulus Networks
5 * Copyright (c) 2017-19 David Ahern <dsa@cumulusnetworks.com>
6 */
7
8#include <linux/nexthop.h>

--- 1264 unchanged lines hidden (view full) ---

1273 if (replace && !create) {
1274 NL_SET_ERR_MSG(extack, "Replace specified without create and no entry exists");
1275 rc = -ENOENT;
1276 goto out;
1277 }
1278
1279 rb_link_node_rcu(&new_nh->rb_node, parent, pp);
1280 rb_insert_color(&new_nh->rb_node, root);
1// SPDX-License-Identifier: GPL-2.0
2/* Generic nexthop implementation
3 *
4 * Copyright (c) 2017-19 Cumulus Networks
5 * Copyright (c) 2017-19 David Ahern <dsa@cumulusnetworks.com>
6 */
7
8#include <linux/nexthop.h>

--- 1264 unchanged lines hidden (view full) ---

1273 if (replace && !create) {
1274 NL_SET_ERR_MSG(extack, "Replace specified without create and no entry exists");
1275 rc = -ENOENT;
1276 goto out;
1277 }
1278
1279 rb_link_node_rcu(&new_nh->rb_node, parent, pp);
1280 rb_insert_color(&new_nh->rb_node, root);
1281 rc = 0;
1281
1282 rc = call_nexthop_notifiers(net, NEXTHOP_EVENT_REPLACE, new_nh, extack);
1283 if (rc)
1284 rb_erase(&new_nh->rb_node, &net->nexthop.rb_root);
1285
1282out:
1283 if (!rc) {
1284 nh_base_seq_inc(net);
1285 nexthop_notify(RTM_NEWNEXTHOP, new_nh, &cfg->nlinfo);
1286 if (replace_notify && net->ipv4.sysctl_nexthop_compat_mode)
1287 nexthop_replace_notify(net, new_nh, &cfg->nlinfo);
1288 }
1289

--- 861 unchanged lines hidden ---
1286out:
1287 if (!rc) {
1288 nh_base_seq_inc(net);
1289 nexthop_notify(RTM_NEWNEXTHOP, new_nh, &cfg->nlinfo);
1290 if (replace_notify && net->ipv4.sysctl_nexthop_compat_mode)
1291 nexthop_replace_notify(net, new_nh, &cfg->nlinfo);
1292 }
1293

--- 861 unchanged lines hidden ---