All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Rees <rees@umich.edu>
To: greearb@candelatech.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfs-utils:  Support binding to source address.
Date: Wed, 8 Jun 2011 14:36:08 -0400	[thread overview]
Message-ID: <20110608183608.GA3513@merit.edu> (raw)
In-Reply-To: <1307554748-31757-1-git-send-email-greearb@candelatech.com>

greearb@candelatech.com 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 *)?

  reply	other threads:[~2011-06-08 18:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-08 17:39 [PATCH] nfs-utils: Support binding to source address greearb
2011-06-08 18:36 ` Jim Rees [this message]
2011-06-08 18:39   ` Ben Greear
2011-06-08 20:45     ` Chuck Lever
2011-06-08 19:11 ` J. Bruce Fields
2011-06-08 19:17   ` Ben Greear
2011-06-08 20:41 ` Chuck Lever
2011-06-08 20:54   ` Ben Greear
2011-06-08 21:16     ` Chuck Lever
2011-06-08 21:30       ` Ben Greear
2011-06-09  5:47 ` NeilBrown
2011-06-09  6:12   ` Ben Greear
2011-06-09  6:38     ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110608183608.GA3513@merit.edu \
    --to=rees@umich.edu \
    --cc=greearb@candelatech.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.