bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error compiling network.cpp on Solaris 8


From: Federico Montesino Pouzols
Subject: Re: Error compiling network.cpp on Solaris 8
Date: Tue, 18 Mar 2003 19:33:59 +0100
User-agent: Mutt/1.5.3i

        I have committed this patch, but replacing 

#ifdef CEJ_SOLARIS_FIX

        with

#ifdef SIOCGIFMTU

        as it seems less Solaris-specific. Will this work on Solaris,
or is SIOCGIFMTU defined even if it does not work? In such case we
will have to add more symbols, like:

#if defined(SIOCGIFMTU) && ( !defined(_THR_SUNOS5) || defined(CEJ_SOLARIS_FIX) )

On Tue, Mar 11, 2003 at 06:14:17PM -0500, David Sugar wrote:
> 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
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]