--- ipxkern.c +++ ipxkern.c @@ -31,6 +31,7 @@ #endif #include #include "ipxkern.h" +#include #define MAX_IFC (256) @@ -54,8 +55,16 @@ { FILE *ipx_route; char buf[512]; + struct utsname u; - ipx_route = fopen("/proc/net/ipx_route", "r"); + if (uname(&u) != 0) { + sprintf(ipx_err_string, "call uname: %s", + strerror(errno)); + return -1; + } + + ipx_route = fopen(strncmp(u.version, "2.4", 3) == 0 ? + "/proc/net/ipx_route" : "/proc/net/ipx/route", "r"); if (ipx_route == NULL) { @@ -112,8 +121,16 @@ { FILE *ipx_ifc; char buf[512]; + struct utsname u; + + if (uname(&u) != 0) { + sprintf(ipx_err_string, "call uname: %s", + strerror(errno)); + return -1; + } - ipx_ifc = fopen("/proc/net/ipx_interface", "r"); + ipx_ifc = fopen(strncmp(u.version, "2.4", 3) == 0 ? + "/proc/net/ipx_interface" : "/proc/net/ipx/interface", "r"); if (ipx_ifc == NULL) {