All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: Re: [Patch 3/3] tabled: drop addr_af
Date: Wed, 16 Dec 2009 00:48:21 -0500	[thread overview]
Message-ID: <4B2874A5.8080209@garzik.org> (raw)
In-Reply-To: <20091215221017.4cffc964@redhat.com>

On 12/16/2009 12:10 AM, Pete Zaitcev wrote:
> This flag was is a useless duplication and a fiction prompted by
> getaddrinfo(). In reality it's not useful even if we decide to run
> CLD over DCCP.
>
> Signed-off-by: Pete Zaitcev<zaitcev@redhat.com>
>
> ---
>   server/storage.c |    8 ++++----
>   server/tabled.h  |    3 +--
>   2 files changed, 5 insertions(+), 6 deletions(-)
>
> commit 7b1efec72048557b1b51d07a95073dbe25cf08d1
> Author: Master<zaitcev@lembas.zaitcev.lan>
> Date:   Tue Dec 15 21:47:48 2009 -0700
>
>      Drop af flag, not needed.
>
> diff --git a/server/storage.c b/server/storage.c
> index cc7066f..8298e60 100644
> --- a/server/storage.c
> +++ b/server/storage.c
> @@ -44,10 +44,10 @@ static int stor_new_stc(struct storage_node *stn, struct st_client **stcp)
>   	struct sockaddr_in6 *a6;
>   	unsigned short port;
>
> -	if (stn->addr_af == AF_INET) {
> +	if (stn->addr.sin6_family == AF_INET) {
>   		a4 = (struct sockaddr_in *)&stn->addr;
>   		port = ntohs(a4->sin_port);
> -	} else if (stn->addr_af == AF_INET6) {
> +	} else if (stn->addr.sin6_family == AF_INET6) {
>   		a6 =&stn->addr;
>   		port = ntohs(a6->sin6_port);
>   	} else {
> @@ -419,9 +419,9 @@ static int stor_add_node_addr(struct storage_node *sn,
>   		if (res->ai_addrlen>  ADDRSIZE)		/* should not happen */
>   			continue;
>
> -		memcpy(&sn->addr, res->ai_addr, res->ai_addrlen);
> -		sn->addr_af = res->ai_family;
>   		sn->alen = res->ai_addrlen;
> +		memcpy(&sn->addr, res->ai_addr, sn->alen);
> +		sn->addr.sin6_family = res->ai_family;

applied 1-3, though I have a mild worry about how well this change works 
on non-Linux platforms.

We'll see when I next boot my FreeBSD virtual machine...

	Jeff



      reply	other threads:[~2009-12-16  5:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-16  5:10 [Patch 3/3] tabled: drop addr_af Pete Zaitcev
2009-12-16  5:48 ` Jeff Garzik [this message]

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=4B2874A5.8080209@garzik.org \
    --to=jeff@garzik.org \
    --cc=hail-devel@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /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.