diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2015-08-27 19:07:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-28 16:32:36 -0400 |
commit | d39d14ffa24cca9f0e44aa4a63315f4c44c56a93 (patch) | |
tree | d19cc95a22ad69e2164b9b46609ce67c577af77f /net/ipv4/tcp_metrics.c | |
parent | 3abef286cf2f138de353fb0b54453621de961043 (diff) |
net: Add helper function to compare inetpeer addresses
tcp_metrics and inetpeer both have functions to compare inetpeer
addresses. Consolidate into 1 version.
Signed-off-by: David Ahern <dsa@cumulusnetworks.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 | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 4ef4dd4bf38c..c8cbc2b4b792 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c | |||
@@ -81,11 +81,7 @@ static void tcp_metric_set(struct tcp_metrics_block *tm, | |||
81 | static bool addr_same(const struct inetpeer_addr *a, | 81 | static bool addr_same(const struct inetpeer_addr *a, |
82 | const struct inetpeer_addr *b) | 82 | const struct inetpeer_addr *b) |
83 | { | 83 | { |
84 | if (a->family != b->family) | 84 | return inetpeer_addr_cmp(a, b) == 0; |
85 | return false; | ||
86 | if (a->family == AF_INET) | ||
87 | return a->addr.a4 == b->addr.a4; | ||
88 | return ipv6_addr_equal(&a->addr.in6, &b->addr.in6); | ||
89 | } | 85 | } |
90 | 86 | ||
91 | struct tcpm_hash_bucket { | 87 | struct tcpm_hash_bucket { |