Re: [PATCH 1/1] net: rtnetlink.h -- only include linux/netdevice.hwhen used by the kernel

From: David Miller
Date: Mon Nov 15 2010 - 14:29:45 EST


From: Andy Whitcroft <apw@xxxxxxxxxxxxx>
Date: Mon, 15 Nov 2010 16:01:59 +0000

> The commit below added a new helper dev_ingress_queue to cleanly obtain the
> ingress queue pointer. This necessitated including 'linux/netdevice.h':
...
> However this include triggers issues for applications in userspace
> which use the rtnetlink interfaces. Commonly this requires they include
> 'net/if.h' and 'linux/rtnetlink.h' leading to a compiler error as below:
>
> In file included from /usr/include/linux/netdevice.h:28:0,
> from /usr/include/linux/rtnetlink.h:9,
> from t.c:2:
> /usr/include/linux/if.h:135:8: error: redefinition of ʽstruct ifmapʼ
> /usr/include/net/if.h:112:8: note: originally defined here
> /usr/include/linux/if.h:169:8: error: redefinition of ʽstruct ifreqʼ
> /usr/include/net/if.h:127:8: note: originally defined here
> /usr/include/linux/if.h:218:8: error: redefinition of ʽstruct ifconfʼ
> /usr/include/net/if.h:177:8: note: originally defined here
>
> The new helper is only defined for the kernel and protected by __KERNEL__
> therefore we can simply pull the include down into the same protected
> section.
>
> Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxxx>

Applied, thanks Andy.
ʼιμΉ»?&ή~Ί&Ά¬?+-±ιέΆ??w??Λ?±Κβmιb?μdzΉή?)ν?ζθw*jg¬±¨Ά????έʼj/?κδzΉή??ΰ2?ή?¨θ­Ϊ&ʼ)ίʽ«aΆΪώψ?G«?ιh?ζj:+v?¨?wθ?Ω?>W?±κήiΫaxPjΨmΆ??Γ -»+?ωd?_