Fix libiproute build with kernel headers older than 2.6.17
Ralf Friedl
Ralf.Friedl at online.de
Sat Feb 26 11:16:06 UTC 2011
Stefan Seyfried wrote:
> the attached patch fixes the build if your kernel headers happen to be
> older than 2.6.17, which is when IFLA_OPERSTATE was introduced.
>
> Unfortunately, IFLA_OPERSTATE is not a define, so I can't check it with
> #ifdef. However, IFF_DORMANT is a define and was introduced with the very
> same commit, so we might be safe.
>
> A comment explaining this situation is in place.
>
The binary may run in a newer kernel, where this information is
available. On the other hand, it may also be compiled on a newer system
and run on an older kernel ...
What about defining the value if it is not present? It seems 16 or
(IFLA_WEIGHT+1) would be the correct value.
+/* IFLA_OPERSTATE came with the same commit as IFF_DORMANT */
+#ifndef IFF_DORMANT
+#define IFLA_OPERSTATE 16 (value for IFLA_OPERSTATE)
+#endif
Ralf
More information about the busybox
mailing list