[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAAedzxqmUUfcQh7tsqS8BZXo2Ru-wGofSWpyW4dEOBnaACig2Q@mail.gmail.com>
Date:	Wed, 4 Mar 2015 17:58:25 +0900
From:	Erik Kline <ek@...gle.com>
To:	Lorenzo Colitti <lorenzo@...gle.com>
Cc:	netdev <netdev@...r.kernel.org>,
	Hannes Frederic Sowa <hannes@...essinduktion.org>,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH v2] net: ping: Return EAFNOSUPPORT when appropriate.
> @@ -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 <ek@...gle.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists
 
