cifs: fix sockaddr comparison in iface_cmp
authorShyam Prasad N <sprasad@microsoft.com>
Fri, 9 Jun 2023 17:46:59 +0000 (17:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:25 +0000 (09:42 +0200)
commit8a424afa08c54670192f4b0c5351207ff6f8cdc4
treeeaf9ea11e36bfdd001a818d19c231fef712c5150
parentea13eff14ef2912d4256ef1a67bdd09b3033f473
cifs: fix sockaddr comparison in iface_cmp

[ Upstream commit 2991b77409891e14a10b96899755c004b0c07edb ]

iface_cmp used to simply do a memcmp of the two
provided struct sockaddrs. The comparison needs to do more
based on the address family. Similar logic was already
present in cifs_match_ipaddr. Doing something similar now.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/cifsglob.h
fs/smb/client/cifsproto.h
fs/smb/client/connect.c
fs/smb/client/smb2ops.c