> I was afraid something like this was going to happen!
> Unfortunately I don't have access to other build environments
> such as FreeBSD, Solaris, etc. So I will ask Alexandre to please
> retract my patch from CVS, and I will submit a patch later today that
> fences off my patch with an '#ifdef linux' (which I have seen done
> in other places in the code) and if other people want to support other
> platforms they can do so. I greped in the /usr/include on my
> Linux box, and I don't have any field called 'ifa_netmask',
> so I am afraid what I am doing might be very platform specific.
I have fixed/kludged it on Solaris. Patch attached.
Solaris is a bit strange.
The lack of SIOCGIFHWADDR was easily fixed because Solaris have
a SIOCGENADDR instead with only slightly different syntax.
The big problem was the SIOCIFNETMASK, which Solaris have. However
the ifr_netmask field doesn't exist in the struct ifreq eventhough
it is what is returned on Solaris as well according the header file.
Trying to compare Linux and Solaris the only thing that might
reasonably work is
#ifndef ifr_netmask
# define ifr_netmask ifr_addr
#endif
since on Linux both ifr_netmask and ifr_addr are the same type and part
of the same union. I'm not sure it this is correct though.
Anyway here is the struct ifreq on Solaris (2.6).
struct ifreq {
#define IFNAMSIZ 16
char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
char ifru_oname[IFNAMSIZ]; /* other if name */
struct sockaddr ifru_broadaddr;
int ifru_index; /* interface index */
short ifru_flags;
int ifru_metric;
char ifru_data[1]; /* interface dependent data
*/
char ifru_enaddr[6];
int if_muxid[2]; /* mux id's for arp and ip
*/
/* Struct for FDDI ioctl's */
struct ifr_dnld_reqs {
caddr_t v_addr;
caddr_t m_addr;
caddr_t ex_addr;
u_int size;
} ifru_dnld_req;
/* Struct for FDDI stats */
struct ifr_fddi_stats {
u_int stat_size;
caddr_t fddi_stats;
} ifru_fddi_stat;
struct ifr_netmapents {
u_int map_ent_size, /* size of netmap structure
*/
entry_number; /* index into netmap list */
caddr_t fddi_map_ent; /* pointer to user structure
*/
} ifru_netmapent;
/* Field for generic ioctl for fddi */
struct ifr_fddi_gen_struct {
int ifru_fddi_gioctl; /* field for gen ioctl */
caddr_t ifru_fddi_gaddr; /* Generic ptr to a field
*/
} ifru_fddi_gstruct;
} ifr_ifru;
#define ifr_addr ifr_ifru.ifru_addr /* address */
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link
*/
#define ifr_oname ifr_ifru.ifru_oname /* other if name */
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
#define ifr_flags ifr_ifru.ifru_flags /* flags */
#define ifr_metric ifr_ifru.ifru_metric /* metric */
#define ifr_data ifr_ifru.ifru_data /* for use by interface */
#define ifr_enaddr ifr_ifru.ifru_enaddr /* ethernet address */
#define ifr_index ifr_ifru.ifru_index /* interface index */
/* FDDI specific */
#define ifr_dnld_req ifr_ifru.ifru_dnld_req
#define ifr_fddi_stat ifr_ifru.ifru_fddi_stat
#define ifr_fddi_netmap ifr_ifru.ifru_netmapent /* FDDI network map entries
*/
#define ifr_fddi_gstruct ifr_ifru.ifru_fddi_gstruct
#define ifr_ip_muxid ifr_ifru.if_muxid[0]
#define ifr_arp_muxid ifr_ifru.if_muxid[1]
};
> Did anything in WsControl fail to build on your platform? I am afraid
> so, because some of WsControl is similar to what I was doing
> in WSAIoctl.
Both dlls/winsock/socket.c and dlls/wsock32/socket.c failed on Solaris.
Both are fixed in this patch.
solaris.diff