diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-08-09 15:09:32 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-09 15:09:32 -0400 |
commit | 169026a61e6f436dfc12c9d10d95455c4e9f945b (patch) | |
tree | 086ec191697cc7f50c054d3a589028aaa2f1bdbf /include/linux | |
parent | ec88f28d1eb77346f19ca324ceec76e645cdd9da (diff) |
SUNRPC: Clean up RPCBIND_MAXUADDRLEN definitions
Clean up: Replace the single-integer definition of RPCBIND_MAXUADDRLEN
with a definition that is based on previously defined address string
sizes, and document the way this maximum is calculated. Also provide
a separate macro for the size of the port number extension.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sunrpc/msg_prot.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 70df4f1d8847..77e624883393 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -189,7 +189,22 @@ typedef __be32 rpc_fraghdr; | |||
189 | * Additionally, the two alternative forms specified in Section 2.2 of | 189 | * Additionally, the two alternative forms specified in Section 2.2 of |
190 | * [RFC2373] are also acceptable. | 190 | * [RFC2373] are also acceptable. |
191 | */ | 191 | */ |
192 | #define RPCBIND_MAXUADDRLEN (56u) | 192 | |
193 | #include <linux/inet.h> | ||
194 | |||
195 | /* Maximum size of the port number part of a universal address */ | ||
196 | #define RPCBIND_MAXUADDRPLEN sizeof(".255.255") | ||
197 | |||
198 | /* Maximum size of an IPv4 universal address */ | ||
199 | #define RPCBIND_MAXUADDR4LEN \ | ||
200 | (INET_ADDRSTRLEN + RPCBIND_MAXUADDRPLEN) | ||
201 | |||
202 | /* Maximum size of an IPv6 universal address */ | ||
203 | #define RPCBIND_MAXUADDR6LEN \ | ||
204 | (INET6_ADDRSTRLEN + RPCBIND_MAXUADDRPLEN) | ||
205 | |||
206 | /* Assume INET6_ADDRSTRLEN will always be larger than INET_ADDRSTRLEN... */ | ||
207 | #define RPCBIND_MAXUADDRLEN RPCBIND_MAXUADDR6LEN | ||
193 | 208 | ||
194 | #endif /* __KERNEL__ */ | 209 | #endif /* __KERNEL__ */ |
195 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ | 210 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ |