Re: [PATCH] nfs-utils: Support binding to source address.

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

 



On 06/08/2011 11:36 AM, Jim Rees wrote:
greearb@xxxxxxxxxxxxxxx wrote:

   +	if (local_ip&&  local_ip->is_set) {
   +		sa = (struct sockaddr *)(char *)(&local_ip->addr);
   +		salen = local_ip->addrlen;
   +	} else {
   +		switch (family) {
   +		case AF_INET:
   +			sa = (struct sockaddr *)(char *)&sin;
   +			salen = sizeof(sin);
   +			break;
   +		case AF_INET6:
   +			sa = (struct sockaddr *)(char *)&sin6;
   +			salen = sizeof(sin6);
   +		default:
   +			break;
   +		}

Are the double casts actually necessary?  And if so, shouldn't the inner one
be (void *)?

They are not, as far as I know..I was copying some
similar code I found elsewhere in nfs-utils.

Unless someone knows a reason to keep this, I'll just
remove the inner cast.

Thanks,
Ben

--
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux