[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error compiling network.cpp on Solaris 8
From: |
David Sugar |
Subject: |
Re: Error compiling network.cpp on Solaris 8 |
Date: |
Tue, 11 Mar 2003 18:14:17 -0500 |
User-agent: |
KMail/1.4.3 |
Perhaps this could be tied to the _THR_SUNOS5 symbol definition rathern than
the CEJ_... macro you use? If so and that works for you and for other
sun/solaris configurations then it would be self configuring and I think we
could include this for the next release.
On Thursday 06 March 2003 04:56 pm, Craig E. Johnston wrote:
> 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
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp