route.c (310b7cec8ea32dcd4e9978423717ce78dd89d45d) route.c (6f9c961546699ff8bc5e1c1c52200616867ec68a)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Authors: Ross Biro

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

1433#ifdef CONFIG_IP_MULTIPLE_TABLES
1434 set_class_tag(rt, res->tclassid);
1435#endif
1436 set_class_tag(rt, itag);
1437#endif
1438}
1439
1440static struct rtable *rt_dst_alloc(struct net_device *dev,
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Authors: Ross Biro

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

1433#ifdef CONFIG_IP_MULTIPLE_TABLES
1434 set_class_tag(rt, res->tclassid);
1435#endif
1436 set_class_tag(rt, itag);
1437#endif
1438}
1439
1440static struct rtable *rt_dst_alloc(struct net_device *dev,
1441 unsigned int flags, u16 type,
1441 bool nopolicy, bool noxfrm, bool will_cache)
1442{
1442 bool nopolicy, bool noxfrm, bool will_cache)
1443{
1443 return dst_alloc(&ipv4_dst_ops, dev, 1, DST_OBSOLETE_FORCE_CHK,
1444 (will_cache ? 0 : (DST_HOST | DST_NOCACHE)) |
1445 (nopolicy ? DST_NOPOLICY : 0) |
1446 (noxfrm ? DST_NOXFRM : 0));
1444 struct rtable *rt;
1445
1446 rt = dst_alloc(&ipv4_dst_ops, dev, 1, DST_OBSOLETE_FORCE_CHK,
1447 (will_cache ? 0 : (DST_HOST | DST_NOCACHE)) |
1448 (nopolicy ? DST_NOPOLICY : 0) |
1449 (noxfrm ? DST_NOXFRM : 0));
1450
1451 if (rt) {
1452 rt->rt_genid = rt_genid_ipv4(dev_net(dev));
1453 rt->rt_flags = flags;
1454 rt->rt_type = type;
1455 rt->rt_is_input = 0;
1456 rt->rt_iif = 0;
1457 rt->rt_pmtu = 0;
1458 rt->rt_gateway = 0;
1459 rt->rt_uses_gateway = 0;
1460 rt->rt_table_id = 0;
1461 INIT_LIST_HEAD(&rt->rt_uncached);
1462
1463 rt->dst.output = ip_output;
1464 if (flags & RTCF_LOCAL)
1465 rt->dst.input = ip_local_deliver;
1466 }
1467
1468 return rt;
1447}
1448
1449/* called in rcu_read_lock() section */
1450static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
1451 u8 tos, struct net_device *dev, int our)
1452{
1453 struct rtable *rth;
1454 struct in_device *in_dev = __in_dev_get_rcu(dev);
1469}
1470
1471/* called in rcu_read_lock() section */
1472static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
1473 u8 tos, struct net_device *dev, int our)
1474{
1475 struct rtable *rth;
1476 struct in_device *in_dev = __in_dev_get_rcu(dev);
1477 unsigned int flags = RTCF_MULTICAST;
1455 u32 itag = 0;
1456 int err;
1457
1458 /* Primary sanity checks. */
1459
1460 if (!in_dev)
1461 return -EINVAL;
1462

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

1472 if (!ipv4_is_local_multicast(daddr))
1473 goto e_inval;
1474 } else {
1475 err = fib_validate_source(skb, saddr, 0, tos, 0, dev,
1476 in_dev, &itag);
1477 if (err < 0)
1478 goto e_err;
1479 }
1478 u32 itag = 0;
1479 int err;
1480
1481 /* Primary sanity checks. */
1482
1483 if (!in_dev)
1484 return -EINVAL;
1485

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

