Re: [PATCH 01/14] NLM: Beef up NLM address display function

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

 



On Fri, Oct 24, 2008 at 02:09:54PM -0400, Chuck Lever wrote:
> Add support for IPv6 addresses with a scope ID,

I remain a bit confused about scope ID's.  If you tell me they're
needed, I'll believe you.

> and enable calls from outside of fs/lockd/host.c

Some day of course it'd be nice to collect all the basic "display an
ipv6 address" code together in one place!

> diff --git a/fs/lockd/host.c b/fs/lockd/host.c
> index 9fd8889..c7516ae 100644
> --- a/fs/lockd/host.c
> +++ b/fs/lockd/host.c
> @@ -104,29 +104,54 @@ static void nlm_clear_port(struct sockaddr *sap)
>  	}
>  }
>  
> -static void nlm_display_address(const struct sockaddr *sap,
...
> +int nlm_display_address(const struct sockaddr *sap, char *buf,

The return value is never used, even after your other patches.  Do you
have any plans to use it?

--b.

> +			const size_t len)
> +{
>  	switch (sap->sa_family) {
>  	case AF_UNSPEC:
> -		snprintf(buf, len, "unspecified");
> -		break;
> +		snprintf(buf, len, "unspecified address");
> +		return -EAFNOSUPPORT;
>  	case AF_INET:
> -		snprintf(buf, len, NIPQUAD_FMT, NIPQUAD(sin->sin_addr.s_addr));
> -		break;
> +		return nlm_display_ipv4_address(sap, buf, len);
>  	case AF_INET6:
> -		if (ipv6_addr_v4mapped(&sin6->sin6_addr))
> -			snprintf(buf, len, NIPQUAD_FMT,
> -				 NIPQUAD(sin6->sin6_addr.s6_addr32[3]));
> -		else
> -			snprintf(buf, len, NIP6_FMT, NIP6(sin6->sin6_addr));
> -		break;
> +		return nlm_display_ipv6_address(sap, buf, len);
>  	default:
>  		snprintf(buf, len, "unsupported address family");
> -		break;
> +		return -EAFNOSUPPORT;
>  	}
>  }
--
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