[NETLINK]: Put {IFA,IFLA}_{RTA,PAYLOAD} macros back for userspace.
authorDavid S. Miller <davem@sunset.davemloft.net>
Sat, 9 Dec 2006 01:05:13 +0000 (17:05 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sat, 9 Dec 2006 01:19:33 +0000 (17:19 -0800)
GLIBC uses them etc.

They are guarded by ifndef __KERNEL__ so nobody will start
accidently using them in the kernel again, it's just for
userspace.

Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/if_addr.h
include/linux/if_link.h

index dbe8f61..d557e4c 100644 (file)
@@ -52,4 +52,10 @@ struct ifa_cacheinfo
        __u32   tstamp; /* updated timestamp, hundredths of seconds */
 };
 
+/* backwards compatibility for userspace */
+#ifndef __KERNEL__
+#define IFA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
+#endif
+
 #endif
index e963a07..35ed3b5 100644 (file)
@@ -82,6 +82,12 @@ enum
 
 #define IFLA_MAX (__IFLA_MAX - 1)
 
+/* backwards compatibility for userspace */
+#ifndef __KERNEL__
+#define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+#endif
+
 /* ifi_flags.
 
    IFF_* flags.