net/ping: handle protocol mismatching scenario
net/ping: handle protocol mismatching scenario

ping_lookup() may return a wrong sock if sk_buff's and sock's protocols
dont' match. For example, sk_buff's protocol is ETH_P_IPV6, but sock's
sk_family is AF_INET, in that case, if sk->sk_bound_dev_if is zero, a wrong
sock will be returned.
the fix is to "continue" the searching, if no matching, return NULL.

Cc: "David S. Miller" <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
Cc: Alexey Kuznetsov <55346d3bc0c58d58503ceaa50b259ca76fcb3262@ms2.inr.ac.ru>
Cc: James Morris <10d11de3abc355eabe955bb734f0f8e71da56e16@namei.org>
Cc: Hideaki YOSHIFUJI <948b80da4254122ea1e8973dd9930d46b7654cf3@linux-ipv6.org>
Cc: Patrick McHardy <3a4d625ce225e891399f98db96a382ac4a84080b@trash.net>
Cc: 1099b3bee480025a15c1b622ecdea77a1d6d7166@vger.kernel.org
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Signed-off-by: Jane Zhou <f33d98c4ba90e6374ac3c3e9a532a464476c594f@motorola.com>
Signed-off-by: Yiwei Zhao <9d4b7fec34444d4f7b5bcba52a53fb47535914f4@motorola.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs