configure.in: Check for in_addr_t in netinet/in.h too.
* configure.in: Check for in_addr_t in netinet/in.h too. Check for ip_mreq too. * acconfig.h: Define HAVE_IN_ADDR_T instead of in_addr_t. (HAVE_STRUCT_IP_MREQ): Added. * configure, include/config.h.in: Rebuilt. * java/net/natInetAddress.cc (aton): Typedef in_addr_t to jint if needed. * java/net/natPlainDatagramSocketImpl.cc (McastReq, mcastGrp): Disable if ip_mreq is not available. From-SVN: r28798
This commit is contained in:
parent
988f5b7014
commit
ccfe7e4650
7 changed files with 117 additions and 48 deletions
|
@ -71,6 +71,9 @@ java::net::InetAddress::aton (jstring host)
|
|||
blen = 4;
|
||||
}
|
||||
#elif defined(HAVE_INET_ADDR)
|
||||
#if ! HAVE_IN_ADDR_T
|
||||
typedef jint in_addr_t;
|
||||
#endif
|
||||
in_addr_t laddr = inet_addr (hostname);
|
||||
if (laddr != (in_addr_t)(-1))
|
||||
{
|
||||
|
|
|
@ -61,7 +61,9 @@ union SockAddr
|
|||
|
||||
union McastReq
|
||||
{
|
||||
#if HAVE_STRUCT_IP_MREQ
|
||||
struct ip_mreq mreq;
|
||||
#endif
|
||||
#ifdef HAVE_INET6
|
||||
struct ipv6_mreq mreq6;
|
||||
#endif
|
||||
|
@ -323,7 +325,10 @@ java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr,
|
|||
int len = haddress->length;
|
||||
int level, opname;
|
||||
const char *ptr;
|
||||
if (len == 4)
|
||||
if (0)
|
||||
;
|
||||
#if HAVE_STRUCT_IP_MREQ
|
||||
else if (len == 4)
|
||||
{
|
||||
level = IPPROTO_IP;
|
||||
opname = join ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP;
|
||||
|
@ -334,6 +339,7 @@ java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr,
|
|||
len = sizeof (struct ip_mreq);
|
||||
ptr = (const char *) &u.mreq;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_INET6
|
||||
else if (len == 16)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue