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: 2012/05/21:
Clean signal handling Clean signal handling

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /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 # miniupnp daemon
# http://miniupnp.free.fr or http://miniupnp.tuxfamily.org/ # http://miniupnp.free.fr or http://miniupnp.tuxfamily.org/
# (c) 2006-2012 Thomas Bernard # (c) 2006-2012 Thomas Bernard
@ -175,6 +175,9 @@ case $OS_NAME in
FW=ipf FW=ipf
echo "#define LOG_PERROR 0" >> ${CONFIGFILE} echo "#define LOG_PERROR 0" >> ${CONFIGFILE}
echo "#define SOLARIS_KSTATS 1" >> ${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/ OS_URL=http://www.sun.com/solaris/
;; ;;
Linux) 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 /* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2012 Thomas Bernard * (c) 2006-2012 Thomas Bernard
@ -154,7 +154,7 @@ OpenAndConfSSDPReceiveSocket(int ipv6)
{ {
syslog(LOG_WARNING, syslog(LOG_WARNING,
"Failed to add multicast membership for interface %s", "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) if(n < 0)
{ {
/* XXX handle EINTR, EAGAIN, EWOULDBLOCK */ /* 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++; i++;
} }
@ -573,7 +574,7 @@ ProcessSSDPData(int s, const char *bufr, int n,
lan_addr = lan_addr->list.le_next) lan_addr = lan_addr->list.le_next)
{ {
if( (((const struct sockaddr_in *)sender)->sin_addr.s_addr & lan_addr->mask.s_addr) if( (((const struct sockaddr_in *)sender)->sin_addr.s_addr & lan_addr->mask.s_addr)
== (lan_addr->addr.s_addr & lan_addr->mask.s_addr)) == (lan_addr->addr.s_addr & lan_addr->mask.s_addr))
break; break;
} }
if (lan_addr == NULL) if (lan_addr == NULL)

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 /* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2012 Thomas Bernard * (c) 2006-2012 Thomas Bernard
@ -406,7 +406,8 @@ AddPortMapping(struct upnphttp * h, const char * action)
#endif #endif
syslog(LOG_INFO, "%s: ext port %hu to %s:%hu protocol %s for: %s leaseduration=%u rhost=%s", 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); 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'", syslog(LOG_INFO, "%s: rhost='%s' %s %s found => %s:%u desc='%s'",
action, 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, bodylen = snprintf(body, sizeof(body), resp,
action, SERVICE_TYPE_WANIPC, action, SERVICE_TYPE_WANIPC,
(unsigned int)iport, int_ip, desc, leaseduration, (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 /* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2012 Thomas Bernard * (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); n = snprintf(str, size, "%s:%hu", buffer, port);
break; break;
#ifdef AF_LINK #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: case AF_LINK:
{ {
struct sockaddr_dl * sdl = (struct sockaddr_dl *)addr; struct sockaddr_dl * sdl = (struct sockaddr_dl *)addr;