On Mon, Aug 20, 2007 at 10:53:10PM +0000, Juliusz Chroboczek wrote:
> reopen 436988
> severity 436988 minor
> thanks
> 
> (Richard, if you do a wide reply, please make sure you remove control@
> from the CC.)
> 
> I'm afraid that my patch may have broken compilation on older libc
> releases.  Pierre, do we still care about libc 2.4 and earlier?

  well, technically we don't for sid, we just care if we intend to
backport pdnsd to etch, where libc is 2.3.

> I may be wrong, but I believe that something like the following should
> work under all libc/kernel combinations.  However, I have not tested it.
> 
>   rc = -1; errno = ENOPROTOOPT;
> 
> #ifdef IPv6_RECVPKTINFO
> rc = setsockopt(sock,SOL_IPV6,IPV6_RECVPKTINFO,&so,sizeof(so));
> #endif
> #ifdef IPV6_2292PKTINFO
> if(rc < 0 && errno == ENOPROTOOPT)
>   rc = setsockopt(sock,SOL_IPV6,IPV6_2292PKTINFO,&so,sizeof(so));
> #endif
> if(rc < 0 && errno == ENOPROTOOPT)
>   rc = setsockopt(sock,SOL_IPV6,IPV6_PKTINFO,&so,sizeof(so));

  This would work if IPV6_RECVPKTINFO is a macro, which it may not be on
every OS (even if it is on linux with glibc). I'm not sure if anything
mandates it being one.

  For all I care right now, backward compatibility is not a very big
issue, and if I need it, this patch will be good for Debian where we
always have a glibc.

-- 
·O·  Pierre Habouzit
··O                                                [EMAIL PROTECTED]
OOO                                                http://www.madism.org

Attachment: pgpGdGRsTRruM.pgp
Description: PGP signature

Reply via email to