--- libc/sysdeps/unix/sysv/linux/netlinkaccess.h.ark 2006-08-17 01:30:12.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/netlinkaccess.h 2006-08-17 01:40:02.000000000 +0200 @@ -25,7 +25,6 @@ #include <kernel-features.h> - struct netlink_res { struct netlink_res *next; --- libc/sysdeps/unix/sysv/linux/ifaddrs.c.ark 2006-08-17 01:57:55.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/ifaddrs.c 2006-08-17 01:58:02.000000000 +0200 @@ -22,6 +22,7 @@ #include <errno.h> #include <ifaddrs.h> #include <net/if.h> +#include <linux/if.h> #include <netinet/in.h> #include <netpacket/packet.h> #include <stdbool.h> --- libc/sysdeps/unix/sysv/linux/check_pf.c.ark 2006-08-17 02:20:48.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/check_pf.c 2006-08-17 02:20:58.000000000 +0200 @@ -26,6 +26,7 @@ #include <time.h> #include <unistd.h> #include <sys/socket.h> +#include <net/if.h> #include <asm/types.h> #include <linux/netlink.h> --- libc/sysdeps/gnu/net/if.h.ark 2006-08-17 01:23:07.000000000 +0200 +++ libc/sysdeps/gnu/net/if.h 2006-08-17 02:43:51.000000000 +0200 @@ -101,6 +101,7 @@ # define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */ # define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of link */ +#ifdef NOT_IN_GLIBC /* Duped from linux/if.h */ /* Device mapping structure. I'd just gone off and designed a beautiful scheme using only loadable modules with arguments for driver options and along come the PCMCIA people 8) @@ -186,6 +187,46 @@ # define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */ # define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */ # define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) /* not right */ +#else +#include <linux/if.h> +#include <stdint.h> +/* taken from linux/if_addr.h, which is no longer installed */ +/* + * Important comment: + * IFA_ADDRESS is prefix address, rather than local interface address. + * It makes no difference for normally configured broadcast interfaces, + * but for point-to-point IFA_ADDRESS is DESTINATION address, + * local address is supplied in IFA_LOCAL attribute. + */ +enum +{ + IFA_UNSPEC, + IFA_ADDRESS, + IFA_LOCAL, + IFA_LABEL, + IFA_BROADCAST, + IFA_ANYCAST, + IFA_CACHEINFO, + IFA_MULTICAST, + __IFA_MAX, +}; +struct ifaddrmsg +{ + uint8_t ifa_family; + uint8_t ifa_prefixlen; /* The prefix length */ + uint8_t ifa_flags; /* Flags */ + uint8_t ifa_scope; /* Address scope */ + uint32_t ifa_index; /* Link index */ +}; + +#define IFA_F_DEPRECATED 0x20 +#define IFA_F_SECONDARY 0x01 + +#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg)))) +#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg)) +#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) +#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) +#endif /* linux/if.h */ #endif /* Misc. */ __BEGIN_DECLS