Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-10-09 Thread Stephen Hemminger
On Fri, 29 Sep 2006 10:59:45 +0900
Masahide NAKAMURA <[EMAIL PROTECTED]> wrote:

> David Miller wrote:
> >> 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
> >> 
> >> Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
> >> Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
> > 
> > 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.
> 
> Regards,
> 

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

-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2006-10-05 Thread Stephen Hemminger
I applied a combined patch to fix all the headers to iproute2 (for the future
 2.6.19 based release).

-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2006-09-30 Thread Masahide NAKAMURA
> David Miller wrote:
> >> 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
> >> 
> >> Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
> >> Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
> > 
> > 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 <[EMAIL PROTECTED]>
---
 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 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-28 Thread Masahide NAKAMURA
David Miller wrote:
>> 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
>> 
>> Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
>> Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
> 
> 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.

Regards,

-- 
Masahide NAKAMURA
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-28 Thread David Miller
From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Thu, 28 Sep 2006 16:27:04 -0700

> 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
> 
> Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
> Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

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.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-28 Thread Stephen Hemminger
On Thu, 28 Sep 2006 16:04:58 -0700 (PDT)
David Miller <[EMAIL PROTECTED]> wrote:

> From: Stephen Hemminger <[EMAIL PROTECTED]>
> Date: Thu, 28 Sep 2006 15:50:52 -0700
> 
> > On Thu, 28 Sep 2006 14:33:04 -0700 (PDT)
> > David Miller <[EMAIL PROTECTED]> wrote:
> > 
> > > From: Stephen Hemminger <[EMAIL PROTECTED]>
> > > Date: Thu, 28 Sep 2006 08:36:45 -0700
> > > 
> > > > 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 $,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
> 
> 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

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 890c4d4..84f3eb4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -2,6 +2,7 @@ #ifndef __LINUX_RTNETLINK_H
 #define __LINUX_RTNETLINK_H
 
 #include 
+#include 
 
 /
  * 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:

Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-28 Thread David Miller
From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Thu, 28 Sep 2006 15:50:52 -0700

> On Thu, 28 Sep 2006 14:33:04 -0700 (PDT)
> David Miller <[EMAIL PROTECTED]> wrote:
> 
> > From: Stephen Hemminger <[EMAIL PROTECTED]>
> > Date: Thu, 28 Sep 2006 08:36:45 -0700
> > 
> > > 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 $,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?

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-28 Thread Stephen Hemminger
On Thu, 28 Sep 2006 14:33:04 -0700 (PDT)
David Miller <[EMAIL PROTECTED]> wrote:

> From: Stephen Hemminger <[EMAIL PROTECTED]>
> Date: Thu, 28 Sep 2006 08:36:45 -0700
> 
> > 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’ 

Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-28 Thread David Miller
From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Thu, 28 Sep 2006 08:36:45 -0700

> 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.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-28 Thread Stephen Hemminger
On Wed, 27 Sep 2006 22:44:44 -0700 (PDT)
David Miller <[EMAIL PROTECTED]> wrote:

> From: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
> Date: Tue, 19 Sep 2006 00:08:00 +0900 (JST)
> 
> > [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.
> > 
> > Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
> > Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
> 
> Patch applied, thank you.
> 
> But the rest of these patches need more thought about these header
> file issues.
> 
> > [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.
> > 
> > Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
> 
> 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.
> 

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. 

-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-27 Thread David Miller
From: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
Date: Tue, 19 Sep 2006 00:08:00 +0900 (JST)

> [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.
> 
> Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
> Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

Patch applied, thank you.

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

> [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.
> 
> Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

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.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-21 Thread Thomas Graf
* YOSHIFUJI Hideaki / ?$B5HF#1QL@ <[EMAIL PROTECTED]> 2006-09-21 14:30
> In article <[EMAIL PROTECTED]> (at Mon, 18 Sep 2006 20:57:46 +0200), Thomas 
> Graf <[EMAIL PROTECTED]> says:
> > 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.

> 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.

> 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.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-20 Thread YOSHIFUJI Hideaki / 吉藤英明
Hello.

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

> * YOSHIFUJI Hideaki <[EMAIL PROTECTED]> 2006-09-19 00:08
:
> > [NET]: Include new rtnetlink headers for userspace backward 
> > compatibility.
:
> > diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
> > index 3a18add..8ec375c 100644
> > --- a/include/linux/rtnetlink.h
> > +++ b/include/linux/rtnetlink.h
> > @@ -2,7 +2,12 @@ #ifndef __LINUX_RTNETLINK_H
> >  #define __LINUX_RTNETLINK_H
> >  
> >  #include 
> > +#ifndef __KERNEL__
> > +/* Backward compatibility */
> >  #include 
> > +#include 
> > +#include 
> > +#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.

I understand, but I feel it is more ugly.

> > 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.

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,

-- 
YOSHIFUJI Hideaki @ USAGI Project  <[EMAIL PROTECTED]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PATCH] NET: Fixes for net-2.6.19

2006-09-18 Thread Thomas Graf
* YOSHIFUJI Hideaki / ?$B5HF#1QL@ <[EMAIL PROTECTED]> 2006-09-19 00:08
> [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.

> [NET]: Include new rtnetlink headers for userspace backward compatibility.
> 
> Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
> 
> diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
> index 3a18add..8ec375c 100644
> --- a/include/linux/rtnetlink.h
> +++ b/include/linux/rtnetlink.h
> @@ -2,7 +2,12 @@ #ifndef __LINUX_RTNETLINK_H
>  #define __LINUX_RTNETLINK_H
>  
>  #include 
> +#ifndef __KERNEL__
> +/* Backward compatibility */
>  #include 
> +#include 
> +#include 
> +#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.

> 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.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PATCH] NET: Fixes for net-2.6.19

2006-09-18 Thread YOSHIFUJI Hideaki / 吉藤英明
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.

Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 9f63edd..5f4a50e 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -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.

Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

diff --git a/include/linux/if.h b/include/linux/if.h
index cd080d7..ab85ed0 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -212,134 +212,4 @@ struct ifconf 
 #defineifc_buf ifc_ifcu.ifcu_buf   /* buffer address   
*/
 #defineifc_req ifc_ifcu.ifcu_req   /* array of structures  
*/
 
-/* The struct should be in sync with struct net_device_stats */
-struct rtnl_link_stats
-{
-   __u32   rx_packets; /* total packets received   */
-   __u32   tx_packets; /* total packets transmitted*/
-   __u32   rx_bytes;   /* total bytes received */
-   __u32   tx_bytes;   /* total bytes transmitted  */
-   __u32   rx_errors;  /* bad packets received */
-   __u32   tx_errors;  /* packet transmit problems */
-   __u32   rx_dropped; /* no space in linux buffers*/
-   __u32   tx_dropped; /* no space available in linux  */
-   __u32   multicast;  /* multicast packets received   */
-   __u32   collisions;
-
-   /* detailed rx_errors: */
-   __u32   rx_length_errors;
-   __u32   rx_over_errors; /* receiver ring buff overflow  */
-   __u32   rx_crc_errors;  /* recved pkt with crc error*/
-   __u32   rx_frame_errors;/* recv'd frame alignment error */
-   __u32   rx_fifo_errors; /* recv'r fifo overrun  */
-   __u32   rx_missed_errors;   /* receiver missed packet   */
-
-   /* detailed tx_errors */
-   __u32   tx_aborted_errors;
-   __u32   tx_carrier_er