rtnetlink.c (9938b04472d5c59f8bd8152a548533a8599596a2) rtnetlink.c (550bce59baf3f3059cd4ae1e268f08f2d2cb1d5c)
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>

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

803 a->tx_window_errors = b->tx_window_errors;
804
805 a->rx_compressed = b->rx_compressed;
806 a->tx_compressed = b->tx_compressed;
807
808 a->rx_nohandler = b->rx_nohandler;
809}
810
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>

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

803 a->tx_window_errors = b->tx_window_errors;
804
805 a->rx_compressed = b->rx_compressed;
806 a->tx_compressed = b->tx_compressed;
807
808 a->rx_nohandler = b->rx_nohandler;
809}
810
811static void copy_rtnl_link_stats64(void *v, const struct rtnl_link_stats64 *b)
812{
813 memcpy(v, b, sizeof(*b));
814}
815
816/* All VF info */
817static inline int rtnl_vfinfo_size(const struct net_device *dev,
818 u32 ext_filter_mask)
819{
820 if (dev->dev.parent && dev_is_pci(dev->dev.parent) &&
821 (ext_filter_mask & RTEXT_FILTER_VF)) {
822 int num_vfs = dev_num_vf(dev->dev.parent);
823 size_t size = nla_total_size(sizeof(struct nlattr));

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

1049 return -EMSGSIZE;
1050
1051 return 0;
1052}
1053
1054static noinline_for_stack int rtnl_fill_stats(struct sk_buff *skb,
1055 struct net_device *dev)
1056{
811/* All VF info */
812static inline int rtnl_vfinfo_size(const struct net_device *dev,
813 u32 ext_filter_mask)
814{
815 if (dev->dev.parent && dev_is_pci(dev->dev.parent) &&
816 (ext_filter_mask & RTEXT_FILTER_VF)) {
817 int num_vfs = dev_num_vf(dev->dev.parent);
818 size_t size = nla_total_size(sizeof(struct nlattr));

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

1044 return -EMSGSIZE;
1045
1046 return 0;
1047}
1048
1049static noinline_for_stack int rtnl_fill_stats(struct sk_buff *skb,
1050 struct net_device *dev)
1051{
1057 const struct rtnl_link_stats64 *stats;
1058 struct rtnl_link_stats64 temp;
1052 struct rtnl_link_stats64 *sp;
1059 struct nlattr *attr;
1060
1053 struct nlattr *attr;
1054
1061 stats = dev_get_stats(dev, &temp);
1062
1063 attr = nla_reserve(skb, IFLA_STATS,
1064 sizeof(struct rtnl_link_stats));
1055 attr = nla_reserve(skb, IFLA_STATS64,
1056 sizeof(struct rtnl_link_stats64));
1065 if (!attr)
1066 return -EMSGSIZE;
1067
1057 if (!attr)
1058 return -EMSGSIZE;
1059
1068 copy_rtnl_link_stats(nla_data(attr), stats);
1060 sp = nla_data(attr);
1061 dev_get_stats(dev, sp);
1069
1062
1070 attr = nla_reserve(skb, IFLA_STATS64,
1071 sizeof(struct rtnl_link_stats64));
1063 attr = nla_reserve(skb, IFLA_STATS,
1064 sizeof(struct rtnl_link_stats));
1072 if (!attr)
1073 return -EMSGSIZE;
1074
1065 if (!attr)
1066 return -EMSGSIZE;
1067
1075 copy_rtnl_link_stats64(nla_data(attr), stats);
1068 copy_rtnl_link_stats(nla_data(attr), sp);
1076
1077 return 0;
1078}
1079
1080static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
1081 struct net_device *dev,
1082 int vfs_num,
1083 struct nlattr *vfinfo)

--- 2520 unchanged lines hidden ---
1069
1070 return 0;
1071}
1072
1073static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
1074 struct net_device *dev,
1075 int vfs_num,
1076 struct nlattr *vfinfo)

--- 2520 unchanged lines hidden ---