Skip to contentSkip to conversation

NET: Fixes for net-2.6.19

PATCH In review YOSHIFUJI Hideaki / 吉藤英明 5 participants 15 messages Sep 18, 2006 – Oct 9, 2006

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NET: Fixes for net-2.6.19

Hello.

Please pull the following changesets available at:

	git://git.skbuff.net/gitroot/yoshfuji/net-2.6.19-20060918-net/

HEADLINES
---------

[XFRM]: Do not add a state whose SPI is zero to the SPI hash. [NET]: Move netlink interface bits to linux/if_link.h.
[NET]: Include linux/if_link.h directly from the source file. [NET]: Include new rtnetlink headers for userspace backward compatibility. [NET]: Put {IFLA,IFA,NDA,NDTA}_{RTA,PAYLOAD}() macro back. [NET] KBUILD: Add missing entries for new net headers.

DIFFSTAT
--------

 include/linux/Kbuild      |   10 ++-
 include/linux/if.h        |  130 ------------------------------------------
 include/linux/if_addr.h   |    3 +
 include/linux/if_link.h   |  139 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/neighbour.h |    7 ++
 include/linux/rtnetlink.h |    7 ++
 net/bridge/br_netlink.c   |    1 
 net/core/rtnetlink.c      |    1 
 net/core/wireless.c       |    1 
 net/ipv6/addrconf.c       |    1 
 net/xfrm/xfrm_state.c     |   11 ++--
 11 files changed, 172 insertions(+), 139 deletions(-)

CHANGESETS
----------

commit 04b3eac83cccb7da663bd11a2b569f197bb3170e

Author: Masahide NAKAMURA <[email protected]>
Date:   Sun Sep 17 13:54:53 2006 +0900

[XFRM]: Do not add a state whose SPI is zero to the SPI hash.

SPI=0 is used for acquired IPsec SA and MIPv6 RO state. Such state should not be added to the SPI hash because we do not care about it on deleting path.

net/xfrm/xfrm_state.c +7 -4
index 9f63edd..5f4a50e 100644
@@ -96,9 +96,12 @@ static void xfrm_hash_transfer(struct hl
 				    nhashmask);
 		hlist_add_head(&x->bysrc, nsrctable+h);
 
-		h = __xfrm_spi_hash(&x->id.daddr, x->id.spi, x->id.proto,
-				    x->props.family, nhashmask);
-		hlist_add_head(&x->byspi, nspitable+h);
+		if (x->id.spi) {
+			h = __xfrm_spi_hash(&x->id.daddr, x->id.spi,
+					    x->id.proto, x->props.family,
+					    nhashmask);
+			hlist_add_head(&x->byspi, nspitable+h);
+		}
 	}
 }
 
@@ -622,7 +625,7 @@ static void __xfrm_state_insert(struct x
 	h = xfrm_src_hash(&x->props.saddr, x->props.family);
 	hlist_add_head(&x->bysrc, xfrm_state_bysrc+h);
 
-	if (xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY)) {
+	if (x->id.spi) {
 		h = xfrm_spi_hash(&x->id.daddr, x->id.spi, x->id.proto,
 				  x->props.family);
 

---
commit 44ad787528719604896754d1d05895d2dcfff88b

Author: YOSHIFUJI Hideaki <[email protected]>
Date:   Sun Sep 17 13:54:55 2006 +0900

[NET]: Move netlink interface bits to linux/if_link.h.

Moving netlink interface bits to linux/if.h is rather troublesome for applications including both linux/if.h (which was changed to be included from linux/rtnetlink.h automatically) and net/if.h.

include/linux/if.h +0 -130

134 lines not on this page · raw message

include/linux/if_link.h new file +136 -0

136 lines not on this page · raw message

include/linux/rtnetlink.h +1 -1
index 9c92dc8..3a18add 100644
@@ -2,7 +2,7 @@ #ifndef __LINUX_RTNETLINK_H
 #define __LINUX_RTNETLINK_H
 
 #include <linux/netlink.h>
-#include <linux/if.h>
+#include <linux/if_link.h>
 
 /****
  *		Routing/neighbour discovery messages.

---
commit 41515f19f24841876c5e82eef940cf18f3c82455

Author: YOSHIFUJI Hideaki <[email protected]>
Date:   Sun Sep 17 13:54:58 2006 +0900

[NET]: Include linux/if_link.h directly from the source file.

For consistent use of other netlink bits, include new linux/if_link.h directly from the source file, not through linux/rtnetlink.h.

net/bridge/br_netlink.c +1 -0
index 8f66119..f55c8d3 100644
@@ -12,6 +12,7 @@
 
 #include <linux/kernel.h>
 #include <linux/rtnetlink.h>
+#include <linux/if_link.h>
 #include <net/netlink.h>
 #include "br_private.h"
 
net/core/rtnetlink.c +1 -0
index d8e25e0..9969cfd 100644
@@ -35,6 +35,7 @@ #include <linux/skbuff.h>
 #include <linux/init.h>
 #include <linux/security.h>
 #include <linux/mutex.h>
+#include <linux/if_link.h>
 #include <linux/if_addr.h>
 
 #include <asm/uaccess.h>
net/core/wireless.c +1 -0
index 3168fca..3be6457 100644
@@ -79,6 +79,7 @@ #include <linux/proc_fs.h>
 #include <linux/rtnetlink.h>		/* rtnetlink stuff */
 #include <linux/seq_file.h>
 #include <linux/init.h>			/* for __init */
+#include <linux/if_link.h>		/* IFLA_WIRELESS */
 #include <linux/if_arp.h>		/* ARPHRD_ETHER */
 #include <linux/etherdevice.h>		/* compare_ether_addr */
 #include <linux/interrupt.h>
net/ipv6/addrconf.c +1 -0
index fc9cff3..5cf5253 100644
@@ -48,6 +48,7 @@ #include <linux/sched.h>
 #include <linux/net.h>
 #include <linux/in6.h>
 #include <linux/netdevice.h>
+#include <linux/if_link.h>
 #include <linux/if_addr.h>
 #include <linux/if_arp.h>
 #include <linux/if_arcnet.h>

---
commit c9b734ff1d4ec9f264d7157d343a90240a188aae

Author: YOSHIFUJI Hideaki <[email protected]>
Date:   Sun Sep 17 13:55:00 2006 +0900

[NET]: Include new rtnetlink headers for userspace backward compatibility.

include/linux/rtnetlink.h +5 -0
index 3a18add..8ec375c 100644
@@ -2,7 +2,12 @@ #ifndef __LINUX_RTNETLINK_H
 #define __LINUX_RTNETLINK_H
 
 #include <linux/netlink.h>
+#ifndef __KERNEL__
+/* Backward compatibility */
 #include <linux/if_link.h>
+#include <linux/if_addr.h>
+#include <linux/neighbour.h>
+#endif
 
 /****
  *		Routing/neighbour discovery messages.

---
commit 55a08a9078b243a06223222735580df9e11a5fa6

Author: YOSHIFUJI Hideaki <[email protected]>
Date:   Sun Sep 17 13:55:02 2006 +0900

[NET]: Put {IFLA,IFA,NDA,NDTA}_{RTA,PAYLOAD}() macro back.

These macros are still used by userspace applications.

include/linux/if_addr.h +3 -0
index e159045..a51b2d3 100644
@@ -50,4 +50,7 @@ struct ifa_cacheinfo
 	__u32	tstamp; /* updated timestamp, hundredths of seconds */
 };
 
+#define IFA_RTA(r)	((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#define IFA_PAYLOAD(n)	NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
+
 #endif
include/linux/if_link.h +3 -0
index e963a07..bce8b98 100644
@@ -133,4 +133,7 @@ struct ifla_cacheinfo
 	__u32	retrans_time;
 };
 
+#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_LINK_H */
include/linux/neighbour.h +7 -0
index bd3bbf6..7476739 100644
@@ -26,6 +26,9 @@ enum
 
 #define NDA_MAX (__NDA_MAX - 1)
 
