quoted hunk
@@ -305,6 +308,11 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
if (addr_len < sizeof(*addr))
return -EINVAL;
+ if (addr->sin_family != AF_INET &&
+ !(addr->sin_family == AF_UNSPEC &&
+ addr->sin_addr.s_addr == htonl(INADDR_ANY)))
+ return -EAFNOSUPPORT;
+
Aside: I would be all in favor of deprecating this legacy "bind to \0
and gee whiz it just works (for IPv4)" kind of behaviour. But
anyway...
Acked-by: Erik Kline <redacted>