1495 if (!ipv4_is_local_multicast(daddr))
1496 goto e_inval;
1497 } else {
1498 err = fib_validate_source(skb, saddr, 0, tos, 0, dev,
1499 in_dev, &itag);
1500 if (err < 0)
1501 goto e_err;
1502 }
1480 rth = rt_dst_alloc(dev_net(dev)->loopback_dev,
1503 if (our)
1504 flags |= RTCF_LOCAL;
1505
1506 rth = rt_dst_alloc(dev_net(dev)->loopback_dev, flags, RTN_MULTICAST,
1481 IN_DEV_CONF_GET(in_dev, NOPOLICY), false, false);
1482 if (!rth)
1483 goto e_nobufs;
1484
1485#ifdef CONFIG_IP_ROUTE_CLASSID
1486 rth->dst.tclassid = itag;
1487#endif
1488 rth->dst.output = ip_rt_bug;
1507 IN_DEV_CONF_GET(in_dev, NOPOLICY), false, false);
1508 if (!rth)
1509 goto e_nobufs;
1510
1511#ifdef CONFIG_IP_ROUTE_CLASSID
1512 rth->dst.tclassid = itag;
1513#endif
1514 rth->dst.output = ip_rt_bug;
1489
1490 rth->rt_genid = rt_genid_ipv4(dev_net(dev));
1491 rth->rt_flags = RTCF_MULTICAST;
1492 rth->rt_type = RTN_MULTICAST;
1493 rth->rt_is_input= 1;
1515 rth->rt_is_input= 1;
1494 rth->rt_iif = 0;
1495 rth->rt_pmtu = 0;
1496 rth->rt_gateway = 0;
1497 rth->rt_uses_gateway = 0;
1498 INIT_LIST_HEAD(&rth->rt_uncached);
1499 if (our) {
1500 rth->dst.input= ip_local_deliver;
1501 rth->rt_flags |= RTCF_LOCAL;
1502 }
1503
1504#ifdef CONFIG_IP_MROUTE
1505 if (!ipv4_is_local_multicast(daddr) && IN_DEV_MFORWARD(in_dev))
1506 rth->dst.input = ip_mr_input;
1507#endif
1508 RT_CACHE_STAT_INC(in_slow_mc);
1509
1510 skb_dst_set(skb, &rth->dst);

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

1603 rth = rcu_dereference(FIB_RES_NH(*res).nh_rth_input);
1604
1605 if (rt_cache_valid(rth)) {
1606 skb_dst_set_noref(skb, &rth->dst);
1607 goto out;
1608 }
1609 }
1610
1516
1517#ifdef CONFIG_IP_MROUTE
1518 if (!ipv4_is_local_multicast(daddr) && IN_DEV_MFORWARD(in_dev))
1519 rth->dst.input = ip_mr_input;
1520#endif
1521 RT_CACHE_STAT_INC(in_slow_mc);
1522
1523 skb_dst_set(skb, &rth->dst);

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

