fib_semantics.c (e5c9a223da3c5bb9563ecf4ebe0c32de39dbc620) fib_semantics.c (4f80116d3df3b23ee4b83ea8557629e1799bc230)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * IPv4 Forwarding Information Base: semantics.
8 *

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

1775 nla_put_in_addr(skb, RTA_PREFSRC, fi->fib_prefsrc))
1776 goto nla_put_failure;
1777
1778 if (fi->nh) {
1779 if (nla_put_u32(skb, RTA_NH_ID, fi->nh->id))
1780 goto nla_put_failure;
1781 if (nexthop_is_blackhole(fi->nh))
1782 rtm->rtm_type = RTN_BLACKHOLE;
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * IPv4 Forwarding Information Base: semantics.
8 *

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

1775 nla_put_in_addr(skb, RTA_PREFSRC, fi->fib_prefsrc))
1776 goto nla_put_failure;
1777
1778 if (fi->nh) {
1779 if (nla_put_u32(skb, RTA_NH_ID, fi->nh->id))
1780 goto nla_put_failure;
1781 if (nexthop_is_blackhole(fi->nh))
1782 rtm->rtm_type = RTN_BLACKHOLE;
1783 if (!fi->fib_net->ipv4.sysctl_nexthop_compat_mode)
1784 goto offload;
1783 }
1784
1785 if (nhs == 1) {
1786 const struct fib_nh_common *nhc = fib_info_nhc(fi, 0);
1787 unsigned char flags = 0;
1788
1789 if (fib_nexthop_info(skb, nhc, AF_INET, &flags, false) < 0)
1790 goto nla_put_failure;

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

1800 goto nla_put_failure;
1801 }
1802#endif
1803 } else {
1804 if (fib_add_multipath(skb, fi) < 0)
1805 goto nla_put_failure;
1806 }
1807
1785 }
1786
1787 if (nhs == 1) {
1788 const struct fib_nh_common *nhc = fib_info_nhc(fi, 0);
1789 unsigned char flags = 0;
1790
1791 if (fib_nexthop_info(skb, nhc, AF_INET, &flags, false) < 0)
1792 goto nla_put_failure;

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

1802 goto nla_put_failure;
1803 }
1804#endif
1805 } else {
1806 if (fib_add_multipath(skb, fi) < 0)
1807 goto nla_put_failure;
1808 }
1809
1810offload:
1808 if (fri->offload)
1809 rtm->rtm_flags |= RTM_F_OFFLOAD;
1810 if (fri->trap)
1811 rtm->rtm_flags |= RTM_F_TRAP;
1812
1813 nlmsg_end(skb, nlh);
1814 return 0;
1815

--- 412 unchanged lines hidden ---
1811 if (fri->offload)
1812 rtm->rtm_flags |= RTM_F_OFFLOAD;
1813 if (fri->trap)
1814 rtm->rtm_flags |= RTM_F_TRAP;
1815
1816 nlmsg_end(skb, nlh);
1817 return 0;
1818

--- 412 unchanged lines hidden ---