[quagga-dev 7798] Re: IPv6 Multicast Hop Limit for OSPFv3

Mike Pontillo pontillo at gmail.com
Thu Feb 11 19:54:21 GMT 2010

On Thu, Feb 11, 2010 at 10:47 AM,  <paul at jakma.org> wrote:
> Using enums isn't a bad idea, I think where that's done they also provide a
> define though.

   If it were me, I'd go one way or the other. It would be extra work
to have an enum and then a set of defines that map to each value in
the enum. I don't think there would be a good reason to have #defines
as well, unless someone was checking for your enumerated values with
an #ifdef. =)

   Maybe I'm being pedantic; I know they're usually #defines. But I
don't see anywhere where it's dictated that they *have* to be

> That's perfectly acceptable. It's a library symbol and we really want one
> day to be able to maintain it separately from the daemons. So the symbol
> should be there. If an app knows its v6 only and wants to optimise out the
> call on certain platforms, it may..
> The API should generally try avoid having symbols that ifdef'd on certain
> things.

   Yes, I think that's probably fine. (Though note that I wasn't
suggesting an #ifdef around the entire function/symbol; the API should
of course always be consistent.) It would only affect operation if
someone accidentally passed an AF_INET6 family into the _ttl()
functions for an IPv4 usage.

>> So my question becomes: does Quagga really support platforms that don't
>> have these socket options? And if so, would it be better for those platforms
>> to throw compile errors, so someone can figure out how to correctly
>> implement that functionality on their platform?
> Is the average builder of Quagga able to implement that kind of stuff?

   Good question. Who is the average builder of Quagga?

 - Many people probably don't build it. They get a binary from
somewhere. (this was the category I was in up until a couple of days
 - In the general case, I would think that most people compiling
Quagga would be doing so on a platform where the socket options DO
 - Edge case 1: Someone integrating Quagga into something important,
I'd rather get a red flag earlier that there might be a bug or missing
functionality, rather than later when it fails silently and my
customers get angry.
 - Edge case 2: A hobbyist trying to compile Quagga on the old UNIX
box in their basement (or some other random platform). I would think
that type of person would know how to #if 0 some code in that case?

  In either edge case, I would hope they would bring it up on the
mailing list and we would know that yes, there are actually platforms
people are compiling Quagga on that don't support socket options. If
needed, then we could support a --disable-ttl-modification
configuration option (or something)?

My suggestions:

- If there are platforms where this socket option doesn't work, it
should be a larger feature-level #define. In other words, something is
fundamentally different about that platform that would necessitate a
different approach.
- We can keep the #ifdef HAVE_IPV6 around the AF_INET6 pieces in the
library and the IPv6 socket options, because platforms that don't
support IPv6 won't have those socket options. I think we can assume
that the socket options themselves will be there if IPv6 is there.
They have been standard socket options since RFC 2133, which came out
in April 1997.


More information about the Quagga-dev mailing list