From fffeee019ff075a9d476c6c44f439a78cf702b3d Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Thu, 24 May 2012 18:52:27 +0200 Subject: [PATCH] more solaris fixes --- miniupnpd/Changelog.txt | 5 ++++- miniupnpd/genconfig.sh | 5 ++++- miniupnpd/minissdp.c | 9 +++++---- miniupnpd/upnpsoap.c | 8 +++++--- miniupnpd/upnputils.c | 7 ++++++- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/miniupnpd/Changelog.txt b/miniupnpd/Changelog.txt index 21141d3..61d6765 100644 --- a/miniupnpd/Changelog.txt +++ b/miniupnpd/Changelog.txt @@ -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 diff --git a/miniupnpd/genconfig.sh b/miniupnpd/genconfig.sh index 9621e5e..e2e4c80 100755 --- a/miniupnpd/genconfig.sh +++ b/miniupnpd/genconfig.sh @@ -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) diff --git a/miniupnpd/minissdp.c b/miniupnpd/minissdp.c index 507ce0d..200df00 100644 --- a/miniupnpd/minissdp.c +++ b/miniupnpd/minissdp.c @@ -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++; } @@ -573,7 +574,7 @@ ProcessSSDPData(int s, const char *bufr, int n, lan_addr = lan_addr->list.le_next) { 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; } if (lan_addr == NULL) diff --git a/miniupnpd/upnpsoap.c b/miniupnpd/upnpsoap.c index e2b21ab..d0116b8 100644 --- a/miniupnpd/upnpsoap.c +++ b/miniupnpd/upnpsoap.c @@ -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, diff --git a/miniupnpd/upnputils.c b/miniupnpd/upnputils.c index 8e253d7..ec32d29 100644 --- a/miniupnpd/upnputils.c +++ b/miniupnpd/upnputils.c @@ -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;