+#define NDA_RTA(r)	((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
+#define NDA_PAYLOAD(n)	NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
+
 /*
  *	Neighbor Cache Entry Flags
  */
@@ -156,4 +159,8 @@ enum {
 };
 #define NDTA_MAX (__NDTA_MAX - 1)
 
+#define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \
+		     NLMSG_ALIGN(sizeof(struct ndtmsg))))
+#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
+
 #endif

---
commit 1afcf9543d447ab3622ff4ecaacfa6baf83870b8

Author: YOSHIFUJI Hideaki <[email protected]>
Date:   Sun Sep 17 13:55:04 2006 +0900

[NET] KBUILD: Add missing entries for new net headers.

Add the following for userspace export by the 'headers_include' make target: linux/fib_rules.h, linux/if_addr.h, linux/if_link.h, linux/neighbour.h.

include/linux/Kbuild +6 -4
index 2b8a7d6..83375cd 100644
@@ -10,16 +10,18 @@ header-y += affs_fs.h affs_hardblocks.h 
 	bpqether.h cdk.h chio.h coda_psdev.h coff.h comstats.h		\
 	consolemap.h cycx_cfm.h dm-ioctl.h dn.h dqblk_v1.h		\
 	dqblk_v2.h dqblk_xfs.h efs_fs_sb.h elf-fdpic.h elf.h elf-em.h	\
-	fadvise.h fd.h fdreg.h ftape-header-segment.h ftape-vendors.h	\
+	fadvise.h fd.h fdreg.h fib_rules.h 				\
+	ftape-header-segment.h ftape-vendors.h				\
 	fuse.h futex.h genetlink.h gen_stats.h gigaset_dev.h hdsmart.h	\
-	hpfs_fs.h hysdn_if.h i2c-dev.h i8k.h icmp.h			\
+	hpfs_fs.h hysdn_if.h i2c-dev.h i8k.h icmp.h if_addr.h		\
 	if_arcnet.h if_arp.h if_bonding.h if_cablemodem.h if_fc.h	\
-	if_fddi.h if.h if_hippi.h if_infiniband.h if_packet.h		\
+	if_fddi.h if.h if_hippi.h if_infiniband.h if_link.h if_packet.h	\
 	if_plip.h if_ppp.h if_slip.h if_strip.h if_tunnel.h in6.h	\
 	in_route.h ioctl.h ip.h ipmi_msgdefs.h ip_mp_alg.h ipsec.h	\
 	ipx.h irda.h isdn_divertif.h iso_fs.h ite_gpio.h ixjuser.h	\
 	jffs2.h keyctl.h limits.h major.h matroxfb.h meye.h minix_fs.h	\
-	mmtimer.h mqueue.h mtio.h ncp_no.h netfilter_arp.h netrom.h	\
+	mmtimer.h mqueue.h mtio.h ncp_no.h neighbour.h			\
+	netfilter_arp.h netrom.h					\
 	nfs2.h nfs4_mount.h nfs_mount.h openprom_fs.h param.h		\
 	pci_ids.h pci_regs.h personality.h pfkeyv2.h pg.h pkt_cls.h	\
 	pkt_sched.h posix_types.h ppdev.h prctl.h ps2esdi.h qic117.h	\

---

Signature · 2 lines
YOSHIFUJI Hideaki @ USAGI Project  <[email protected]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
#1 lore raw

* YOSHIFUJI Hideaki / ?$B5HF#1QL@ <[email protected]> 2006-09-19 00:08

Quoted 5 lines

[NET]: Move netlink interface bits to linux/if_link.h.

Moving netlink interface bits to linux/if.h is rather troublesome for applications including both linux/if.h (which was changed to be included from linux/rtnetlink.h automatically) and net/if.h.

Agreed.

Quoted 11 lines

[NET]: Include new rtnetlink headers for userspace backward compatibility.

include/linux/rtnetlink.h +0 -0
index 3a18add..8ec375c 100644
@@ -2,7 +2,12 @@ #ifndef __LINUX_RTNETLINK_H
 #define __LINUX_RTNETLINK_H
 

include/linux/rtnetlink.h #ifndef __LINUX_RTNETLINK_H · line 13

Quoted 10 lines
include/linux/rtnetlink.h +5 -0
 #include <linux/netlink.h>
+#ifndef __KERNEL__
+/* Backward compatibility */
 #include <linux/if_link.h>
+#include <linux/if_addr.h>
+#include <linux/neighbour.h>
+#endif
 
 /****
  *		Routing/neighbour discovery messages.

Still acceptable but this gets ugly at some point. Applications using the interface should start making copies of the header version they use.

Quoted 7 lines

commit 55a08a9078b243a06223222735580df9e11a5fa6

Author: YOSHIFUJI Hideaki <[email protected]>
Date:   Sun Sep 17 13:55:02 2006 +0900

[NET]: Put {IFLA,IFA,NDA,NDTA}_{RTA,PAYLOAD}() macro back.

These macros are still used by userspace applications.

Same here, it doesn't make sense to export macros only of functional value and used by userspace only. The same issue will pop up once all users have been converted to use the new netlink interface. Keeping the old interface around just so userspace doesn't have to make copies doesn't make sense. I think it's better to start fixing userspace than to try and keep headers source compatible.

#2 lore raw

Hello.

In article <[email protected]> (at Mon, 18 Sep 2006 20:57:46 +0200), Thomas Graf <[email protected]> says:

Quoted 1 line

* YOSHIFUJI Hideaki <[email protected]> 2006-09-19 00:08

:

Quoted 1 line
Quoted 1 line

[NET]: Include new rtnetlink headers for userspace backward compatibility.

:

Quoted 15 lines
Quoted 15 lines
include/linux/rtnetlink.h +5 -0
index 3a18add..8ec375c 100644
@@ -2,7 +2,12 @@ #ifndef __LINUX_RTNETLINK_H
 #define __LINUX_RTNETLINK_H
 
 #include <linux/netlink.h>
+#ifndef __KERNEL__
+/* Backward compatibility */
 #include <linux/if_link.h>
+#include <linux/if_addr.h>
+#include <linux/neighbour.h>
+#endif
 
Quoted 6 lines

include/linux/rtnetlink.h #ifndef __LINUX_RTNETLINK_H · line 13

