rtnetlink.c (ab4724302feedcd33633fd409667a8ee0016f13d) rtnetlink.c (f534f6581ec084fe94d6759f7672bd009794b07e)
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 * Routing netlink socket interface: protocol independent part.
8 *

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

2263 cb->seq = tgt_net->dev_base_seq;
2264 nl_dump_check_consistent(cb, nlmsg_hdr(skb));
2265 if (netnsid >= 0)
2266 put_net(tgt_net);
2267
2268 return err;
2269}
2270
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 * Routing netlink socket interface: protocol independent part.
8 *

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

2263 cb->seq = tgt_net->dev_base_seq;
2264 nl_dump_check_consistent(cb, nlmsg_hdr(skb));
2265 if (netnsid >= 0)
2266 put_net(tgt_net);
2267
2268 return err;
2269}
2270
2271int rtnl_nla_parse_ifla(struct nlattr **tb, const struct nlattr *head, int len,
2272 struct netlink_ext_ack *exterr)
2271int rtnl_nla_parse_ifinfomsg(struct nlattr **tb, const struct nlattr *nla_peer,
2272 struct netlink_ext_ack *exterr)
2273{
2273{
2274 return nla_parse_deprecated(tb, IFLA_MAX, head, len, ifla_policy,
2274 const struct ifinfomsg *ifmp;
2275 const struct nlattr *attrs;
2276 size_t len;
2277
2278 ifmp = nla_data(nla_peer);
2279 attrs = nla_data(nla_peer) + sizeof(struct ifinfomsg);
2280 len = nla_len(nla_peer) - sizeof(struct ifinfomsg);
2281
2282 if (ifmp->ifi_index < 0) {
2283 NL_SET_ERR_MSG_ATTR(exterr, nla_peer,
2284 "ifindex can't be negative");
2285 return -EINVAL;
2286 }
2287
2288 return nla_parse_deprecated(tb, IFLA_MAX, attrs, len, ifla_policy,
2275 exterr);
2276}
2289 exterr);
2290}
2277EXPORT_SYMBOL(rtnl_nla_parse_ifla);
2291EXPORT_SYMBOL(rtnl_nla_parse_ifinfomsg);
2278
2279struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[])
2280{
2281 struct net *net;
2282 /* Examine the link attributes and figure out which
2283 * network namespace we are talking about.
2284 */
2285 if (tb[IFLA_NET_NS_PID])

--- 4273 unchanged lines hidden ---
2292
2293struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[])
2294{
2295 struct net *net;
2296 /* Examine the link attributes and figure out which
2297 * network namespace we are talking about.
2298 */
2299 if (tb[IFLA_NET_NS_PID])

--- 4273 unchanged lines hidden ---