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] [day] [month] [year] [list]
Date:	Sun, 17 Dec 2006 16:15:40 +0100
From:	Ingo Oeser <ioe-lkml@...eria.de>
To:	NeilBrown <neilb@...e.de>
Cc:	Andrew Morton <akpm@...l.org>, nfs@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 009 of 14] knfsd: SUNRPC: teach svc_sendto() to deal with IPv6 addresses

On Wednesday, 13. December 2006 00:59, NeilBrown wrote:
> diff .prev/net/sunrpc/svcsock.c ./net/sunrpc/svcsock.c
> --- .prev/net/sunrpc/svcsock.c	2006-12-13 10:31:39.000000000 +1100
> +++ ./net/sunrpc/svcsock.c	2006-12-13 10:32:15.000000000 +1100
> @@ -438,6 +439,47 @@ svc_wake_up(struct svc_serv *serv)
>  	}
>  }
>  
> +union svc_pktinfo_u {
> +	struct in_pktinfo pkti;
> +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
> +	struct in6_pktinfo pkti6;
> +#endif
> +};
> +
> +static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
> +{
> +	switch (rqstp->rq_sock->sk_sk->sk_family) {
> +	case AF_INET:
> +		do {
> +			struct in_pktinfo *pki =
> +					(struct in_pktinfo *) CMSG_DATA(cmh);

			struct in_pktinfo *pki = CMSG_DATA(cmh);

Ugly casting not needed here, since CMSG_DATA should return "void *",
which can be casted to any pointer.

> +
> +			cmh->cmsg_level = SOL_IP;
> +			cmh->cmsg_type = IP_PKTINFO;
> +			pki->ipi_ifindex = 0;
> +			pki->ipi_spec_dst.s_addr = rqstp->rq_daddr.addr.s_addr;
> +			cmh->cmsg_len = CMSG_LEN(sizeof(*pki));
> +		} while (0);
> +		break;
> +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
> +	case AF_INET6:
> +		do {
> +			struct in6_pktinfo *pki =
> +					(struct in6_pktinfo *) CMSG_DATA(cmh);
> +

No casting needed, so:

			struct in6_pktinfo *pki = CMSG_DATA(cmh);


Regards

Ingo Oeser
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