Re: [Patch 3/3] tabled: drop addr_af

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

 



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

---
  server/storage.c |    8 ++++----
  server/tabled.h  |    3 +--
  2 files changed, 5 insertions(+), 6 deletions(-)

commit 7b1efec72048557b1b51d07a95073dbe25cf08d1
Author: Master<zaitcev@xxxxxxxxxxxxxxxxxx>
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



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

[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux