diff options
author | Anna Schumaker <Anna.Schumaker@netapp.com> | 2015-07-13 14:01:27 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-08-17 14:29:43 -0400 |
commit | 58cc8a55aa38655d472a4c381df465c9ab97b4d6 (patch) | |
tree | dfb0ab4a756718b99e40eeee02e3b093afaeed47 | |
parent | 7b0ce60c0b203a2a037f308e387152acbf99c445 (diff) |
SUNRPC: Add an rpc_cmp_addr_port() function
This function is to help determine if two sockaddrs are really the same
socket.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | include/linux/sunrpc/addr.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sunrpc/addr.h b/include/linux/sunrpc/addr.h index 772faefc15aa..9bc3538d09a9 100644 --- a/include/linux/sunrpc/addr.h +++ b/include/linux/sunrpc/addr.h | |||
@@ -131,6 +131,19 @@ static inline bool rpc_cmp_addr(const struct sockaddr *sap1, | |||
131 | } | 131 | } |
132 | 132 | ||
133 | /** | 133 | /** |
134 | * rpc_cmp_addr_port - compare the address and port number of two sockaddrs. | ||
135 | * @sap1: first sockaddr | ||
136 | * @sap2: second sockaddr | ||
137 | */ | ||
138 | static inline bool rpc_cmp_addr_port(const struct sockaddr *sap1, | ||
139 | const struct sockaddr *sap2) | ||
140 | { | ||
141 | if (!rpc_cmp_addr(sap1, sap2)) | ||
142 | return false; | ||
143 | return rpc_get_port(sap1) == rpc_get_port(sap2); | ||
144 | } | ||
145 | |||
146 | /** | ||
134 | * rpc_copy_addr - copy the address portion of one sockaddr to another | 147 | * rpc_copy_addr - copy the address portion of one sockaddr to another |
135 | * @dst: destination sockaddr | 148 | * @dst: destination sockaddr |
136 | * @src: source sockaddr | 149 | * @src: source sockaddr |