1616 rth = rcu_dereference(FIB_RES_NH(*res).nh_rth_input);
1617
1618 if (rt_cache_valid(rth)) {
1619 skb_dst_set_noref(skb, &rth->dst);
1620 goto out;
1621 }
1622 }
1623
1611 rth = rt_dst_alloc(out_dev->dev,
1624 rth = rt_dst_alloc(out_dev->dev, 0, res->type,
1612 IN_DEV_CONF_GET(in_dev, NOPOLICY),
1613 IN_DEV_CONF_GET(out_dev, NOXFRM), do_cache);
1614 if (!rth) {
1615 err = -ENOBUFS;
1616 goto cleanup;
1617 }
1618
1625 IN_DEV_CONF_GET(in_dev, NOPOLICY),
1626 IN_DEV_CONF_GET(out_dev, NOXFRM), do_cache);
1627 if (!rth) {
1628 err = -ENOBUFS;
1629 goto cleanup;
1630 }
1631
1619 rth->rt_genid = rt_genid_ipv4(dev_net(rth->dst.dev));
1620 rth->rt_flags = 0;
1621 rth->rt_type = res->type;
1622 rth->rt_is_input = 1;
1632 rth->rt_is_input = 1;
1623 rth->rt_iif = 0;
1624 rth->rt_pmtu = 0;
1625 rth->rt_gateway = 0;
1626 rth->rt_uses_gateway = 0;
1627 INIT_LIST_HEAD(&rth->rt_uncached);
1633 if (res->table)
1634 rth->rt_table_id = res->table->tb_id;
1628 RT_CACHE_STAT_INC(in_slow_tot);
1629
1630 rth->dst.input = ip_forward;
1635 RT_CACHE_STAT_INC(in_slow_tot);
1636
1637 rth->dst.input = ip_forward;
1631 rth->dst.output = ip_output;
1632
1633 rt_set_nexthop(rth, daddr, res, fnhe, res->fi, res->type, itag);
1634 if (lwtunnel_output_redirect(rth->dst.lwtstate)) {
1635 rth->dst.lwtstate->orig_output = rth->dst.output;
1636 rth->dst.output = lwtunnel_output;
1637 }
1638 if (lwtunnel_input_redirect(rth->dst.lwtstate)) {
1639 rth->dst.lwtstate->orig_input = rth->dst.input;

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

1701 else
1702 fl4.flowi4_tun_key.tun_id = 0;
1703 skb_dst_drop(skb);
1704
1705 if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr))
1706 goto martian_source;
1707
1708 res.fi = NULL;
1638
1639 rt_set_nexthop(rth, daddr, res, fnhe, res->fi, res->type, itag);
1640 if (lwtunnel_output_redirect(rth->dst.lwtstate)) {
1641 rth->dst.lwtstate->orig_output = rth->dst.output;
1642 rth->dst.output = lwtunnel_output;
1643 }
1644 if (lwtunnel_input_redirect(rth->dst.lwtstate)) {
1645 rth->dst.lwtstate->orig_input = rth->dst.input;

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

1707 else
1708 fl4.flowi4_tun_key.tun_id = 0;
1709 skb_dst_drop(skb);
1710
1711 if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr))
1712 goto martian_source;
1713
1714 res.fi = NULL;
1715 res.table = NULL;
1709 if (ipv4_is_lbcast(daddr) || (saddr == 0 && daddr == 0))
1710 goto brd_input;
1711
1712 /* Accept zero addresses only to limited broadcast;
1713 * I even do not know to fix it or not. Waiting for complains :-)
1714 */
1715 if (ipv4_is_zeronet(saddr))
1716 goto martian_source;

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

1790 skb_dst_set_noref(skb, &rth->dst);
1791 err = 0;
1792 goto out;
1793 }
1794 do_cache = true;
1795 }
1796 }
1797
1716 if (ipv4_is_lbcast(daddr) || (saddr == 0 && daddr == 0))
1717 goto brd_input;
1718
1719 /* Accept zero addresses only to limited broadcast;
1720 * I even do not know to fix it or not. Waiting for complains :-)
1721 */
1722 if (ipv4_is_zeronet(saddr))
1723 goto martian_source;

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

