Subject: Re: Iproute2 build broken by current kernel headers

From: Stephen Hemminger <[email-masked]>
Date: Wed, 11 Jan 2012 10:24:00 -0800

On Wed, 11 Jan 2012 10:34:48 +0400
Pavel Emelyanov <[email-masked]> wrote:

> On 01/10/2012 11:07 PM, Stephen Hemminger wrote:
> > On Tue, 10 Jan 2012 10:54:09 -0800
> > Stephen Hemminger <[email-masked]> wrote:
> > 
> >> The update to inet diag broke compatibility with exported headers.
> >> Iproute2 uses sanitized kernel headers.
> >>
> >> gcc -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib/\"   -c -o ss.o ss.c
> >> ss.c: In function ‘tcp_show_netlink’:
> >> ss.c:1504:7: error: ‘struct inet_diag_req’ has no member named ‘idiag_family’
> >> make[1]: *** [ss.o] Error 1
> > 
> > The structures need to be swapped to maintain source compatibility.
> > inet_diag_req_compat needs to be renamed back to inet_diag_req
> > inet_diag_req should be named something like inet_diag_req_generic
> 
> Stephen, actually the diag modules were patched to be only binary compatible with the ss.
> In order to make it compile with new headers I've sent the patches fixing ss, here they are:
> 
> http://www.spinics.net/lists/netdev/msg182467.html
> http://www.spinics.net/lists/netdev/msg182858.html
> http://lists.openwall.net/netdev/2011/12/15/45

These patches will have to be redone to work with the revised include
files. The iproute2 changes are not acceptable as is because they do not support
older kernels.

It is critical that the resulting code work on both old and new
kernels. In other words, when the new ss command is built (using your
patches and 3.3 headers), it:
 * SHOULD send new diag requests to kernel and be able to display
   the new UNIX domain info
 * MUST still work when run against old 3.2 kernel.

This means the code should send new request first, and if that generates
an error fallback (silently) to the old message format.