rtnetlink.c (601d62959d08a450d4666c728ddd2f47c5ba1cfe) rtnetlink.c (0cbf334376d5e82d7a2f5cd234ca4f5d0843f3ea)
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 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

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

91
92int rtnl_is_locked(void)
93{
94 return mutex_is_locked(&rtnl_mutex);
95}
96EXPORT_SYMBOL(rtnl_is_locked);
97
98#ifdef CONFIG_PROVE_LOCKING
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 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

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

91
92int rtnl_is_locked(void)
93{
94 return mutex_is_locked(&rtnl_mutex);
95}
96EXPORT_SYMBOL(rtnl_is_locked);
97
98#ifdef CONFIG_PROVE_LOCKING
99int lockdep_rtnl_is_held(void)
99bool lockdep_rtnl_is_held(void)
100{
101 return lockdep_is_held(&rtnl_mutex);
102}
103EXPORT_SYMBOL(lockdep_rtnl_is_held);
104#endif /* #ifdef CONFIG_PROVE_LOCKING */
105
106static struct rtnl_link *rtnl_msg_handlers[RTNL_FAMILY_MAX + 1];
107

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

1020
1021 return 0;
1022}
1023
1024static int rtnl_phys_switch_id_fill(struct sk_buff *skb, struct net_device *dev)
1025{
1026 int err;
1027 struct switchdev_attr attr = {
100{
101 return lockdep_is_held(&rtnl_mutex);
102}
103EXPORT_SYMBOL(lockdep_rtnl_is_held);
104#endif /* #ifdef CONFIG_PROVE_LOCKING */
105
106static struct rtnl_link *rtnl_msg_handlers[RTNL_FAMILY_MAX + 1];
107

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

1020
1021 return 0;
1022}
1023
1024static int rtnl_phys_switch_id_fill(struct sk_buff *skb, struct net_device *dev)
1025{
1026 int err;
1027 struct switchdev_attr attr = {
1028 .id = SWITCHDEV_ATTR_PORT_PARENT_ID,
1028 .id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
1029 .flags = SWITCHDEV_F_NO_RECURSE,
1030 };
1031
1032 err = switchdev_port_attr_get(dev, &attr);
1033 if (err) {
1034 if (err == -EOPNOTSUPP)
1035 return 0;
1036 return err;

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

1267 list_for_each_entry(af_ops, &rtnl_af_ops, list) {
1268 if (af_ops->fill_link_af) {
1269 struct nlattr *af;
1270 int err;
1271
1272 if (!(af = nla_nest_start(skb, af_ops->family)))
1273 goto nla_put_failure;
1274
1029 .flags = SWITCHDEV_F_NO_RECURSE,
1030 };
1031
1032 err = switchdev_port_attr_get(dev, &attr);
1033 if (err) {
1034 if (err == -EOPNOTSUPP)
1035 return 0;
1036 return err;

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

1267 list_for_each_entry(af_ops, &rtnl_af_ops, list) {
1268 if (af_ops->fill_link_af) {
1269 struct nlattr *af;
1270 int err;
1271
1272 if (!(af = nla_nest_start(skb, af_ops->family)))
1273 goto nla_put_failure;
1274
1275 err = af_ops->fill_link_af(skb, dev);
1275 err = af_ops->fill_link_af(skb, dev, ext_filter_mask);
1276
1277 /*
1278 * Caller may return ENODATA to indicate that there
1279 * was no data to be dumped. This is not an error, it
1280 * means we should trim the attribute header and
1281 * continue.
1282 */
1283 if (err == -ENODATA)

--- 2163 unchanged lines hidden ---
1276
1277 /*
1278 * Caller may return ENODATA to indicate that there
1279 * was no data to be dumped. This is not an error, it
1280 * means we should trim the attribute header and
1281 * continue.
1282 */
1283 if (err == -ENODATA)

--- 2163 unchanged lines hidden ---