Re: [PATCH] prevent autofs to try the wrong IP protocol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2016-01-18 at 10:36 +0800, Ian Kent wrote:
>  
> +static int check_address_proto(unsigned logopt,
> +> 	> 	> 	>        struct host *host, unsigned int version)
> +{
> +> 	> int ipv6_requested = version & (TCP6_REQUESTED | UDP6_REQUESTED);
> +> 	> int ret = 1;
> +
> +> 	> /* If a protocol has been explicitly requested then don't
> +> 	>  * consider addresses that don't match the requested protocol.
> +> 	>  */
> +> 	> if (version & ipv6_requested) {

Umm .. I think this should just be:
if (ipv6_requested) {

> +		if (host->addr_len == INET_ADDRSTRLEN)
> +> 	> 	> 	> ret = 0;
> +> 	> } else {
> +> 	> 	> if (host->addr_len == INET6_ADDRSTRLEN)
> +> 	> 	> 	> ret = 0;
> +> 	> }
> +
> +> 	> if (!ret)
> +> 	> 	> debug(logopt, "requested protocol does not match address");
> +
> +> 	> return ret;
> +}
> +

--
To unsubscribe from this list: send the line "unsubscribe autofs" in



[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux