cifs: clean up server protocol handling
authorSteve French <sfrench@us.ibm.com>
Fri, 21 Nov 2008 08:53:07 +0000 (14:23 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Dec 2008 18:55:26 +0000 (10:55 -0800)
commit191e471d6d55a0159406112f61cdd7fc8598e3e2
tree3c8343674cd6ed3ccf304c14eb2ea0a8ea9bd89f
parent044deda3cd9f2df3e3a9df3c8b74d5b82e7ae6e6
cifs: clean up server protocol handling

commit 3ec332ef7a38c2327e18d087d4120a8e3bd3dc6e upstream.

We're currently declaring both a sockaddr_in and sockaddr6_in on the
stack, but we really only need storage for one of them. Declare a
sockaddr struct and cast it to the proper type. Also, eliminate the
protocolType field in the TCP_Server_Info struct. It's redundant since
we have a sa_family field in the sockaddr anyway.

We may need to revisit this if SCTP is ever implemented, but for now
this will simplify the code.

CIFS over IPv6 also has a number of problems currently. This fixes all
of them that I found. Eventually, it would be nice to move more of the
code to be protocol independent, but this is a start.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Cc: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/cifs_spnego.c
fs/cifs/cifsglob.h
fs/cifs/connect.c