Quoted 2 lines
include/linux/rtnetlink.h +0 -0
 /****
  *		Routing/neighbour discovery messages.

Still acceptable but this gets ugly at some point. Applications using the interface should start making copies of the header version they use.

I understand, but I feel it is more ugly.

Quoted 6 lines
Quoted 6 lines

commit 55a08a9078b243a06223222735580df9e11a5fa6

Author: YOSHIFUJI Hideaki <[email protected]>
Date:   Sun Sep 17 13:55:02 2006 +0900
    [NET]: Put {IFLA,IFA,NDA,NDTA}_{RTA,PAYLOAD}() macro back.
Quoted 8 lines
Quoted 1 line

These macros are still used by userspace applications.

Same here, it doesn't make sense to export macros only of functional value and used by userspace only. The same issue will pop up once all users have been converted to use the new netlink interface. Keeping the old interface around just so userspace doesn't have to make copies doesn't make sense. I think it's better to start fixing userspace than to try and keep headers source compatible.

Backward compatibility is one of the most important factor. A careless breakage is, say, of "brain freeze."

About these macros, we have other similar *_{RTA,PAYLOAD}()s in kernel, which are not used by kernel but are exported to userspace. They are forming part of our API, and they're good example how to use netlink interface.

Yes, we could change the interface, but we definately need to give them graceful period at least; we can do it in 2.7, or at least, after 2-3 stable releases.

Regards,

Signature · 2 lines
YOSHIFUJI Hideaki @ USAGI Project  <[email protected]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
#3 lore raw

* YOSHIFUJI Hideaki / ?$B5HF#1QL@ <[email protected]> 2006-09-21 14:30

Quoted 10 lines

In article <[email protected]> (at Mon, 18 Sep 2006 20:57:46 +0200), Thomas Graf <[email protected]> says:

Quoted 6 lines

Same here, it doesn't make sense to export macros only of functional value and used by userspace only. The same issue will pop up once all users have been converted to use the new netlink interface. Keeping the old interface around just so userspace doesn't have to make copies doesn't make sense. I think it's better to start fixing userspace than to try and keep headers source compatible.

Backward compatibility is one of the most important factor. A careless breakage is, say, of "brain freeze."

This isn't about backward compatibility, it's about userspace applications not sticking to the policy of using kernel headers. Which applications will break? I'll fix them. The kernel is only required to provide binary backward compatibility.

Quoted 4 lines

About these macros, we have other similar *_{RTA,PAYLOAD}()s in kernel, which are not used by kernel but are exported to userspace. They are forming part of our API, and they're good example how to use netlink interface.

Actually they are miserable examples of how to use netlink, they only cover part of the interface required and lead to tons of duplicated code in every userspace application. F.e. the different semantics of simliar interfaces inside the kernel and libnetlink have lead to countless bugs.

Quoted 3 lines

Yes, we could change the interface, but we definately need to give them graceful period at least; we can do it in 2.7, or at least, after 2-3 stable releases.

Even thinking of 2.7 is not an option for me and I don't get the point in waiting 6 months before fixing userspace applications.

maintainer
#4 lore raw
In reply to YOSHIFUJI Hideaki / 吉藤英明

From: YOSHIFUJI Hideaki <[email protected]>
Date: Tue, 19 Sep 2006 00:08:00 +0900 (JST)

Quoted 8 lines

[XFRM]: Do not add a state whose SPI is zero to the SPI hash.

SPI=0 is used for acquired IPsec SA and MIPv6 RO state. Such state should not be added to the SPI hash because we do not care about it on deleting path.

Patch applied, thank you.

But the rest of these patches need more thought about these header file issues.

Quoted 7 lines

[NET]: Move netlink interface bits to linux/if_link.h.

Moving netlink interface bits to linux/if.h is rather troublesome for applications including both linux/if.h (which was changed to be included from linux/rtnetlink.h automatically) and net/if.h.

If it is illegal for user to include kernel's linux/if.h (by any means) if he uses net/if.h from userland headers, then he should also avoid including the kernel's rtnetlink.h header too.

I understand the issue, in that net/if.h defines macros that linux/if.h defines as well so there are conflicts (even though in the end the same exact values are used).

What I see happening is that the troublesome interfaces move from linux/if.h to a new file named linux/if_addr.h, then this gets included again to linux/rtnetlink.h but only for userspace with some messy ifdefs.

These kinds of things don't go away, they stay around forever once you decide to support them.

Actually, what I'm going to do is apply:

[NET]: Move netlink interface bits to linux/if_link.h. [NET] KBUILD: Add missing entries for new net headers.

And leave the rest for now.

Thank you.

#5 lore raw
Quoted 41 lines · On Wed, 27 Sep 2006 22:44:44 -0700 (PDT) David Miller <[email protected]>…

From: YOSHIFUJI Hideaki <[email protected]>
Date: Tue, 19 Sep 2006 00:08:00 +0900 (JST)

Quoted 8 lines

[XFRM]: Do not add a state whose SPI is zero to the SPI hash.

SPI=0 is used for acquired IPsec SA and MIPv6 RO state. Such state should not be added to the SPI hash because we do not care about it on deleting path.

Patch applied, thank you.

But the rest of these patches need more thought about these header file issues.

Quoted 7 lines

[NET]: Move netlink interface bits to linux/if_link.h.

Moving netlink interface bits to linux/if.h is rather troublesome for applications including both linux/if.h (which was changed to be included from linux/rtnetlink.h automatically) and net/if.h.

If it is illegal for user to include kernel's linux/if.h (by any means) if he uses net/if.h from userland headers, then he should also avoid including the kernel's rtnetlink.h header too.

I understand the issue, in that net/if.h defines macros that linux/if.h defines as well so there are conflicts (even though in the end the same exact values are used).

What I see happening is that the troublesome interfaces move from linux/if.h to a new file named linux/if_addr.h, then this gets included again to linux/rtnetlink.h but only for userspace with some messy ifdefs.

These kinds of things don't go away, they stay around forever once you decide to support them.

Quoted 7 lines

Actually, what I'm going to do is apply:

[NET]: Move netlink interface bits to linux/if_link.h. [NET] KBUILD: Add missing entries for new net headers.

And leave the rest for now.

Please figure out how to keep rtnetlink.h useful from user space. I tried putting the current sanitized version of rtnetlink.h into iproute2 and the build fails.

Signature · 1 line
Stephen Hemminger <[email protected]>
maintainer
#6 lore raw

From: Stephen Hemminger <[email protected]>
Date: Thu, 28 Sep 2006 08:36:45 -0700

Quoted 3 lines

Please figure out how to keep rtnetlink.h useful from user space. I tried putting the current sanitized version of rtnetlink.h into iproute2 and the build fails.

Please give the error so I have a chance of fixing this.

#7 lore raw
Quoted 8 lines · On Thu, 28 Sep 2006 14:33:04 -0700 (PDT) David Miller <[email protected]>…

From: Stephen Hemminger <[email protected]>
Date: Thu, 28 Sep 2006 08:36:45 -0700

Quoted 3 lines

Please figure out how to keep rtnetlink.h useful from user space. I tried putting the current sanitized version of rtnetlink.h into iproute2 and the build fails.

Please give the error so I have a chance of fixing this.

If I put 2.6.19 headers in:

In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

/usr/include/linux/if.h:117: error: redefinition of ‘struct ifmap’ /usr/include/linux/if.h:153: error: redefinition of ‘struct ifreq’ /usr/include/linux/if.h:203: error: redefinition of ‘struct ifconf’
ll_map.c: In function ‘ll_remember_index’:
ll_map.c:45: error: ‘IFLA_MAX’ undeclared (first use in this function)
ll_map.c:45: error: (Each undeclared identifier is reported only once
ll_map.c:45: error: for each function it appears in.)
ll_map.c:55: warning: implicit declaration of function ‘IFLA_RTA’
ll_map.c:55: warning: implicit declaration of function ‘IFLA_PAYLOAD’
ll_map.c:55: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ll_map.c:56: error: ‘IFLA_IFNAME’ undeclared (first use in this function)
ll_map.c:76: error: ‘IFLA_ADDRESS’ undeclared (first use in this function)
ll_map.c:45: warning: unused variable ‘tb’
make[1]: *** [ll_map.o] Error 1
utils.c: In function ‘inet_addr_match’:
utils.c:333: warning: initialization discards qualifiers from pointer target type utils.c:334: warning: initialization discards qualifiers from pointer target type make[1]: Target `all' not remade because of errors.
ipaddress.c: In function ‘print_linkinfo’:
ipaddress.c:135: error: ‘IFLA_MAX’ undeclared (first use in this function) ipaddress.c:135: error: (Each undeclared identifier is reported only once ipaddress.c:135: error: for each function it appears in.)
ipaddress.c:151: warning: implicit declaration of function ‘IFLA_RTA’
ipaddress.c:151: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ipaddress.c:152: error: ‘IFLA_IFNAME’ undeclared (first use in this function) ipaddress.c:167: error: ‘IFLA_LINK’ undeclared (first use in this function) ipaddress.c:182: error: ‘IFLA_MTU’ undeclared (first use in this function) ipaddress.c:184: error: ‘IFLA_QDISC’ undeclared (first use in this function) ipaddress.c:200: error: ‘IFLA_ADDRESS’ undeclared (first use in this function) ipaddress.c:206: error: ‘IFLA_BROADCAST’ undeclared (first use in this function) ipaddress.c:217: error: ‘IFLA_STATS’ undeclared (first use in this function) ipaddress.c:218: error: storage size of ‘slocal’ isn’t known
ipaddress.c:226: error: dereferencing pointer to incomplete type
ipaddress.c:228: error: dereferencing pointer to incomplete type
ipaddress.c:228: error: dereferencing pointer to incomplete type
ipaddress.c:228: error: dereferencing pointer to incomplete type
ipaddress.c:229: error: dereferencing pointer to incomplete type
ipaddress.c:229: error: dereferencing pointer to incomplete type
ipaddress.c:230: error: dereferencing pointer to incomplete type
ipaddress.c:232: error: dereferencing pointer to incomplete type
ipaddress.c:233: error: dereferencing pointer to incomplete type
ipaddress.c:238: error: dereferencing pointer to incomplete type
ipaddress.c:239: error: dereferencing pointer to incomplete type
ipaddress.c:240: error: dereferencing pointer to incomplete type
ipaddress.c:241: error: dereferencing pointer to incomplete type
ipaddress.c:242: error: dereferencing pointer to incomplete type
ipaddress.c:247: error: dereferencing pointer to incomplete type
ipaddress.c:249: error: dereferencing pointer to incomplete type
ipaddress.c:249: error: dereferencing pointer to incomplete type
ipaddress.c:249: error: dereferencing pointer to incomplete type
ipaddress.c:250: error: dereferencing pointer to incomplete type
ipaddress.c:250: error: dereferencing pointer to incomplete type
ipaddress.c:250: error: dereferencing pointer to incomplete type
ipaddress.c:251: error: dereferencing pointer to incomplete type
ipaddress.c:252: error: dereferencing pointer to incomplete type
ipaddress.c:257: error: dereferencing pointer to incomplete type
ipaddress.c:258: error: dereferencing pointer to incomplete type
ipaddress.c:259: error: dereferencing pointer to incomplete type
ipaddress.c:260: error: dereferencing pointer to incomplete type
ipaddress.c:218: warning: unused variable ‘slocal’
ipaddress.c:135: warning: unused variable ‘tb’
ipaddress.c: In function ‘print_addrinfo’:
ipaddress.c:285: error: ‘IFA_MAX’ undeclared (first use in this function) ipaddress.c:291: error: dereferencing pointer to incomplete type
ipaddress.c:300: warning: implicit declaration of function ‘IFA_RTA’
ipaddress.c:300: error: dereferencing pointer to incomplete type
ipaddress.c:300: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ipaddress.c:302: error: ‘IFA_LOCAL’ undeclared (first use in this function) ipaddress.c:303: error: ‘IFA_ADDRESS’ undeclared (first use in this function) ipaddress.c:307: error: dereferencing pointer to incomplete type
ipaddress.c:309: error: dereferencing pointer to incomplete type
ipaddress.c:311: error: dereferencing pointer to incomplete type
ipaddress.c:316: error: ‘IFA_LABEL’ undeclared (first use in this function) ipaddress.c:319: error: dereferencing pointer to incomplete type
ipaddress.c:327: error: dereferencing pointer to incomplete type
ipaddress.c:334: error: dereferencing pointer to incomplete type
ipaddress.c:358: error: dereferencing pointer to incomplete type
ipaddress.c:358: error: dereferencing pointer to incomplete type
ipaddress.c:359: error: dereferencing pointer to incomplete type
ipaddress.c:361: error: dereferencing pointer to incomplete type
ipaddress.c:363: error: dereferencing pointer to incomplete type
ipaddress.c:365: error: dereferencing pointer to incomplete type
ipaddress.c:368: error: dereferencing pointer to incomplete type
ipaddress.c:371: error: dereferencing pointer to incomplete type
ipaddress.c:378: error: dereferencing pointer to incomplete type
ipaddress.c:381: error: dereferencing pointer to incomplete type
ipaddress.c:385: error: dereferencing pointer to incomplete type
ipaddress.c:389: error: ‘IFA_BROADCAST’ undeclared (first use in this function) ipaddress.c:391: error: dereferencing pointer to incomplete type
ipaddress.c:396: error: ‘IFA_ANYCAST’ undeclared (first use in this function) ipaddress.c:398: error: dereferencing pointer to incomplete type
ipaddress.c:403: error: dereferencing pointer to incomplete type
ipaddress.c:404: error: dereferencing pointer to incomplete type
ipaddress.c:404: error: ‘IFA_F_SECONDARY’ undeclared (first use in this function) ipaddress.c:405: error: dereferencing pointer to incomplete type
ipaddress.c:408: error: dereferencing pointer to incomplete type
ipaddress.c:408: error: ‘IFA_F_TENTATIVE’ undeclared (first use in this function) ipaddress.c:409: error: dereferencing pointer to incomplete type
ipaddress.c:412: error: dereferencing pointer to incomplete type
ipaddress.c:412: error: ‘IFA_F_DEPRECATED’ undeclared (first use in this function) ipaddress.c:413: error: dereferencing pointer to incomplete type
ipaddress.c:416: error: dereferencing pointer to incomplete type
ipaddress.c:416: error: ‘IFA_F_PERMANENT’ undeclared (first use in this function) ipaddress.c:419: error: dereferencing pointer to incomplete type
ipaddress.c:420: error: dereferencing pointer to incomplete type
ipaddress.c:421: error: dereferencing pointer to incomplete type
ipaddress.c:424: error: ‘IFA_CACHEINFO’ undeclared (first use in this function) ipaddress.c:428: error: dereferencing pointer to incomplete type
ipaddress.c:431: error: dereferencing pointer to incomplete type
ipaddress.c:432: error: dereferencing pointer to incomplete type
ipaddress.c:435: error: dereferencing pointer to incomplete type
ipaddress.c:285: warning: unused variable ‘rta_tb’
ipaddress.c: In function ‘print_selected_addrinfo’:
ipaddress.c:462: error: dereferencing pointer to incomplete type
ipaddress.c:463: error: dereferencing pointer to incomplete type
ipaddress.c: In function ‘ipaddr_list_or_flush’:
ipaddress.c:538: error: ‘IFA_F_PERMANENT’ undeclared (first use in this function) ipaddress.c:544: error: ‘IFA_F_SECONDARY’ undeclared (first use in this function) ipaddress.c:550: error: ‘IFA_F_TENTATIVE’ undeclared (first use in this function) ipaddress.c:553: error: ‘IFA_F_DEPRECATED’ undeclared (first use in this function) ipaddress.c:655: error: dereferencing pointer to incomplete type
ipaddress.c:656: error: dereferencing pointer to incomplete type
ipaddress.c:658: error: dereferencing pointer to incomplete type
ipaddress.c:660: error: dereferencing pointer to incomplete type
ipaddress.c:663: error: ‘IFA_MAX’ undeclared (first use in this function) ipaddress.c:664: warning: implicit declaration of function ‘IFA_PAYLOAD’ ipaddress.c:664: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ipaddress.c:665: error: ‘IFA_LOCAL’ undeclared (first use in this function) ipaddress.c:666: error: ‘IFA_ADDRESS’ undeclared (first use in this function) ipaddress.c:671: error: dereferencing pointer to incomplete type
ipaddress.c:679: error: ‘IFA_LABEL’ undeclared (first use in this function) ipaddress.c:682: error: dereferencing pointer to incomplete type
ipaddress.c:663: warning: unused variable ‘tb’
ipaddress.c: In function ‘ipaddr_modify’:
ipaddress.c:738: error: field ‘ifa’ has incomplete type
ipaddress.c:754: error: invalid application of ‘sizeof’ to incomplete type ‘struct ifaddrmsg’ ipaddress.c:770: error: ‘IFA_ADDRESS’ undeclared (first use in this function) ipaddress.c:786: error: ‘IFA_BROADCAST’ undeclared (first use in this function) ipaddress.c:797: error: ‘IFA_ANYCAST’ undeclared (first use in this function) ipaddress.c:812: error: ‘IFA_LABEL’ undeclared (first use in this function) ipaddress.c:825: error: ‘IFA_LOCAL’ undeclared (first use in this function)
make[1]: *** [ipaddress.o] Error 1
In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from ipneigh.c:30:

/usr/include/linux/if.h:117: error: redefinition of ‘struct ifmap’ /usr/include/linux/if.h:153: error: redefinition of ‘struct ifreq’ /usr/include/linux/if.h:203: error: redefinition of ‘struct ifconf’
ipneigh.c: In function ‘nud_state_a2n’:
ipneigh.c:63: error: ‘NUD_PERMANENT’ undeclared (first use in this function) ipneigh.c:63: error: (Each undeclared identifier is reported only once
ipneigh.c:63: error: for each function it appears in.)
ipneigh.c:65: error: ‘NUD_REACHABLE’ undeclared (first use in this function) ipneigh.c:67: error: ‘NUD_NOARP’ undeclared (first use in this function)
ipneigh.c:69: error: ‘NUD_NONE’ undeclared (first use in this function)
ipneigh.c:71: error: ‘NUD_STALE’ undeclared (first use in this function)
ipneigh.c:73: error: ‘NUD_INCOMPLETE’ undeclared (first use in this function) ipneigh.c:75: error: ‘NUD_DELAY’ undeclared (first use in this function)
ipneigh.c:77: error: ‘NUD_PROBE’ undeclared (first use in this function)
ipneigh.c:79: error: ‘NUD_FAILED’ undeclared (first use in this function)
ipneigh.c: In function ‘ipneigh_modify’:
ipneigh.c:104: error: field ‘ndm’ has incomplete type
ipneigh.c:115: error: invalid application of ‘sizeof’ to incomplete type ‘struct ndmsg’ ipneigh.c:119: error: ‘NUD_PERMANENT’ undeclared (first use in this function) ipneigh.c:142: error: ‘NTF_PROXY’ undeclared (first use in this function) ipneigh.c:165: error: ‘NDA_DST’ undeclared (first use in this function)
ipneigh.c:172: error: ‘NDA_LLADDR’ undeclared (first use in this function)
ipneigh.c: In function ‘print_neigh’:
ipneigh.c:194: error: ‘NDA_MAX’ undeclared (first use in this function)
ipneigh.c:203: error: dereferencing pointer to incomplete type
ipneigh.c:212: error: dereferencing pointer to incomplete type
ipneigh.c:214: error: dereferencing pointer to incomplete type
ipneigh.c:216: error: dereferencing pointer to incomplete type
ipneigh.c:217: error: dereferencing pointer to incomplete type
ipneigh.c:218: error: dereferencing pointer to incomplete type
ipneigh.c:221: warning: implicit declaration of function ‘NDA_RTA’
ipneigh.c:221: error: dereferencing pointer to incomplete type
ipneigh.c:221: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ipneigh.c:223: error: ‘NDA_DST’ undeclared (first use in this function)
ipneigh.c:227: error: dereferencing pointer to incomplete type
ipneigh.c:233: error: ‘NDA_CACHEINFO’ undeclared (first use in this function) ipneigh.c:235: error: dereferencing pointer to incomplete type
ipneigh.c:258: error: dereferencing pointer to incomplete type
ipneigh.c:263: error: dereferencing pointer to incomplete type
ipneigh.c:264: error: dereferencing pointer to incomplete type
ipneigh.c:265: error: ‘NDA_LLADDR’ undeclared (first use in this function) ipneigh.c:269: error: dereferencing pointer to incomplete type
ipneigh.c:272: error: dereferencing pointer to incomplete type
ipneigh.c:272: error: ‘NTF_ROUTER’ undeclared (first use in this function) ipneigh.c:280: error: dereferencing pointer to incomplete type
ipneigh.c:281: error: dereferencing pointer to incomplete type
ipneigh.c:282: error: dereferencing pointer to incomplete type
ipneigh.c:283: error: dereferencing pointer to incomplete type
ipneigh.c:283: error: dereferencing pointer to incomplete type
ipneigh.c:293: error: dereferencing pointer to incomplete type
ipneigh.c:294: error: dereferencing pointer to incomplete type
ipneigh.c:299: error: ‘NUD_INCOMPLETE’ undeclared (first use in this function) ipneigh.c:300: error: ‘NUD_REACHABLE’ undeclared (first use in this function) ipneigh.c:301: error: ‘NUD_STALE’ undeclared (first use in this function) ipneigh.c:302: error: ‘NUD_DELAY’ undeclared (first use in this function) ipneigh.c:303: error: ‘NUD_PROBE’ undeclared (first use in this function) ipneigh.c:304: error: ‘NUD_FAILED’ undeclared (first use in this function) ipneigh.c:305: error: ‘NUD_NOARP’ undeclared (first use in this function) ipneigh.c:306: error: ‘NUD_PERMANENT’ undeclared (first use in this function) ipneigh.c:194: warning: unused variable ‘tb’
ipneigh.c: In function ‘do_show_or_flush’:
ipneigh.c:336: error: ‘NUD_PERMANENT’ undeclared (first use in this function) ipneigh.c:336: error: ‘NUD_NOARP’ undeclared (first use in this function) ipneigh.c:394: error: ‘NUD_FAILED’ undeclared (first use in this function)
make[1]: *** [ipneigh.o] Error 1
ipntable.c: In function ‘ipntable_modify’:
ipntable.c:67: error: field ‘ndtm’ has incomplete type
ipntable.c:79: error: invalid application of ‘sizeof’ to incomplete type ‘struct ndtmsg’ ipntable.c:89: error: ‘NDTA_PARMS’ undeclared (first use in this function) ipntable.c:89: error: (Each undeclared identifier is reported only once
ipntable.c:89: error: for each function it appears in.)
ipntable.c:102: error: ‘NDTA_NAME’ undeclared (first use in this function) ipntable.c:112: error: ‘NDTA_THRESH1’ undeclared (first use in this function) ipntable.c:122: error: ‘NDTA_THRESH2’ undeclared (first use in this function) ipntable.c:132: error: ‘NDTA_THRESH3’ undeclared (first use in this function) ipntable.c:142: error: ‘NDTA_GC_INTERVAL’ undeclared (first use in this function) ipntable.c:155: error: ‘NDTPA_IFINDEX’ undeclared (first use in this function) ipntable.c:165: error: ‘NDTPA_BASE_REACHABLE_TIME’ undeclared (first use in this function) ipntable.c:177: error: ‘NDTPA_RETRANS_TIME’ undeclared (first use in this function) ipntable.c:189: error: ‘NDTPA_GC_STALETIME’ undeclared (first use in this function) ipntable.c:201: error: ‘NDTPA_DELAY_PROBE_TIME’ undeclared (first use in this function) ipntable.c:215: error: ‘NDTPA_QUEUE_LEN’ undeclared (first use in this function) ipntable.c:226: error: ‘NDTPA_APP_PROBES’ undeclared (first use in this function) ipntable.c:237: error: ‘NDTPA_UCAST_PROBES’ undeclared (first use in this function) ipntable.c:248: error: ‘NDTPA_MCAST_PROBES’ undeclared (first use in this function) ipntable.c:259: error: ‘NDTPA_ANYCAST_DELAY’ undeclared (first use in this function) ipntable.c:271: error: ‘NDTPA_PROXY_DELAY’ undeclared (first use in this function) ipntable.c:283: error: ‘NDTPA_PROXY_QLEN’ undeclared (first use in this function) ipntable.c:294: error: ‘NDTPA_LOCKTIME’ undeclared (first use in this function) ipntable.c: In function ‘print_ntable’:
ipntable.c:357: error: ‘NDTA_MAX’ undeclared (first use in this function) ipntable.c:358: error: ‘NDTPA_MAX’ undeclared (first use in this function) ipntable.c:366: error: dereferencing pointer to incomplete type
ipntable.c:372: error: dereferencing pointer to incomplete type
ipntable.c:375: warning: implicit declaration of function ‘NDTA_RTA’
ipntable.c:376: error: dereferencing pointer to incomplete type
ipntable.c:376: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ipntable.c:378: error: ‘NDTA_NAME’ undeclared (first use in this function) ipntable.c:384: error: ‘NDTA_PARMS’ undeclared (first use in this function) ipntable.c:388: error: ‘NDTPA_IFINDEX’ undeclared (first use in this function) ipntable.c:399: error: dereferencing pointer to incomplete type
ipntable.c:401: error: dereferencing pointer to incomplete type
ipntable.c:403: error: dereferencing pointer to incomplete type
ipntable.c:406: error: dereferencing pointer to incomplete type
ipntable.c:415: error: ‘NDTA_THRESH1’ undeclared (first use in this function) ipntable.c:415: error: ‘NDTA_THRESH2’ undeclared (first use in this function) ipntable.c:415: error: ‘NDTA_THRESH3’ undeclared (first use in this function) ipntable.c:416: error: ‘NDTA_GC_INTERVAL’ undeclared (first use in this function) ipntable.c:440: error: ‘NDTA_CONFIG’ undeclared (first use in this function) ipntable.c:446: error: dereferencing pointer to incomplete type
ipntable.c:447: error: dereferencing pointer to incomplete type
ipntable.c:448: error: dereferencing pointer to incomplete type
ipntable.c:454: error: dereferencing pointer to incomplete type
ipntable.c:456: error: dereferencing pointer to incomplete type
ipntable.c:461: error: dereferencing pointer to incomplete type
ipntable.c:462: error: dereferencing pointer to incomplete type
ipntable.c:464: error: dereferencing pointer to incomplete type
ipntable.c:465: error: dereferencing pointer to incomplete type
ipntable.c:481: error: ‘NDTPA_REFCNT’ undeclared (first use in this function) ipntable.c:485: error: ‘NDTPA_REACHABLE_TIME’ undeclared (first use in this function) ipntable.c:489: error: ‘NDTPA_BASE_REACHABLE_TIME’ undeclared (first use in this function) ipntable.c:493: error: ‘NDTPA_RETRANS_TIME’ undeclared (first use in this function) ipntable.c:502: error: ‘NDTPA_GC_STALETIME’ undeclared (first use in this function) ipntable.c:506: error: ‘NDTPA_DELAY_PROBE_TIME’ undeclared (first use in this function) ipntable.c:510: error: ‘NDTPA_QUEUE_LEN’ undeclared (first use in this function) ipntable.c:519: error: ‘NDTPA_APP_PROBES’ undeclared (first use in this function) ipntable.c:523: error: ‘NDTPA_UCAST_PROBES’ undeclared (first use in this function) ipntable.c:527: error: ‘NDTPA_MCAST_PROBES’ undeclared (first use in this function) ipntable.c:536: error: ‘NDTPA_ANYCAST_DELAY’ undeclared (first use in this function) ipntable.c:540: error: ‘NDTPA_PROXY_DELAY’ undeclared (first use in this function) ipntable.c:544: error: ‘NDTPA_PROXY_QLEN’ undeclared (first use in this function) ipntable.c:548: error: ‘NDTPA_LOCKTIME’ undeclared (first use in this function) ipntable.c:556: error: ‘NDTA_STATS’ undeclared (first use in this function) ipntable.c:562: error: dereferencing pointer to incomplete type
ipntable.c:563: error: dereferencing pointer to incomplete type
ipntable.c:564: error: dereferencing pointer to incomplete type
ipntable.c:569: error: dereferencing pointer to incomplete type
ipntable.c:570: error: dereferencing pointer to incomplete type
ipntable.c:571: error: dereferencing pointer to incomplete type
ipntable.c:576: error: dereferencing pointer to incomplete type
ipntable.c:577: error: dereferencing pointer to incomplete type
ipntable.c:582: error: dereferencing pointer to incomplete type
ipntable.c:583: error: dereferencing pointer to incomplete type
ipntable.c:358: warning: unused variable ‘tpb’
ipntable.c:357: warning: unused variable ‘tb’
make[1]: *** [ipntable.o] Error 1
In file included from ../include/linux/rtnetlink.h:5,

                 from ipxfrm.c:37:

/usr/include/linux/if.h:117: error: redefinition of ‘struct ifmap’ /usr/include/linux/if.h:153: error: redefinition of ‘struct ifreq’ /usr/include/linux/if.h:203: error: redefinition of ‘struct ifconf’ make[1]: *** [ipxfrm.o] Error 1
make[1]: *** No rule to make target ../lib/libnetlink.a', needed by ip'. In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from rtmon.c:26:

/usr/include/linux/if.h:117: error: redefinition of ‘struct ifmap’ /usr/include/linux/if.h:153: error: redefinition of ‘struct ifreq’ /usr/include/linux/if.h:203: error: redefinition of ‘struct ifconf’ make[1]: *** [rtmon.o] Error 1
make[1]: Target `all' not remade because of errors.
In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

/usr/include/linux/if.h:117: error: redefinition of ‘struct ifmap’ /usr/include/linux/if.h:153: error: redefinition of ‘struct ifreq’ /usr/include/linux/if.h:203: error: redefinition of ‘struct ifconf’ make[1]: *** [tc_filter.o] Error 1
In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from m_ipt.c:22:

/usr/include/linux/if.h:117: error: redefinition of ‘struct ifmap’ /usr/include/linux/if.h:153: error: redefinition of ‘struct ifreq’ /usr/include/linux/if.h:203: error: redefinition of ‘struct ifconf’
make[1]: *** [m_ipt.o] Error 1
make[1]: *** No rule to make target ../lib/libnetlink.a', needed by tc'.
make[1]: Target `all' not remade because of errors.
ssfilter.y: conflicts: 27 shift/reduce
/usr/bin/ld: cannot find -lnetlink
collect2: ld returned 1 exit status
make[1]: *** [ss] Error 1
gcc: ../lib/libnetlink.a: No such file or directory
ifstat.c: In function ‘get_nlmsg’:
ifstat.c:84: error: ‘IFLA_MAX’ undeclared (first use in this function)
ifstat.c:84: error: (Each undeclared identifier is reported only once
ifstat.c:84: error: for each function it appears in.)
ifstat.c:99: warning: implicit declaration of function ‘IFLA_RTA’
ifstat.c:99: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ifstat.c:100: error: ‘IFLA_IFNAME’ undeclared (first use in this function) ifstat.c:100: error: ‘IFLA_STATS’ undeclared (first use in this function) ifstat.c:84: warning: unused variable ‘tb’
make[1]: *** [ifstat] Error 1
gcc: ../lib/libnetlink.a: No such file or directory
make[1]: *** [rtacct] Error 1
gcc: ../lib/libnetlink.a: No such file or directory
arpd.c: In function ‘respond_to_kernel’:
arpd.c:267: error: field ‘ndm’ has incomplete type
arpd.c:274: error: invalid application of ‘sizeof’ to incomplete type ‘struct ndmsg’ arpd.c:278: error: ‘NUD_STALE’ undeclared (first use in this function)
arpd.c:278: error: (Each undeclared identifier is reported only once
arpd.c:278: error: for each function it appears in.)
arpd.c:282: error: ‘NDA_DST’ undeclared (first use in this function)
arpd.c:283: error: ‘NDA_LLADDR’ undeclared (first use in this function)
arpd.c: In function ‘do_one_request’:
arpd.c:302: error: ‘NDA_MAX’ undeclared (first use in this function)
arpd.c:320: error: dereferencing pointer to incomplete type
arpd.c:324: error: dereferencing pointer to incomplete type
arpd.c:325: error: dereferencing pointer to incomplete type
arpd.c:326: error: dereferencing pointer to incomplete type
arpd.c:327: error: dereferencing pointer to incomplete type
arpd.c:328: error: dereferencing pointer to incomplete type
arpd.c:328: error: ‘NUD_NOARP’ undeclared (first use in this function)
arpd.c:331: warning: implicit declaration of function ‘NDA_RTA’
arpd.c:331: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast arpd.c:333: error: ‘NDA_DST’ undeclared (first use in this function)
arpd.c:336: error: dereferencing pointer to incomplete type
arpd.c:350: error: dereferencing pointer to incomplete type
arpd.c:350: error: ‘NUD_PROBE’ undeclared (first use in this function)
arpd.c:350: error: ‘NUD_INCOMPLETE’ undeclared (first use in this function) arpd.c:355: error: dereferencing pointer to incomplete type
arpd.c:388: error: dereferencing pointer to incomplete type
arpd.c:397: error: dereferencing pointer to incomplete type
arpd.c:397: error: ‘NUD_FAILED’ undeclared (first use in this function)
arpd.c:411: error: ‘NDA_LLADDR’ undeclared (first use in this function)
arpd.c:302: warning: unused variable ‘tb’
m

maintainer
#8 lore raw

From: Stephen Hemminger <[email protected]>
Date: Thu, 28 Sep 2006 15:50:52 -0700

Quoted 15 lines
Quoted 8 lines · On Thu, 28 Sep 2006 14:33:04 -0700 (PDT) David Miller <[email protected]>…

From: Stephen Hemminger <[email protected]>
Date: Thu, 28 Sep 2006 08:36:45 -0700

Quoted 3 lines

Please figure out how to keep rtnetlink.h useful from user space. I tried putting the current sanitized version of rtnetlink.h into iproute2 and the build fails.

Please give the error so I have a chance of fixing this.

If I put 2.6.19 headers in:

Quoted 6 lines

In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

/usr/include/linux/if.h:117: error: redefinition of $,1rx(Bstruct ifmap$,1ry(B /usr/include/linux/if.h:153: error: redefinition of $,1rx(Bstruct ifreq$,1ry(B /usr/include/linux/if.h:203: error: redefinition of $,1rx(Bstruct ifconf$,1ry(B

Hmmm... we explicitly removed the "linux/if.h" inclusion from rtnetlink.h so this is weird. Where is the linux/if.h include coming from?

#9 lore raw
Quoted 25 lines · On Thu, 28 Sep 2006 16:04:58 -0700 (PDT) David Miller <[email protected]>…

From: Stephen Hemminger <[email protected]>
Date: Thu, 28 Sep 2006 15:50:52 -0700

Quoted 15 lines
Quoted 8 lines · On Thu, 28 Sep 2006 14:33:04 -0700 (PDT) David Miller <[email protected]>…

From: Stephen Hemminger <[email protected]>
Date: Thu, 28 Sep 2006 08:36:45 -0700

Quoted 3 lines

Please figure out how to keep rtnetlink.h useful from user space. I tried putting the current sanitized version of rtnetlink.h into iproute2 and the build fails.

Please give the error so I have a chance of fixing this.

If I put 2.6.19 headers in:

Quoted 6 lines

In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

/usr/include/linux/if.h:117: error: redefinition of $,1rxstruct ifmap$,1ry /usr/include/linux/if.h:153: error: redefinition of $,1rxstruct ifreq$,1ry /usr/include/linux/if.h:203: error: redefinition of $,1rxstruct ifconf$,1ry

Quoted 4 lines

Hmmm... we explicitly removed the "linux/if.h" inclusion from rtnetlink.h so this is weird. Where is the linux/if.h include coming from?

It got added by this:

commit 0844565fb8a9418f5a860aa480c1aef70319c9a2

Author: Thomas Graf <[email protected]>
Date:   Fri Aug 4 23:05:56 2006 -0700

[NET]: Move netlink interface bits to linux/if.h

include/linux/rtnetlink.h +1 -0
index 890c4d4..84f3eb4 100644
@@ -2,6 +2,7 @@ #ifndef __LINUX_RTNETLINK_H
 #define __LINUX_RTNETLINK_H
 
 #include <linux/netlink.h>
+#include <linux/if.h>
 
 /****
  *		Routing/neighbour discovery messages.

Note: if I put a santized version if linux/if.h in the iproute2, then it gets more errors as well:

In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:26:1: warning: "IFNAMSIZ" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:130:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:30:1: warning: "IFF_UP" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:46:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:31:1: warning: "IFF_BROADCAST" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:48:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:32:1: warning: "IFF_DEBUG" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:50:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:33:1: warning: "IFF_LOOPBACK" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:52:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:34:1: warning: "IFF_POINTOPOINT" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:54:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:35:1: warning: "IFF_NOTRAILERS" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:56:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:36:1: warning: "IFF_RUNNING" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:58:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:37:1: warning: "IFF_NOARP" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:60:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:38:1: warning: "IFF_PROMISC" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:62:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:39:1: warning: "IFF_ALLMULTI" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:66:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:41:1: warning: "IFF_MASTER" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:69:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:42:1: warning: "IFF_SLAVE" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:71:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:44:1: warning: "IFF_MULTICAST" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:74:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:46:1: warning: "IFF_PORTSEL" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:77:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:47:1: warning: "IFF_AUTOMEDIA" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:79:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:48:1: warning: "IFF_DYNAMIC" redefined
In file included from ll_map.c:20:
/usr/include/net/if.h:81:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ll_map.c:23:

../include/linux/if.h:120: error: redefinition of ‘struct ifmap’ ../include/linux/if.h:156: error: redefinition of ‘struct ifreq’ ../include/linux/if.h:206: error: redefinition of ‘struct ifconf’
ll_map.c: In function ‘ll_remember_index’:
ll_map.c:55: warning: implicit declaration of function ‘IFLA_RTA’
ll_map.c:55: warning: implicit declaration of function ‘IFLA_PAYLOAD’
ll_map.c:55: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast make[1]: *** [ll_map.o] Error 1
ipaddress.c: In function ‘print_linkinfo’:
ipaddress.c:151: warning: implicit declaration of function ‘IFLA_RTA’
ipaddress.c:151: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ipaddress.c: In function ‘print_addrinfo’:
ipaddress.c:285: error: ‘IFA_MAX’ undeclared (first use in this function) ipaddress.c:285: error: (Each undeclared identifier is reported only once ipaddress.c:285: error: for each function it appears in.)
ipaddress.c:291: error: dereferencing pointer to incomplete type
ipaddress.c:300: warning: implicit declaration of function ‘IFA_RTA’
ipaddress.c:300: error: dereferencing pointer to incomplete type
ipaddress.c:300: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ipaddress.c:302: error: ‘IFA_LOCAL’ undeclared (first use in this function) ipaddress.c:303: error: ‘IFA_ADDRESS’ undeclared (first use in this function) ipaddress.c:307: error: dereferencing pointer to incomplete type
ipaddress.c:309: error: dereferencing pointer to incomplete type
ipaddress.c:311: error: dereferencing pointer to incomplete type
ipaddress.c:316: error: ‘IFA_LABEL’ undeclared (first use in this function) ipaddress.c:319: error: dereferencing pointer to incomplete type
ipaddress.c:327: error: dereferencing pointer to incomplete type
ipaddress.c:334: error: dereferencing pointer to incomplete type
ipaddress.c:358: error: dereferencing pointer to incomplete type
ipaddress.c:358: error: dereferencing pointer to incomplete type
ipaddress.c:359: error: dereferencing pointer to incomplete type
ipaddress.c:361: error: dereferencing pointer to incomplete type
ipaddress.c:363: error: dereferencing pointer to incomplete type
ipaddress.c:365: error: dereferencing pointer to incomplete type
ipaddress.c:368: error: dereferencing pointer to incomplete type
ipaddress.c:371: error: dereferencing pointer to incomplete type
ipaddress.c:378: error: dereferencing pointer to incomplete type
ipaddress.c:381: error: dereferencing pointer to incomplete type
ipaddress.c:385: error: dereferencing pointer to incomplete type
ipaddress.c:389: error: ‘IFA_BROADCAST’ undeclared (first use in this function) ipaddress.c:391: error: dereferencing pointer to incomplete type
ipaddress.c:396: error: ‘IFA_ANYCAST’ undeclared (first use in this function) ipaddress.c:398: error: dereferencing pointer to incomplete type
ipaddress.c:403: error: dereferencing pointer to incomplete type
ipaddress.c:404: error: dereferencing pointer to incomplete type
ipaddress.c:404: error: ‘IFA_F_SECONDARY’ undeclared (first use in this function) ipaddress.c:405: error: dereferencing pointer to incomplete type
ipaddress.c:408: error: dereferencing pointer to incomplete type
ipaddress.c:408: error: ‘IFA_F_TENTATIVE’ undeclared (first use in this function) ipaddress.c:409: error: dereferencing pointer to incomplete type
ipaddress.c:412: error: dereferencing pointer to incomplete type
ipaddress.c:412: error: ‘IFA_F_DEPRECATED’ undeclared (first use in this function) ipaddress.c:413: error: dereferencing pointer to incomplete type
ipaddress.c:416: error: dereferencing pointer to incomplete type
ipaddress.c:416: error: ‘IFA_F_PERMANENT’ undeclared (first use in this function) ipaddress.c:419: error: dereferencing pointer to incomplete type
ipaddress.c:420: error: dereferencing pointer to incomplete type
ipaddress.c:421: error: dereferencing pointer to incomplete type
ipaddress.c:424: error: ‘IFA_CACHEINFO’ undeclared (first use in this function) ipaddress.c:428: error: dereferencing pointer to incomplete type
ipaddress.c:431: error: dereferencing pointer to incomplete type
ipaddress.c:432: error: dereferencing pointer to incomplete type
ipaddress.c:435: error: dereferencing pointer to incomplete type
ipaddress.c:285: warning: unused variable ‘rta_tb’
ipaddress.c: In function ‘print_selected_addrinfo’:
ipaddress.c:462: error: dereferencing pointer to incomplete type
ipaddress.c:463: error: dereferencing pointer to incomplete type
ipaddress.c: In function ‘ipaddr_list_or_flush’:
ipaddress.c:538: error: ‘IFA_F_PERMANENT’ undeclared (first use in this function) ipaddress.c:544: error: ‘IFA_F_SECONDARY’ undeclared (first use in this function) ipaddress.c:550: error: ‘IFA_F_TENTATIVE’ undeclared (first use in this function) ipaddress.c:553: error: ‘IFA_F_DEPRECATED’ undeclared (first use in this function) ipaddress.c:655: error: dereferencing pointer to incomplete type
ipaddress.c:656: error: dereferencing pointer to incomplete type
ipaddress.c:658: error: dereferencing pointer to incomplete type
ipaddress.c:660: error: dereferencing pointer to incomplete type
ipaddress.c:663: error: ‘IFA_MAX’ undeclared (first use in this function) ipaddress.c:664: warning: implicit declaration of function ‘IFA_PAYLOAD’ ipaddress.c:664: warning: passing argument 3 of ‘parse_rtattr’ makes pointer from integer without a cast ipaddress.c:665: error: ‘IFA_LOCAL’ undeclared (first use in this function) ipaddress.c:666: error: ‘IFA_ADDRESS’ undeclared (first use in this function) ipaddress.c:671: error: dereferencing pointer to incomplete type
ipaddress.c:679: error: ‘IFA_LABEL’ undeclared (first use in this function) ipaddress.c:682: error: dereferencing pointer to incomplete type
ipaddress.c:663: warning: unused variable ‘tb’
ipaddress.c: In function ‘ipaddr_modify’:
ipaddress.c:738: error: field ‘ifa’ has incomplete type
ipaddress.c:754: error: invalid application of ‘sizeof’ to incomplete type ‘struct ifaddrmsg’ ipaddress.c:770: error: ‘IFA_ADDRESS’ undeclared (first use in this function) ipaddress.c:786: error: ‘IFA_BROADCAST’ undeclared (first use in this function) ipaddress.c:797: error: ‘IFA_ANYCAST’ undeclared (first use in this function) ipaddress.c:812: error: ‘IFA_LABEL’ undeclared (first use in this function) ipaddress.c:825: error: ‘IFA_LOCAL’ undeclared (first use in this function)
make[1]: *** [ipaddress.o] Error 1
In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:26:1: warning: "IFNAMSIZ" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:130:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:30:1: warning: "IFF_UP" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:46:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:31:1: warning: "IFF_BROADCAST" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:48:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:32:1: warning: "IFF_DEBUG" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:50:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:33:1: warning: "IFF_LOOPBACK" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:52:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:34:1: warning: "IFF_POINTOPOINT" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:54:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:35:1: warning: "IFF_NOTRAILERS" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:56:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:36:1: warning: "IFF_RUNNING" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:58:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:37:1: warning: "IFF_NOARP" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:60:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:38:1: warning: "IFF_PROMISC" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:62:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:39:1: warning: "IFF_ALLMULTI" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:66:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:41:1: warning: "IFF_MASTER" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:69:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:42:1: warning: "IFF_SLAVE" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:71:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:44:1: warning: "IFF_MULTICAST" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:74:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:46:1: warning: "IFF_PORTSEL" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:77:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:47:1: warning: "IFF_AUTOMEDIA" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:79:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:48:1: warning: "IFF_DYNAMIC" redefined
In file included from tc_filter.c:18:
/usr/include/net/if.h:81:1: warning: this is the location of the previous definition In file included from ../include/linux/rtnetlink.h:5,

                 from ../include/libnetlink.h:6,
                 from ../include/utils.h:7,
                 from tc_filter.c:27:

../include/linux/if.h:120: error: redefinition of ‘struct ifmap’ ../include/linux/if.h:156: error: redefinition of ‘struct ifreq’ ../include/linux/if.h:206: error: redefinition of ‘struct ifconf’ make[1]: *** [tc_filter.o] Error 1
/usr/bin/ld: cannot find -lnetlink
collect2: ld returned 1 exit status
make[1]: *** [ss] Error 1
make[1]: *** No rule to make target ../lib/libnetlink.a', needed by genl'. Stop.
make: *** [all] Error 2

Signature · 1 line
Stephen Hemminger <[email protected]>
maintainer
#10 lore raw

From: Stephen Hemminger <[email protected]>
Date: Thu, 28 Sep 2006 16:27:04 -0700

Quoted 10 lines

It got added by this:

commit 0844565fb8a9418f5a860aa480c1aef70319c9a2

Author: Thomas Graf <[email protected]>
Date:   Fri Aug 4 23:05:56 2006 -0700

[NET]: Move netlink interface bits to linux/if.h

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.

#11 lore raw
Quoted 13 lines · David Miller
Quoted 8 lines

commit 0844565fb8a9418f5a860aa480c1aef70319c9a2

Author: Thomas Graf <[email protected]>
Date:   Fri Aug 4 23:05:56 2006 -0700

[NET]: Move netlink interface bits to linux/if.h

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.

Quoted 7 lines

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.

Regards,

Signature · 1 line
Masahide NAKAMURA
#12 lore raw

PATCH 1/1 Add missing macros which was removed from kernel header. (Re: [GIT PATCH] NET: Fixes for net-2.6.19)

Quoted 18 lines
Quoted 17 lines · David Miller
Quoted 8 lines

commit 0844565fb8a9418f5a860aa480c1aef70319c9a2

Author: Thomas Graf <[email protected]>
Date:   Fri Aug 4 23:05:56 2006 -0700

[NET]: Move netlink interface bits to linux/if.h

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

Quoted 8 lines
Quoted 3 lines

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.

---
 include/libnetlink.h |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
include/libnetlink.h +35 -0
index 63cc3c8..9de3a0b 100644
@@ -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__ */
 
Signature · 7 lines
1.4.2




-- 
Masahide NAKAMURA
#13 lore raw

Re: [IPROUTE2][PATCH] Add missing macros which was removed from kernel header. (Re: [GIT PATCH] NET: Fixes for net-2.6.19)

I applied a combined patch to fix all the headers to iproute2 (for the future
2.6.19 based release).

Signature · 1 line
Stephen Hemminger <[email protected]>
#14 lore raw
In reply to Masahide NAKAMURA
Quoted 22 lines · On Fri, 29 Sep 2006 10:59:45 +0900 Masahide NAKAMURA <[email protected]>…
Quoted 13 lines · David Miller
Quoted 8 lines

commit 0844565fb8a9418f5a860aa480c1aef70319c9a2

Author: Thomas Graf <[email protected]>
Date:   Fri Aug 4 23:05:56 2006 -0700

[NET]: Move netlink interface bits to linux/if.h

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.

Quoted 7 lines

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.

Quoted 7 lines

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.

Regards,

Since the rtnetlink changes for 2.6.19, broke the GLIBC build, I am going to wait until that gets straightened out first.

Signature · 1 line
Stephen Hemminger <[email protected]>