more solaris fixes

This commit is contained in:
Thomas Bernard 2012-05-24 18:52:27 +02:00
parent ef49e90d28
commit fffeee019f
5 changed files with 24 additions and 10 deletions

View File

@ -1,4 +1,7 @@
$Id: Changelog.txt,v 1.283 2012/05/21 15:57:17 nanard Exp $
$Id: Changelog.txt,v 1.284 2012/05/24 16:51:06 nanard Exp $
2012/05/24:
More solaris fixes
2012/05/21:
Clean signal handling

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: genconfig.sh,v 1.54 2012/05/09 10:40:34 nanard Exp $
# $Id: genconfig.sh,v 1.55 2012/05/24 16:51:08 nanard Exp $
# miniupnp daemon
# http://miniupnp.free.fr or http://miniupnp.tuxfamily.org/
# (c) 2006-2012 Thomas Bernard
@ -175,6 +175,9 @@ case $OS_NAME in
FW=ipf
echo "#define LOG_PERROR 0" >> ${CONFIGFILE}
echo "#define SOLARIS_KSTATS 1" >> ${CONFIGFILE}
# solaris 10 does not define u_int64_t ?
# but it does define uint64_t
echo "typedef uint64_t u_int64_t;" >> ${CONFIGFILE}
OS_URL=http://www.sun.com/solaris/
;;
Linux)

View File

@ -1,4 +1,4 @@
/* $Id: minissdp.c,v 1.34 2012/04/30 13:46:28 nanard Exp $ */
/* $Id: minissdp.c,v 1.35 2012/05/24 16:51:08 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2012 Thomas Bernard
@ -154,7 +154,7 @@ OpenAndConfSSDPReceiveSocket(int ipv6)
{
syslog(LOG_WARNING,
"Failed to add multicast membership for interface %s",
lan_addr->str);
lan_addr->str ? lan_addr->str : "NULL");
}
}
}
@ -455,7 +455,8 @@ SendSSDPNotifies(int s, const char * host, unsigned short port,
if(n < 0)
{
/* XXX handle EINTR, EAGAIN, EWOULDBLOCK */
syslog(LOG_ERR, "sendto(udp_notify=%d, %s): %m", s, host);
syslog(LOG_ERR, "sendto(udp_notify=%d, %s): %m", s,
host ? host : "NULL");
}
i++;
}

View File

@ -1,4 +1,4 @@
/* $Id: upnpsoap.c,v 1.109 2012/05/01 20:08:23 nanard Exp $ */
/* $Id: upnpsoap.c,v 1.110 2012/05/24 16:51:09 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2012 Thomas Bernard
@ -406,7 +406,8 @@ AddPortMapping(struct upnphttp * h, const char * action)
#endif
syslog(LOG_INFO, "%s: ext port %hu to %s:%hu protocol %s for: %s leaseduration=%u rhost=%s",
action, eport, int_ip, iport, protocol, desc, leaseduration, r_host);
action, eport, int_ip, iport, protocol, desc, leaseduration,
r_host ? r_host : "NULL");
r = upnp_redirect(r_host, eport, int_ip, iport, protocol, desc, leaseduration);
@ -639,7 +640,8 @@ GetSpecificPortMappingEntry(struct upnphttp * h, const char * action)
{
syslog(LOG_INFO, "%s: rhost='%s' %s %s found => %s:%u desc='%s'",
action,
r_host, ext_port, protocol, int_ip, (unsigned int)iport, desc);
r_host ? r_host : "NULL", ext_port, protocol, int_ip,
(unsigned int)iport, desc);
bodylen = snprintf(body, sizeof(body), resp,
action, SERVICE_TYPE_WANIPC,
(unsigned int)iport, int_ip, desc, leaseduration,

View File

@ -1,4 +1,4 @@
/* $Id: upnputils.c,v 1.4 2012/02/06 16:21:24 nanard Exp $ */
/* $Id: upnputils.c,v 1.5 2012/05/24 16:51:09 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2012 Thomas Bernard
@ -44,6 +44,11 @@ sockaddr_to_string(const struct sockaddr * addr, char * str, size_t size)
n = snprintf(str, size, "%s:%hu", buffer, port);
break;
#ifdef AF_LINK
#if defined(__sun)
/* solaris does not seem to have link_ntoa */
/* #define link_ntoa _link_ntoa */
#define link_ntoa(x) "dummy-link_ntoa"
#endif
case AF_LINK:
{
struct sockaddr_dl * sdl = (struct sockaddr_dl *)addr;