Skip to content

Commit

Permalink
[NETLINK]: Put {IFA,IFLA}_{RTA,PAYLOAD} macros back for userspace.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Dec 9, 2006
1 parent 160d5e1 commit d3dcc07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/linux/if_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions include/linux/if_link.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d3dcc07

Please sign in to comment.