lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1450292515.23587.6.camel@perches.com>
Date:	Wed, 16 Dec 2015 11:01:55 -0800
From:	Joe Perches <joe@...ches.com>
To:	Hannes Frederic Sowa <hannes@...essinduktion.org>,
	netdev@...r.kernel.org
Subject: Re: [PATCH net-next] ipv6: add IPV6_HDRINCL option for raw sockets

On Wed, 2015-12-16 at 17:22 +0100, Hannes Frederic Sowa wrote:
> Same as in Windows, we miss IPV6_HDRINCL for SOL_IPV6 and SOL_RAW.
> The SOL_IP/IP_HDRINCL is not available for IPv6 sockets.
[]
> diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
[]
> @@ -972,6 +972,11 @@ static int do_rawv6_setsockopt(struct sock *sk,
> int level, int optname,
>  		return -EFAULT;
>  
>  	switch (optname) {
> +	case IPV6_HDRINCL:
> +		if (sk->sk_type != SOCK_RAW)
> +			return -EINVAL;
> +		inet_sk(sk)->hdrincl = !!val;

trivia:

ipv4/sockglue.c uses the ternary '? 1 : 0' convention for this.
It might be nicer to be consistent.

Then again sockglue.c is inconsistent about that too.

net/ipv4/ip_sockglue.c:736:		inet->hdrincl = val ? 1 : 0;
net/ipv4/ip_sockglue.c:743:		inet->nodefrag = val ? 1 : 0;
net/ipv4/ip_sockglue.c:746:		inet->bind_address_no_port = val ? 1 : 0;
net/ipv4/ip_sockglue.c:754:             inet->recverr = !!val;
net/ipv4/ip_sockglue.c:772:             inet->mc_loop = !!val;
net/ipv4/ip_sockglue.c:1123:            inet->freebind = !!val;

There's no change to object code either way.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