linux-3.2.*, iptables, linux/if_packet.h, and '__aligned_u64' compile problem

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Sat Jan 28 17:10:50 UTC 2012


On Jan 28, 2012 5:52 PM, "Kevin Day" <thekevinday at gmail.com> wrote:
>
> On Fri, Jan 27, 2012 at 11:59 PM, Khem Raj <raj.khem at gmail.com> wrote:
> > On Fri, Jan 27, 2012 at 4:56 PM, Kevin Day <thekevinday at gmail.com>
wrote:
> >> In the 3.2 linux kernel series, the structure tpacket_hdr_v1 was added
> >> to linux/if_packet.h.
> >> Inside of that structure, the following variable was defined:
> >>
> >> __aligned_u64   seq_num;
> >>
> >> While compiling iptables 1.4.12.2 on a x86_64 system with the headers
> >> from the said kernel installed, I get the following compile error:
> >>
> >> /usr/include/linux/if_packet.h:176: error: expected
> >> specifier-qualifier-list before '__aligned_u64'.
> >>
> >> According to the article here:
> >>  http://web.archiveorange.com/archive/v/EazJNEDWPcR6tgKsiHvQ
> >> To solve this problem, I have to add the following to sys/types.h:
> >>
> >> #define __aligned_u64 __u64 __attribute__((aligned(8)))
> >> #define __aligned_be64 __be64 __attribute__((aligned(8)))
> >> #define __aligned_le64 __le64 __attribute__((aligned(8)))
> >>
> >> This fix seems to do the trick for me.
> >> Is this a valid fix and can it or a proper solution be commited
upstream?
> >
> > why dont include <linux/types.h> in your app
> >
> >
>
> That would be a question for the iptables project.
> Is hacking iptables source to include <linux/types.h> the better or
> more proper approach?
>
Fixing iptables to include the (Linux) headers it uses is the proper fix,
yes.


More information about the uClibc mailing list