nexthop.c (11dd74b338bf83f8bca70b57bad33a903fedfa6e) nexthop.c (4f80116d3df3b23ee4b83ea8557629e1799bc230)
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>

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

779 }
780 if (do_flush)
781 fib_flush(net);
782
783 /* ip6_del_rt removes the entry from this list hence the _safe */
784 list_for_each_entry_safe(f6i, tmp, &nh->f6i_list, nh_list) {
785 /* __ip6_del_rt does a release, so do a hold here */
786 fib6_info_hold(f6i);
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>

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

779 }
780 if (do_flush)
781 fib_flush(net);
782
783 /* ip6_del_rt removes the entry from this list hence the _safe */
784 list_for_each_entry_safe(f6i, tmp, &nh->f6i_list, nh_list) {
785 /* __ip6_del_rt does a release, so do a hold here */
786 fib6_info_hold(f6i);
787 ipv6_stub->ip6_del_rt(net, f6i, false);
787 ipv6_stub->ip6_del_rt(net, f6i,
788 !net->ipv4.sysctl_nexthop_compat_mode);
788 }
789}
790
791static void __remove_nexthop(struct net *net, struct nexthop *nh,
792 struct nl_info *nlinfo)
793{
794 __remove_nexthop_fib(net, nh);
795

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

1036
1037 rb_link_node_rcu(&new_nh->rb_node, parent, pp);
1038 rb_insert_color(&new_nh->rb_node, root);
1039 rc = 0;
1040out:
1041 if (!rc) {
1042 nh_base_seq_inc(net);
1043 nexthop_notify(RTM_NEWNEXTHOP, new_nh, &cfg->nlinfo);
789 }
790}
791
792static void __remove_nexthop(struct net *net, struct nexthop *nh,
793 struct nl_info *nlinfo)
794{
795 __remove_nexthop_fib(net, nh);
796

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

1037
1038 rb_link_node_rcu(&new_nh->rb_node, parent, pp);
1039 rb_insert_color(&new_nh->rb_node, root);
1040 rc = 0;
1041out:
1042 if (!rc) {
1043 nh_base_seq_inc(net);
1044 nexthop_notify(RTM_NEWNEXTHOP, new_nh, &cfg->nlinfo);
1044 if (replace_notify)
1045 if (replace_notify && net->ipv4.sysctl_nexthop_compat_mode)
1045 nexthop_replace_notify(net, new_nh, &cfg->nlinfo);
1046 }
1047
1048 return rc;
1049}
1050
1051/* rtnl */
1052/* remove all nexthops tied to a device being deleted */

--- 777 unchanged lines hidden ---
1046 nexthop_replace_notify(net, new_nh, &cfg->nlinfo);
1047 }
1048
1049 return rc;
1050}
1051
1052/* rtnl */
1053/* remove all nexthops tied to a device being deleted */

--- 777 unchanged lines hidden ---