summaryrefslogtreecommitdiff
path: root/src/get_eth_info.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2009-08-31 19:34:57 +0200
committerMichael Stapelberg <michael@stapelberg.de>2009-09-01 12:39:49 +0200
commite565e313f79c78eb1be27ce6ea789011105cf549 (patch)
treedf19e857cc3320392b60077a71ea3a9d42d9939e /src/get_eth_info.c
parent39b153fdd100088b567130a354824ef49b190009 (diff)
Support for (Debian) GNU/kFreeBSD
Diffstat (limited to 'src/get_eth_info.c')
-rw-r--r--src/get_eth_info.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/get_eth_info.c b/src/get_eth_info.c
index 4d9a8a9..80cc829 100644
--- a/src/get_eth_info.c
+++ b/src/get_eth_info.c
@@ -17,7 +17,7 @@
#define PART_ETHSPEED "E: %s (%d Mbit/s)"
#endif
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <net/if_media.h>
#define IFM_TYPE_MATCH(dt, t) \
(IFM_TYPE((dt)) == 0 || IFM_TYPE((dt)) == IFM_TYPE((t)))
@@ -34,7 +34,7 @@ const char *get_eth_info() {
static char part[512];
#if defined(LINUX)
int ethspeed=0;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
char *ethspeed;
#endif
const char *ip_address = get_ip_addr(eth_interface);
@@ -57,7 +57,7 @@ const char *get_eth_info() {
if (ioctl(general_socket, SIOCETHTOOL, &ifr) == 0)
ethspeed = (ecmd.speed == USHRT_MAX ? 0 : ecmd.speed);
else get_ethspeed = false;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
struct ifmediareq ifm;
(void)memset(&ifm, 0, sizeof(ifm));
(void)strncpy(ifm.ifm_name, eth_interface, sizeof(ifm.ifm_name));