[systemd-devel] [PATCH 1/3] sd-rtnl: Always enable IFA_FLAGS

Alexander Sverdlin alexander.sverdlin at gmail.com
Tue Apr 7 12:22:07 PDT 2015


Hi Lennart,

On 07/04/15 21:09, Lennart Poettering wrote:
>>>>>>> IFA_FLAGS seems to appear in kernel ~3.13 and the kernel requirements
>> > 
>> > [...]
>> > 
>>>>> > >> > Oh, sorry, the headers are from 3.12, but that's still newer than 3.8 in the doc...
>>>>> > >> > 
>>>>>>>>> > >>>> >> > actually wrong, but your patch actually brakes compilation for me. Toolchain
>>>>>>>>> > >>>> >> > is gcc 4.9 custombuilt from buildroot.
>>> > > Got it, we just need documentation update or fallback define as Lennart proposed :)
>> > 
>> > I've checked, it appears first in 3.14:
>> > 
>> > ...
>> > /*
>> >  * Important comment:
>> >  * IFA_ADDRESS is prefix address, rather than local interface address.
>> >  * It makes no difference for normally configured broadcast interfaces,
>> >  * but for point-to-point IFA_ADDRESS is DESTINATION address,
>> >  * local address is supplied in IFA_LOCAL attribute.
>> >  *
>> >  * IFA_FLAGS is a u32 attribute that extends the u8 field ifa_flags.
>> >  * If present, the value from struct ifaddrmsg will be ignored.
>> >  */
>> > enum {
>> > 	IFA_UNSPEC,
>> > 	IFA_ADDRESS,
>> > 	IFA_LOCAL,
>> > 	IFA_LABEL,
>> > 	IFA_BROADCAST,
>> > 	IFA_ANYCAST,
>> > 	IFA_CACHEINFO,
>> > 	IFA_MULTICAST,
>> > 	IFA_FLAGS,
>> > 	__IFA_MAX,
>> > };
>> > 
>> > #define IFA_MAX (__IFA_MAX - 1)
>> > ...
> Hmm, this header doesn't do "#define IFA_FLAGS IFA_FLAGS" which means
> we need to use AC_CHECK_DECLS for this. 
> 
> I now made the appropriate change in git. Please test!

Seems IFA_MAX should be changed also:

src/libsystemd/sd-rtnl/rtnl-types.c:361:9: error: array index in initializer exceeds array bounds
         [IFA_FLAGS]             = { .type = NLA_U32 },

Alex.


More information about the systemd-devel mailing list