1797 skb_dst_set_noref(skb, &rth->dst);
1798 err = 0;
1799 goto out;
1800 }
1801 do_cache = true;
1802 }
1803 }
1804
1798 rth = rt_dst_alloc(net->loopback_dev,
1805 rth = rt_dst_alloc(net->loopback_dev, flags | RTCF_LOCAL, res.type,
1799 IN_DEV_CONF_GET(in_dev, NOPOLICY), false, do_cache);
1800 if (!rth)
1801 goto e_nobufs;
1802
1806 IN_DEV_CONF_GET(in_dev, NOPOLICY), false, do_cache);
1807 if (!rth)
1808 goto e_nobufs;
1809
1803 rth->dst.input= ip_local_deliver;
1804 rth->dst.output= ip_rt_bug;
1805#ifdef CONFIG_IP_ROUTE_CLASSID
1806 rth->dst.tclassid = itag;
1807#endif
1810 rth->dst.output= ip_rt_bug;
1811#ifdef CONFIG_IP_ROUTE_CLASSID
1812 rth->dst.tclassid = itag;
1813#endif
1808
1809 rth->rt_genid = rt_genid_ipv4(net);
1810 rth->rt_flags = flags|RTCF_LOCAL;
1811 rth->rt_type = res.type;
1812 rth->rt_is_input = 1;
1814 rth->rt_is_input = 1;
1813 rth->rt_iif = 0;
1814 rth->rt_pmtu = 0;
1815 rth->rt_gateway = 0;
1816 rth->rt_uses_gateway = 0;
1817 INIT_LIST_HEAD(&rth->rt_uncached);
1815 if (res.table)
1816 rth->rt_table_id = res.table->tb_id;
1818
1819 RT_CACHE_STAT_INC(in_slow_tot);
1820 if (res.type == RTN_UNREACHABLE) {
1821 rth->dst.input= ip_error;
1822 rth->dst.error= -err;
1823 rth->rt_flags &= ~RTCF_LOCAL;
1824 }
1825 if (do_cache) {

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

1831 skb_dst_set(skb, &rth->dst);
1832 err = 0;
1833 goto out;
1834
1835no_route:
1836 RT_CACHE_STAT_INC(in_no_route);
1837 res.type = RTN_UNREACHABLE;
1838 res.fi = NULL;
1817
1818 RT_CACHE_STAT_INC(in_slow_tot);
1819 if (res.type == RTN_UNREACHABLE) {
1820 rth->dst.input= ip_error;
1821 rth->dst.error= -err;
1822 rth->rt_flags &= ~RTCF_LOCAL;
1823 }
1824 if (do_cache) {

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

1830 skb_dst_set(skb, &rth->dst);
1831 err = 0;
1832 goto out;
1833
1834no_route:
1835 RT_CACHE_STAT_INC(in_no_route);
1836 res.type = RTN_UNREACHABLE;
1837 res.fi = NULL;
1838 res.table = NULL;
1839 goto local_input;
1840
1841 /*
1842 * Do not cache martian addresses: they should be logged (RFC1812)
1843 */
1844martian_destination:
1845 RT_CACHE_STAT_INC(in_martian_dst);
1846#ifdef CONFIG_IP_ROUTE_VERBOSE

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

1982 rth = rcu_dereference(*prth);
1983 if (rt_cache_valid(rth)) {
1984 dst_hold(&rth->dst);
1985 return rth;
1986 }
1987 }
1988
1989add:
1839 goto local_input;
1840
1841 /*
1842 * Do not cache martian addresses: they should be logged (RFC1812)
1843 */
1844martian_destination:
1845 RT_CACHE_STAT_INC(in_martian_dst);
1846#ifdef CONFIG_IP_ROUTE_VERBOSE

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

1982 rth = rcu_dereference(*prth);
1983 if (rt_cache_valid(rth)) {
1984 dst_hold(&rth->dst);
1985 return rth;
1986 }
1987 }
1988
1989add:
1990 rth = rt_dst_alloc(dev_out,
1990 rth = rt_dst_alloc(dev_out, flags, type,
1991 IN_DEV_CONF_GET(in_dev, NOPOLICY),
1992 IN_DEV_CONF_GET(in_dev, NOXFRM),
1993 do_cache);
1994 if (!rth)
1995 return ERR_PTR(-ENOBUFS);
1996
1991 IN_DEV_CONF_GET(in_dev, NOPOLICY),
1992 IN_DEV_CONF_GET(in_dev, NOXFRM),
1993 do_cache);
1994 if (!rth)
1995 return ERR_PTR(-ENOBUFS);
1996
1997 rth->dst.output = ip_output;
1998
1999 rth->rt_genid = rt_genid_ipv4(dev_net(dev_out));
2000 rth->rt_flags = flags;
2001 rth->rt_type = type;
2002 rth->rt_is_input = 0;
2003 rth->rt_iif = orig_oif ? : 0;
1997 rth->rt_iif = orig_oif ? : 0;
2004 rth->rt_pmtu = 0;
2005 rth->rt_gateway = 0;
2006 rth->rt_uses_gateway = 0;
2007 INIT_LIST_HEAD(&rth->rt_uncached);
1998 if (res->table)
1999 rth->rt_table_id = res->table->tb_id;
2000
2008 RT_CACHE_STAT_INC(out_slow_tot);
2009
2001 RT_CACHE_STAT_INC(out_slow_tot);
2002
2010 if (flags & RTCF_LOCAL)
2011 rth->dst.input = ip_local_deliver;
2012 if (flags & (RTCF_BROADCAST | RTCF_MULTICAST)) {
2013 if (flags & RTCF_LOCAL &&
2014 !(dev_out->flags & IFF_LOOPBACK)) {
2015 rth->dst.output = ip_mc_output;
2016 RT_CACHE_STAT_INC(out_slow_mc);
2017 }
2018#ifdef CONFIG_IP_MROUTE
2019 if (type == RTN_MULTICAST) {

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

2295 }
2296
2297 dst_release(dst_orig);
2298
2299 return rt ? &rt->dst : ERR_PTR(-ENOMEM);
2300}
2301
2302struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
2003 if (flags & (RTCF_BROADCAST | RTCF_MULTICAST)) {
2004 if (flags & RTCF_LOCAL &&
2005 !(dev_out->flags & IFF_LOOPBACK)) {
2006 rth->dst.output = ip_mc_output;
2007 RT_CACHE_STAT_INC(out_slow_mc);
2008 }
2009#ifdef CONFIG_IP_MROUTE
2010 if (type == RTN_MULTICAST) {

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

2286 }
2287
2288 dst_release(dst_orig);
2289
2290 return rt ? &rt->dst : ERR_PTR(-ENOMEM);
2291}
2292
2293struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
2303 struct sock *sk)
2294 const struct sock *sk)
2304{
2305 struct rtable *rt = __ip_route_output_key(net, flp4);
2306
2307 if (IS_ERR(rt))
2308 return rt;
2309
2310 if (flp4->flowi4_proto)
2311 rt = (struct rtable *)xfrm_lookup_route(net, &rt->dst,
2312 flowi4_to_flowi(flp4),
2313 sk, 0);
2314
2315 return rt;
2316}
2317EXPORT_SYMBOL_GPL(ip_route_output_flow);
2318
2295{
2296 struct rtable *rt = __ip_route_output_key(net, flp4);
2297
2298 if (IS_ERR(rt))
2299 return rt;
2300
2301 if (flp4->flowi4_proto)
2302 rt = (struct rtable *)xfrm_lookup_route(net, &rt->dst,
2303 flowi4_to_flowi(flp4),
2304 sk, 0);
2305
2306 return rt;
2307}
2308EXPORT_SYMBOL_GPL(ip_route_output_flow);
2309
2319static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
2310static int rt_fill_info(struct net *net, __be32 dst, __be32 src, u32 table_id,
2320 struct flowi4 *fl4, struct sk_buff *skb, u32 portid,
2321 u32 seq, int event, int nowait, unsigned int flags)
2322{
2323 struct rtable *rt = skb_rtable(skb);
2324 struct rtmsg *r;
2325 struct nlmsghdr *nlh;
2326 unsigned long expires = 0;
2327 u32 error;
2328 u32 metrics[RTAX_MAX];
2329
2330 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*r), flags);
2331 if (!nlh)
2332 return -EMSGSIZE;
2333
2334 r = nlmsg_data(nlh);
2335 r->rtm_family = AF_INET;
2336 r->rtm_dst_len = 32;
2337 r->rtm_src_len = 0;
2338 r->rtm_tos = fl4->flowi4_tos;
2311 struct flowi4 *fl4, struct sk_buff *skb, u32 portid,
2312 u32 seq, int event, int nowait, unsigned int flags)
2313{
2314 struct rtable *rt = skb_rtable(skb);
2315 struct rtmsg *r;
2316 struct nlmsghdr *nlh;
2317 unsigned long expires = 0;
2318 u32 error;
2319 u32 metrics[RTAX_MAX];
2320
2321 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*r), flags);
2322 if (!nlh)
2323 return -EMSGSIZE;
2324
2325 r = nlmsg_data(nlh);
2326 r->rtm_family = AF_INET;
2327 r->rtm_dst_len = 32;
2328 r->rtm_src_len = 0;
2329 r->rtm_tos = fl4->flowi4_tos;
2339 r->rtm_table = RT_TABLE_MAIN;
2340 if (nla_put_u32(skb, RTA_TABLE, RT_TABLE_MAIN))
2330 r->rtm_table = table_id;
2331 if (nla_put_u32(skb, RTA_TABLE, table_id))
2341 goto nla_put_failure;
2342 r->rtm_type = rt->rt_type;
2343 r->rtm_scope = RT_SCOPE_UNIVERSE;
2344 r->rtm_protocol = RTPROT_UNSPEC;
2345 r->rtm_flags = (rt->rt_flags & ~0xFFFF) | RTM_F_CLONED;
2346 if (rt->rt_flags & RTCF_NOTIFY)
2347 r->rtm_flags |= RTM_F_NOTIFY;
2348 if (IPCB(skb)->flags & IPSKB_DOREDIRECT)

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

