netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Cc: netdev@vger.kernel.org, brian.haley@hp.com
Subject: Re: [PATCH net-next v2 1/4] ipv6: introduce new type ipv6_addr_props to hold ipv6 address type and scope
Date: Sun, 17 Feb 2013 02:47:18 +0100	[thread overview]
Message-ID: <20130217014718.GA28547@order.stressinduktion.org> (raw)
In-Reply-To: <512016E8.30305@linux-ipv6.org>

On Sun, Feb 17, 2013 at 08:31:52AM +0900, YOSHIFUJI Hideaki wrote:
> >> -extern int __ipv6_addr_type(const struct in6_addr *addr);
> >> -static inline int ipv6_addr_type(const struct in6_addr *addr)
> >> +struct ipv6_addr_props {
> >> +	u16 type;
> >> +	s16 scope;
> >> +};
> >> +
> >> +extern struct ipv6_addr_props __ipv6_addr_props(const struct in6_addr *addr);
> >> +static inline unsigned int ipv6_addr_type(const struct in6_addr *addr)
> >>  {
> >> -	return __ipv6_addr_type(addr) & 0xffff;
> >> +	return __ipv6_addr_props(addr).type;
> >>  }
> >>  
> >>  static inline int ipv6_addr_scope(const struct in6_addr *addr)
> >>  {
> >> -	return __ipv6_addr_type(addr) & IPV6_ADDR_SCOPE_MASK;
> >> +	return __ipv6_addr_props(addr).scope;
> >>  }
> >>  
> > 
> > NAK.  This does not return correct value as before.
> > If you are going to covert this, please do not try to
> > change usage of inlines.  
> 
> I meant
> 
> struct ipv6_addrtype {
> 	__u16 type;
> 	__s16 scope;
> };
> 
> struct ipv6_addrtype __ipv6_addr_type(const struct in6_addr *addr);
> int ipv6_addr_type(const struct in6_addr *addr)
> {
> 	return __ipv6_addr_type(addr).type;
> }
> 
> And most users should not be touched except for it type name
> (int => struct addrtype).

Sorry, I am a bit confused. The missing '& IPV6_ADDR_SCOPE_MASK' is clearly a
bug. I implied a bitmask for the IPV6_ADDR_SCOPE_* macros. But I don't
understand to what you do refer in your second mail.

  reply	other threads:[~2013-02-17  1:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-16 19:10 [PATCH net-next v2 1/4] ipv6: introduce new type ipv6_addr_props to hold ipv6 address type and scope Hannes Frederic Sowa
2013-02-16 23:18 ` YOSHIFUJI Hideaki
2013-02-16 23:31   ` YOSHIFUJI Hideaki
2013-02-17  1:47     ` Hannes Frederic Sowa [this message]
2013-02-17  2:52       ` YOSHIFUJI Hideaki
2013-02-17  3:01         ` Hannes Frederic Sowa
2013-02-17  0:05 ` YOSHIFUJI Hideaki

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=20130217014718.GA28547@order.stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=brian.haley@hp.com \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).