hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/net/decnet/dn_route.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * DECnet An implementation of the DECnet protocol suite for the LINUX
34 * operating system. DECnet is implemented using the BSD Socket
....@@ -44,15 +45,6 @@
4445 /******************************************************************************
4546 (c) 1995-1998 E.M. Serrat emserrat@geocities.com
4647
47
- This program is free software; you can redistribute it and/or modify
48
- it under the terms of the GNU General Public License as published by
49
- the Free Software Foundation; either version 2 of the License, or
50
- any later version.
51
-
52
- This program is distributed in the hope that it will be useful,
53
- but WITHOUT ANY WARRANTY; without even the implied warranty of
54
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55
- GNU General Public License for more details.
5648 *******************************************************************************/
5749
5850 #include <linux/errno.h>
....@@ -502,6 +494,8 @@
502494
503495 /**
504496 * dn_route_rx_packet - Try and find a route for an incoming packet
497
+ * @net: The applicable net namespace
498
+ * @sk: Socket packet transmitted on
505499 * @skb: The packet to find a route for
506500 *
507501 * Returns: result of input function if route is found, error code otherwise
....@@ -678,7 +672,7 @@
678672 if (decnet_debug_level & 1)
679673 printk(KERN_DEBUG
680674 "dn_route_rcv: got 0x%02x from %s [%d %d %d]\n",
681
- (int)flags, (dev) ? dev->name : "???", len, skb->len,
675
+ (int)flags, dev->name, len, skb->len,
682676 padlen);
683677
684678 if (flags & DN_RT_PKT_CNTL) {
....@@ -1181,7 +1175,7 @@
11811175 if (dev_out->flags & IFF_LOOPBACK)
11821176 flags |= RTCF_LOCAL;
11831177
1184
- rt = dst_alloc(&dn_dst_ops, dev_out, 0, DST_OBSOLETE_NONE, DST_HOST);
1178
+ rt = dst_alloc(&dn_dst_ops, dev_out, 0, DST_OBSOLETE_NONE, 0);
11851179 if (rt == NULL)
11861180 goto e_nobufs;
11871181
....@@ -1447,7 +1441,7 @@
14471441 }
14481442
14491443 make_route:
1450
- rt = dst_alloc(&dn_dst_ops, out_dev, 1, DST_OBSOLETE_NONE, DST_HOST);
1444
+ rt = dst_alloc(&dn_dst_ops, out_dev, 1, DST_OBSOLETE_NONE, 0);
14511445 if (rt == NULL)
14521446 goto e_nobufs;
14531447
....@@ -1653,8 +1647,8 @@
16531647 if (!net_eq(net, &init_net))
16541648 return -EINVAL;
16551649
1656
- err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_dn_policy,
1657
- extack);
1650
+ err = nlmsg_parse_deprecated(nlh, sizeof(*rtm), tb, RTA_MAX,
1651
+ rtm_dn_policy, extack);
16581652 if (err < 0)
16591653 return err;
16601654
....@@ -1868,7 +1862,7 @@
18681862 dn_route_timer.expires = jiffies + decnet_dst_gc_interval * HZ;
18691863 add_timer(&dn_route_timer);
18701864
1871
- goal = totalram_pages >> (26 - PAGE_SHIFT);
1865
+ goal = totalram_pages() >> (26 - PAGE_SHIFT);
18721866
18731867 for(order = 0; (1UL << order) < goal; order++)
18741868 /* NOTHING */;