netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahide NAKAMURA <nakam@linux-ipv6.org>
To: shemminger@osdl.org
Cc: David Miller <davem@davemloft.net>,
	yoshfuji@linux-ipv6.org, tgraf@suug.ch, netdev@vger.kernel.org,
	usagi-core@linux-ipv6.org
Subject: [IPROUTE2][PATCH] Add missing macros which was removed from kernel header. (Re: [GIT PATCH] NET: Fixes for net-2.6.19)
Date: Sat, 30 Sep 2006 16:27:07 +0900	[thread overview]
Message-ID: <200609301627.08278.nakam@linux-ipv6.org> (raw)
In-Reply-To: <451C7E11.6040506@linux-ipv6.org>

> David Miller wrote:
> >> commit 0844565fb8a9418f5a860aa480c1aef70319c9a2
> >> Author: Thomas Graf <tgraf@suug.ch>
> >> Date:   Fri Aug 4 23:05:56 2006 -0700
> >>
> >>     [NET]: Move netlink interface bits to linux/if.h
> >>     
> >>     Signed-off-by: Thomas Graf <tgraf@suug.ch>
> >>     Signed-off-by: David S. Miller <davem@davemloft.net>
> > 
> > Stephen, we just removed the troublesome bits from linux/if.h when I
> > put in Yoshifuji's patches last night, it should explicitly remove
> > this problem.
> > 
> > You will thus see that linux/rtnetlink.h no longer includes
> > linux/if.h, which is why your errors were completely perplexing
> > to me.  Instead, it includes linux/if_link.h
> > 
> > It's been in my tree since last night, and if you had used
> > the rtnetlink.h from my current tree you wouldn't have seen
> > the error.
> 
> Yes, as David mentioned you need to copy the latest rtnetlink.h
> at first. It is also required to be added if_{link,addr}.h, neighbour.h
> to iproute2 tree. Some macros may be needed for libnetlink.h, too.
> I'll send the patch to you if you haven't started on it.

Stephen, this patch is for iproute2. Please check and apply it after syncing
kernel headers (e.g. rtnetlink.h) with David's tree. Please also note to add
new ones (i.e. include/linux/{if_link.h,if_addr.h,neighbour.h}) which is
split from rtnetlink.h.


[PATCH] Add missing macros which was removed from kernel header.

{IFA,IFLA,NDA,NDTA}_{RTA,PAYLOAD} macro is removed from kernel
header since net-2.6.19 because it is not used by kernel code.

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
---
 include/libnetlink.h |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/include/libnetlink.h b/include/libnetlink.h
index 63cc3c8..9de3a0b 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -4,6 +4,9 @@ #define __LIBNETLINK_H__ 1
 #include <asm/types.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
+#include <linux/if_link.h>
+#include <linux/if_addr.h>
+#include <linux/neighbour.h>
 
 struct rtnl_handle
 {
@@ -53,5 +56,37 @@ extern int rtnl_from_file(FILE *, rtnl_f
 #define NLMSG_TAIL(nmsg) \
 	((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
 
+#ifndef IFA_RTA
+#define IFA_RTA(r) \
+	((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#endif
+#ifndef IFA_PAYLOAD
+#define IFA_PAYLOAD(n)	NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
+#endif
+
+#ifndef IFLA_RTA
+#define IFLA_RTA(r) \
+	((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#endif
+#ifndef IFLA_PAYLOAD
+#define IFLA_PAYLOAD(n)	NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+#endif
+
+#ifndef NDA_RTA
+#define NDA_RTA(r) \
+	((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
+#endif
+#ifndef NDA_PAYLOAD
+#define NDA_PAYLOAD(n)	NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
+#endif
+
+#ifndef NDTA_RTA
+#define NDTA_RTA(r) \
+	((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndtmsg))))
+#endif
+#ifndef NDTA_PAYLOAD
+#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
+#endif
+
 #endif /* __LIBNETLINK_H__ */
 
-- 
1.4.2




-- 
Masahide NAKAMURA

  reply	other threads:[~2006-09-30  7:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-18 15:08 [GIT PATCH] NET: Fixes for net-2.6.19 YOSHIFUJI Hideaki / 吉藤英明
2006-09-18 18:57 ` Thomas Graf
2006-09-21  5:30   ` YOSHIFUJI Hideaki / 吉藤英明
2006-09-21 10:14     ` Thomas Graf
2006-09-28  5:44 ` David Miller
2006-09-28 15:36   ` Stephen Hemminger
2006-09-28 21:33     ` David Miller
2006-09-28 22:50       ` Stephen Hemminger
2006-09-28 23:04         ` David Miller
2006-09-28 23:27           ` Stephen Hemminger
2006-09-29  0:28             ` David Miller
2006-09-29  1:59               ` Masahide NAKAMURA
2006-09-30  7:27                 ` Masahide NAKAMURA [this message]
2006-10-05 18:01                   ` [IPROUTE2][PATCH] Add missing macros which was removed from kernel header. (Re: [GIT PATCH] NET: Fixes for net-2.6.19) Stephen Hemminger
2006-10-09 16:08                 ` [GIT PATCH] NET: Fixes for net-2.6.19 Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200609301627.08278.nakam@linux-ipv6.org \
    --to=nakam@linux-ipv6.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.org \
    --cc=tgraf@suug.ch \
    --cc=usagi-core@linux-ipv6.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).