2437 struct rtable *rt = NULL;
2438 struct flowi4 fl4;
2439 __be32 dst = 0;
2440 __be32 src = 0;
2441 u32 iif;
2442 int err;
2443 int mark;
2444 struct sk_buff *skb;
2332 goto nla_put_failure;
2333 r->rtm_type = rt->rt_type;
2334 r->rtm_scope = RT_SCOPE_UNIVERSE;
2335 r->rtm_protocol = RTPROT_UNSPEC;
2336 r->rtm_flags = (rt->rt_flags & ~0xFFFF) | RTM_F_CLONED;
2337 if (rt->rt_flags & RTCF_NOTIFY)
2338 r->rtm_flags |= RTM_F_NOTIFY;
2339 if (IPCB(skb)->flags & IPSKB_DOREDIRECT)

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

2428 struct rtable *rt = NULL;
2429 struct flowi4 fl4;
2430 __be32 dst = 0;
2431 __be32 src = 0;
2432 u32 iif;
2433 int err;
2434 int mark;
2435 struct sk_buff *skb;
2436 u32 table_id = RT_TABLE_MAIN;
2445
2446 err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv4_policy);
2447 if (err < 0)
2448 goto errout;
2449
2450 rtm = nlmsg_data(nlh);
2451
2452 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);

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

