aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/internal.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 5d2a5d3c4241..d212ee41caf2 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -285,16 +285,15 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len)
285 */ 285 */
286static inline void nfs_set_port(struct sockaddr *sap, unsigned short port) 286static inline void nfs_set_port(struct sockaddr *sap, unsigned short port)
287{ 287{
288 struct sockaddr_in *ap = (struct sockaddr_in *)sap;
289 struct sockaddr_in6 *ap6 = (struct sockaddr_in6 *)sap;
290
288 switch (sap->sa_family) { 291 switch (sap->sa_family) {
289 case AF_INET: { 292 case AF_INET:
290 struct sockaddr_in *ap = (struct sockaddr_in *)sap; 293 ap->sin_port = htons(port);
291 ap->sin_port = htons(port); 294 break;
292 break; 295 case AF_INET6:
293 } 296 ap6->sin6_port = htons(port);
294 case AF_INET6: { 297 break;
295 struct sockaddr_in6 *ap = (struct sockaddr_in6 *)sap;
296 ap->sin6_port = htons(port);
297 break;
298 }
299 } 298 }
300} 299}