Platform survey of pktinfo support

ghudson@MIT.EDU ghudson at MIT.EDU
Mon Sep 13 12:27:55 EDT 2010


I'm interested in finding out what Unix-like platforms and versions
have support for IPv4 and IPv6 pktinfo extensions.  You can help by
compiling and running this small C program and sending me the results.

Modern versions of Linux distributions aren't all that interesting
since they're all based on similar versions of the kernel which has
pktinfo support.  Older versions of Linux distributions are
interesting, as are non-Linux platforms.

Also, for the Oracle people: Solaris 10 doesn't appear to define
IP_PKTINFO.  Does it have any form of IPv4 pktinfo support?  If not,
do more recent versions have it?

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/utsname.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>

int main()
{
    struct utsname ut;

    if (uname(&ut) < 0) {
	fprintf(stderr, "uname failed\n");
	return 1;
    }
    printf("%s %s %s\n", ut.sysname, ut.release, ut.version);
#ifdef IPV6_RECVPKTINFO
    printf("IPV6_RECVPKTINFO defined\n");
#endif
#ifdef IPV6_PKTINFO
    printf("IPV6_PKTINFO defined\n");
#endif
#ifdef IP_RECVPKTINFO
    printf("IP_RECVPKTINFO defined\n");
#endif
#ifdef IP_PKTINFO
    printf("IP_PKTINFO defined\n");
#endif
#ifdef CMSG_SPACE
    printf("CMSG_SPACE defined\n");
#endif
    return 0;
}



More information about the krbdev mailing list