rtnetlink.c (e7157f28ced492accf6e665ba0f748162757779f) | rtnetlink.c (270cb4d05b2923a4a4d712276e61f64c82567138) |
---|---|
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> --- 862 unchanged lines hidden (view full) --- 871 872static noinline size_t if_nlmsg_size(const struct net_device *dev, 873 u32 ext_filter_mask) 874{ 875 return NLMSG_ALIGN(sizeof(struct ifinfomsg)) 876 + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */ 877 + nla_total_size(IFALIASZ) /* IFLA_IFALIAS */ 878 + nla_total_size(IFNAMSIZ) /* IFLA_QDISC */ | 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> --- 862 unchanged lines hidden (view full) --- 871 872static noinline size_t if_nlmsg_size(const struct net_device *dev, 873 u32 ext_filter_mask) 874{ 875 return NLMSG_ALIGN(sizeof(struct ifinfomsg)) 876 + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */ 877 + nla_total_size(IFALIASZ) /* IFLA_IFALIAS */ 878 + nla_total_size(IFNAMSIZ) /* IFLA_QDISC */ |
879 + nla_total_size(sizeof(struct rtnl_link_ifmap)) | 879 + nla_total_size_64bit(sizeof(struct rtnl_link_ifmap)) |
880 + nla_total_size(sizeof(struct rtnl_link_stats)) 881 + nla_total_size_64bit(sizeof(struct rtnl_link_stats64)) 882 + nla_total_size(MAX_ADDR_LEN) /* IFLA_ADDRESS */ 883 + nla_total_size(MAX_ADDR_LEN) /* IFLA_BROADCAST */ 884 + nla_total_size(4) /* IFLA_TXQLEN */ 885 + nla_total_size(4) /* IFLA_WEIGHT */ 886 + nla_total_size(4) /* IFLA_MTU */ 887 + nla_total_size(4) /* IFLA_LINK */ --- 288 unchanged lines hidden (view full) --- 1176 struct rtnl_link_ifmap map = { 1177 .mem_start = dev->mem_start, 1178 .mem_end = dev->mem_end, 1179 .base_addr = dev->base_addr, 1180 .irq = dev->irq, 1181 .dma = dev->dma, 1182 .port = dev->if_port, 1183 }; | 880 + nla_total_size(sizeof(struct rtnl_link_stats)) 881 + nla_total_size_64bit(sizeof(struct rtnl_link_stats64)) 882 + nla_total_size(MAX_ADDR_LEN) /* IFLA_ADDRESS */ 883 + nla_total_size(MAX_ADDR_LEN) /* IFLA_BROADCAST */ 884 + nla_total_size(4) /* IFLA_TXQLEN */ 885 + nla_total_size(4) /* IFLA_WEIGHT */ 886 + nla_total_size(4) /* IFLA_MTU */ 887 + nla_total_size(4) /* IFLA_LINK */ --- 288 unchanged lines hidden (view full) --- 1176 struct rtnl_link_ifmap map = { 1177 .mem_start = dev->mem_start, 1178 .mem_end = dev->mem_end, 1179 .base_addr = dev->base_addr, 1180 .irq = dev->irq, 1181 .dma = dev->dma, 1182 .port = dev->if_port, 1183 }; |
1184 if (nla_put(skb, IFLA_MAP, sizeof(map), &map)) | 1184 if (nla_put_64bit(skb, IFLA_MAP, sizeof(map), &map, IFLA_PAD)) |
1185 return -EMSGSIZE; 1186 1187 return 0; 1188} 1189 1190static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, 1191 int type, u32 pid, u32 seq, u32 change, 1192 unsigned int flags, u32 ext_filter_mask) --- 2555 unchanged lines hidden --- | 1185 return -EMSGSIZE; 1186 1187 return 0; 1188} 1189 1190static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, 1191 int type, u32 pid, u32 seq, u32 change, 1192 unsigned int flags, u32 ext_filter_mask) --- 2555 unchanged lines hidden --- |