This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Added missing ICMPv6 flags and option
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Dan LÃdtke <maildanrl at gmail dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org, Dan Luedtke <danrl at danrl dot de>
- Date: Wed, 12 Feb 2014 16:44:16 -0500
- Subject: Re: [PATCH] Added missing ICMPv6 flags and option
- Authentication-results: sourceware.org; auth=none
- References: <1392230153-23499-1-git-send-email-danrl at danrl dot de> <52FBC7DD dot 8020309 at redhat dot com> <CAAfuxnK0eAA1mA_fxhO4Oz9hWiV4yJ6FrZOGDC4j+1uv0OXHFQ at mail dot gmail dot com> <52FBD8BC dot 4020805 at redhat dot com> <52FBDEFE dot 9050302 at redhat dot com> <52FBE440 dot 2090705 at redhat dot com> <CAAfuxnKo0xi8FFAjt15TR=DWRX7=xoqEewNih_UwEQt=eYnxBw at mail dot gmail dot com>
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.