2004-08-19 Paul Jakma <paul@dishone.st>
* sockopt.h: Update renamed exported functions
Rename the CMSG_SIZE macros to IFINDEX.
Guard IPv4 PKTINFO in a conditional define.
#define SOPT_SIZE_CMSG_PKTINFO_IPV6() (sizeof (struct in6_pktinfo));
I don't mean to imply that you caused any problems with this, but
there seems to be an underlying problem in ospfd where this is used:
char buff [sizeof (*cmsg) + SOPT_SIZE_CMSG_PKTINFO_IPV4()];
msgh.msg_control = (caddr_t) buff;
msgh.msg_controllen = sizeof (buff);
The macro in sockopt.h returns the actual size, but the CMSG_SPACE
padding is not done (see /usr/include/sys/socket.h on netbsd, assuming
this is the same on linux but not sure).
In contrast, I fixed zebra/rtadvd.c:
msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo));
cmsghdr is 12 bytes, so on sparc and sparc64 it gets aligned to 16.
So I would expect this not to work on NetBSD/sparc64, yet it seems to.
* sockopt.h: Update renamed exported functions
Rename the CMSG_SIZE macros to IFINDEX.
Guard IPv4 PKTINFO in a conditional define.
#define SOPT_SIZE_CMSG_PKTINFO_IPV6() (sizeof (struct in6_pktinfo));
I don't mean to imply that you caused any problems with this, but
there seems to be an underlying problem in ospfd where this is used:
char buff [sizeof (*cmsg) + SOPT_SIZE_CMSG_PKTINFO_IPV4()];
msgh.msg_control = (caddr_t) buff;
msgh.msg_controllen = sizeof (buff);
The macro in sockopt.h returns the actual size, but the CMSG_SPACE
padding is not done (see /usr/include/sys/socket.h on netbsd, assuming
this is the same on linux but not sure).
In contrast, I fixed zebra/rtadvd.c:
msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo));
cmsghdr is 12 bytes, so on sparc and sparc64 it gets aligned to 16.
So I would expect this not to work on NetBSD/sparc64, yet it seems to.