Re: updated ipv6 patch for postfix
>I may still misunderstand the point, but I think you can calculate the
>offset (i.e. sizeof(struct sockaddr_in6)) if you first check the
>sa_family likt the following code:
>
>struct ifconf ifconf;
>struct ifreq *ifrp;
>
> ioctl(sockt, SIOCGIFCONF, (char *)&ifconf);
>
> for (i = 0; i < ifconf.ifc_len; i += sizeof(struct ifreq)) {
> ifrp = (struct ifreq *)(ifconfg.ifc_buf + i);
>
> .../* use ifrp as you want */
>
> if (ifrp->ifr_addr.sa_family == AF_INET6) /* you may need more cases */
> i += (sizeof(struct sockaddr_in6) - sizeof(struct sockaddr));
> }
Sure, but old programs don't know to do that and so they would break. This is
why I don't think we can extend SIOCGIFCONF and instead a new ioctl is needed.
(Apologies if we've been talking at cross purposes.)
Other than the compatibility issues I don't think there is any problem.
p.
Reply to: