apache13 with IPv6: SIN6_LEN

Artur Frysiak wiget w t17.ds.pwr.wroc.pl
Śro, 29 Wrz 1999, 10:31:15 CEST


> From: Carl Brewer <carl w bl.echidna.id.au>
> 
> I've been working on porting your modified apache 1.3.6 to
> Solaris 7's IPv6 stack, and have found a few minor nitpicks.
> 
> RFC 2553 mandates the stacks supporting sa_len in struct sockaddr
> also define SIN6_LEN, but you have used __linux__ instead
> in your #ifdefs.  This means that I've had to go through
> and change a bunch of #ifdefs!  Mainly in src/main.
> 
> also, Linux must have a function __libc_sa_len(), which appears to
> return the value that sa_len would have if it was there, I'm in
> the process of knocking up a macro to ease porting efforts to other 
> versions of IPv6, and I will be sending you my patched source when it's done.

__libc_sa_len() is internal glibc function. Better use SA_LEN() macro.

(old code)
#ifdef __linux__
    salen = SA_LEN(sa);
#else
    salen = sa->sa_len;
#endif

(new code)
#ifndef SIN6_LEN
   salen = SA_LEN(sa);
#else
   salen = sa->sa_len;
#endif

(old code)
#ifndef __linux__
       ap_bind_address.ss_len = sizeof(struct sockaddr_in);
#endif

(new code)
#ifdef SIN6_LEN
       ap_bind_address.ss_len = sizeof(struct sockaddr_in);
#endif

Itojun, please check this code on KAME stack.

Wiget
-- 
  __    __ _            _
 / / /\ \ (_) __ _  ___| |_  @__mail:  Artur Frysiak
 \ \/  \/ / |/ _` |/ _ \ __|            Rudlice 10
  \  /\  /| | (_| |  __/ |_           98-311 Ostrowek
   \/  \/ |_|\__, |\___|\__|
             |___/           email:   Wiget w t17.ds.pwr.wroc.pl
PGP key: http://www.t17.ds.pwr.wroc.pl/~wiget/pgp.key
Fingerprint16 = 70 DB E0 2D 12 AB C7 31  B6 58 B5 61 B3 98 B6 E6



Więcej informacji o liście dyskusyjnej pld-devel-pl