This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Added missing ICMPv6 flags and option


On 02/12/2014 04:30 PM, Dan LÃdtke wrote:
>>> I looked a bit around and it seems the BSDs already have these
>>> constants under slightly different names, ND_RA_FLAG_RTPREF_LOW etc.,
>>> plus _MASK and _RSV constants.  This might be sufficient reason to
>>> include these constants.
> Done.

So can we now claim that we are compatible with the BSD defines?

That is to say that a ported program would see the same values
for these defines?

>> Right, we need a standard set of defines.
> Yes we do. I have more in the queue. See my next patch which includes
> the options I need for my software to work.
> 
>> Do these constants exist in the Linux kernel?
> They look a bit different there.
> 
> include/uapi/linux/icmpv6.h:
> 82 #define ICMPV6_ROUTER_PREF_LOW          0x3
> 83 #define ICMPV6_ROUTER_PREF_MEDIUM       0x0
> 84 #define ICMPV6_ROUTER_PREF_HIGH         0x1
> 85 #define ICMPV6_ROUTER_PREF_INVALID      0x2

OK.

>> Would a sensible person reading the RFCs come up with the same constant names?
> I consider myself sensible and I read a lot of IPv6-related RFCs :)
> So, yes, given that there are no constants in the RFC. First come,
> first define? It is a bit of a mess at the moment when writing
> portable IPv6 software right now.
> For example, this one always gives me a headache and needs custom
> defines to work around:
> glibc:
> #define ND_RA_FLAG_HOME_AGENT    0x20
> 
> BSD(?):
> #define ND_RA_FLAG_HA    0x20
 
In that case we want both defines like this:

#define ND_RA_FLAG_HOME_AGENT	0x20
/* For compatibility with BSD.  */
#define ND_RA_FLAG_HA		ND_RA_FLAG_HOME_AGENT
 
I prefer the more verbose "HOME_AGENT."

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]