Commit c9bb5382 authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by Kamal Mostafa

ethtool.h: define INT_MAX for userland

BugLink: http://bugs.launchpad.net/bugs/1592930

INT_MAX needs limits.h in userland.
When ethtool.h is included by a userland app, we got the following error:

.../usr/include/linux/ethtool.h: In function 'ethtool_validate_speed':
.../usr/include/linux/ethtool.h:1471:18: error: 'INT_MAX' undeclared (first use in this function)
  return speed <= INT_MAX || speed == SPEED_UNKNOWN
                  ^
Fixes: 72f843bd ("ethtool: make validate_speed accept all speeds between 0 and INT_MAX")
CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(cherry picked from commit 14e20379)
Signed-off-by: default avatarAndy Gospodarek <gospo@cumulusnetworks.com>
Reported-by: default avatarIain Lane <iain@orangesquash.org.uk>
Acked-by: default avatarTim Gardner <tim.gardner@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 70f22d18
......@@ -16,6 +16,10 @@
#include <linux/types.h>
#include <linux/if_ether.h>
#ifndef __KERNEL__
#include <limits.h> /* for INT_MAX */
#endif
/* All structures exposed to userland should be defined such that they
* have the same layout for 32-bit and 64-bit userland.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment