aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastryyy@gmail.com>2010-12-13 11:08:35 -0500
committerSteve French <sfrench@us.ibm.com>2011-01-06 14:07:53 -0500
commita9f1b85e5ba80519dea6974e3574fa7a30cc5e29 (patch)
tree255a962ea1d02110c5b31ebb981ce1f588960688 /fs/cifs/cifsfs.c
parentdf8fbc241aa3c451248b1f19fff3a3f604b107f9 (diff)
CIFS: Simplify ipv*_connect functions into one (try #4)
Make connect logic more ip-protocol independent and move RFC1001 stuff into a separate function. Also replace union addr in TCP_Server_Info structure with sockaddr_storage. Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Reviewed-and-Tested-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 3936aa7f2c22..9df5c0b94d0f 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -351,18 +351,19 @@ cifs_evict_inode(struct inode *inode)
351static void 351static void
352cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server) 352cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server)
353{ 353{
354 struct sockaddr_in *sa = (struct sockaddr_in *) &server->dstaddr;
355 struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &server->dstaddr;
356
354 seq_printf(s, ",addr="); 357 seq_printf(s, ",addr=");
355 358
356 switch (server->addr.sockAddr.sin_family) { 359 switch (server->dstaddr.ss_family) {
357 case AF_INET: 360 case AF_INET:
358 seq_printf(s, "%pI4", &server->addr.sockAddr.sin_addr.s_addr); 361 seq_printf(s, "%pI4", &sa->sin_addr.s_addr);
359 break; 362 break;
360 case AF_INET6: 363 case AF_INET6:
361 seq_printf(s, "%pI6", 364 seq_printf(s, "%pI6", &sa6->sin6_addr.s6_addr);
362 &server->addr.sockAddr6.sin6_addr.s6_addr); 365 if (sa6->sin6_scope_id)
363 if (server->addr.sockAddr6.sin6_scope_id) 366 seq_printf(s, "%%%u", sa6->sin6_scope_id);
364 seq_printf(s, "%%%u",
365 server->addr.sockAddr6.sin6_scope_id);
366 break; 367 break;
367 default: 368 default:
368 seq_printf(s, "(unknown)"); 369 seq_printf(s, "(unknown)");