[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Error compiling network.cpp on Solaris 8
From: |
Craig E. Johnston |
Subject: |
Error compiling network.cpp on Solaris 8 |
Date: |
06 Mar 2003 13:56:08 -0800 |
I have run into a problem compiling commoncpp2-1.08 on a Sun running
Solaris 8.0 (SunOS 5.8).
Specifically, in the enumNetworkDevices() method of network.cpp, the
ioctl call to retrieve the MTU is no longer supported using the 'ifreq'
structure from "include/net/if.h". Sun has moved to an IPv6
implementation that uses a structure named 'lifreq'. Some ioctl() calls
are still supported for backward compatibility, but not the
ifreq.ifr_mtu union member for the SIOCGIFMTU call.
The following diff is my workaround. (watch the line wrap)
*** network.cpp 2003-03-04 11:51:17.000000000 -0800
--- /project/commoncpp2-1.0.8/src/network.cpp 2003-01-23
06:33:55.000000000 -0800
***************
*** 121,138 ****
else
(InetAddress&)maskaddr =
((sockaddr_in&)devifreq.ifr_addr).sin_addr;
- #ifdef CEJ_SOLARIS_FIX
if(ioctl(fd, SIOCGIFMTU, &devifreq) == -1)
mtu = 0;
else
mtu = devifreq.ifr_mtu;
- #else
- struct lifreq devlifreq;
- if(ioctl(fd, SIOCGLIFMTU, &devlifreq) == -1)
- mtu = 0;
- else
- mtu = devlifreq.lifr_mtu;
- #endif
devs.push_back(NetworkDeviceInfo(ifc.ifc_req[i].ifr_name, addr, brdaddr,
maskaddr, mtu));
}
--- 121,130 ----
Craig Johnston
address@hidden
- Error compiling network.cpp on Solaris 8,
Craig E. Johnston <=