Re: [RFC] ipv6: Change %pI6 format to output compacted addresses?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Chuck Lever
Date: Thursday, August 13, 2009 - 11:39 am

On Aug 13, 2009, at 2:21 PM, Joe Perches wrote:

Hrm.

Do you have a use case?  Really, it's pretty easy to tell when the  
mapped v4 presentation format should be used.  See  
ipv6_addr_v4mapped().  Otherwise the mapped v4 presentation format  
should never be used.

A problem with the existing %p[iI] implementation is that each call  
site has to have logic that figures out the address family of the  
address before calling sprintf().  This makes it difficult to use this  
facility with, for example, debugging messages, since you have to add  
address family detection logic at every debugging message call site.   
Lots of clutter and duplicated code.

With %p6ic4, each call site now has to see that it's an IPv6 address,  
and then decide if the address is a mapped v4 address or not.  It's  
the same logic everywhere.

It seems to me it would be a lot more useful if we had a new %p6  
formatter that handled all types of IPv6 addresses properly, the way  
inet_ntop(3) does in user space.  (Or even a new formatter that could  
handle both address families).

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC] ipv6: Change %pI6 format to output compacted add ..., Christoph Hellwig, (Thu Aug 13, 7:18 am)
Re: [RFC] ipv6: Change %pI6 format to output compacted add ..., Chuck Lever, (Thu Aug 13, 11:39 am)