diff options
author | Jiri Benc <jbenc@redhat.com> | 2015-03-29 10:59:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-31 13:58:35 -0400 |
commit | 67b61f6c130a05b2cd4c3dfded49a751ff42c534 (patch) | |
tree | 2a4deef870f2c01f36a27cfb7501e726d833880c /net/ipv4/tcp_metrics.c | |
parent | 930345ea630405aa6e6f42efcb149c3f360a6b67 (diff) |
netlink: implement nla_get_in_addr and nla_get_in6_addr
Those are counterparts to nla_put_in_addr and nla_put_in6_addr.
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_metrics.c')
-rw-r--r-- | net/ipv4/tcp_metrics.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 32e36ea6bc0f..71ec14c87579 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c | |||
@@ -948,7 +948,7 @@ static int __parse_nl_addr(struct genl_info *info, struct inetpeer_addr *addr, | |||
948 | a = info->attrs[v4]; | 948 | a = info->attrs[v4]; |
949 | if (a) { | 949 | if (a) { |
950 | addr->family = AF_INET; | 950 | addr->family = AF_INET; |
951 | addr->addr.a4 = nla_get_be32(a); | 951 | addr->addr.a4 = nla_get_in_addr(a); |
952 | if (hash) | 952 | if (hash) |
953 | *hash = (__force unsigned int) addr->addr.a4; | 953 | *hash = (__force unsigned int) addr->addr.a4; |
954 | return 0; | 954 | return 0; |
@@ -958,7 +958,7 @@ static int __parse_nl_addr(struct genl_info *info, struct inetpeer_addr *addr, | |||
958 | if (nla_len(a) != sizeof(struct in6_addr)) | 958 | if (nla_len(a) != sizeof(struct in6_addr)) |
959 | return -EINVAL; | 959 | return -EINVAL; |
960 | addr->family = AF_INET6; | 960 | addr->family = AF_INET6; |
961 | memcpy(addr->addr.a6, nla_data(a), sizeof(addr->addr.a6)); | 961 | addr->addr.in6 = nla_get_in6_addr(a); |
962 | if (hash) | 962 | if (hash) |
963 | *hash = ipv6_addr_hash(&addr->addr.in6); | 963 | *hash = ipv6_addr_hash(&addr->addr.in6); |
964 | return 0; | 964 | return 0; |