2506
2507 if (err)
2508 goto errout_free;
2509
2510 skb_dst_set(skb, &rt->dst);
2511 if (rtm->rtm_flags & RTM_F_NOTIFY)
2512 rt->rt_flags |= RTCF_NOTIFY;
2513
2437
2438 err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv4_policy);
2439 if (err < 0)
2440 goto errout;
2441
2442 rtm = nlmsg_data(nlh);
2443
2444 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);

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

2498
2499 if (err)
2500 goto errout_free;
2501
2502 skb_dst_set(skb, &rt->dst);
2503 if (rtm->rtm_flags & RTM_F_NOTIFY)
2504 rt->rt_flags |= RTCF_NOTIFY;
2505
2514 err = rt_fill_info(net, dst, src, &fl4, skb,
2506 if (rtm->rtm_flags & RTM_F_LOOKUP_TABLE)
2507 table_id = rt->rt_table_id;
2508
2509 err = rt_fill_info(net, dst, src, table_id, &fl4, skb,
2515 NETLINK_CB(in_skb).portid, nlh->nlmsg_seq,
2516 RTM_NEWROUTE, 0, 0);
2517 if (err < 0)
2518 goto errout_free;
2519
2520 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
2521errout:
2522 return err;

--- 310 unchanged lines hidden ---
2510 NETLINK_CB(in_skb).portid, nlh->nlmsg_seq,
2511 RTM_NEWROUTE, 0, 0);
2512 if (err < 0)
2513 goto errout_free;
2514
2515 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid);
2516errout:
2517 return err;

--- 310 unchanged lines hidden ---