miniupnpd: remove warnings

This commit is contained in:
Thomas Bernard 2015-02-16 22:41:40 +01:00
parent d5ccd5e86e
commit e896e298f3
2 changed files with 20 additions and 9 deletions

View File

@ -1,7 +1,7 @@
/* $Id: ifacewatcher.c,v 1.7 2012/05/27 22:16:10 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2012 Thomas Bernard
* (c) 2006-2015 Thomas Bernard
*
* ifacewatcher.c
*
@ -236,7 +236,10 @@ ProcessInterfaceWatchNotify(int s)
struct iovec iov;
struct msghdr hdr;
struct nlmsghdr *nlhdr;
#if 0
/* disabled at the moment */
struct ifinfomsg *ifi;
#endif
struct ifaddrmsg *ifa;
int len;
@ -278,8 +281,9 @@ ProcessInterfaceWatchNotify(int s)
case RTM_DELLINK:
is_del = 1;
case RTM_NEWLINK:
ifi = (struct ifinfomsg *) NLMSG_DATA(nlhdr);
#if 0
/* disabled at the moment */
ifi = (struct ifinfomsg *) NLMSG_DATA(nlhdr);
if(is_del) {
if(ProcessInterfaceDown(ifi) < 0)
syslog(LOG_ERR, "ProcessInterfaceDown(ifi) failed");

View File

@ -681,19 +681,24 @@ DeletePortMapping(struct upnphttp * h, const char * action)
"</u:DeletePortMappingResponse>";
struct NameValueParserData data;
const char * r_host, * ext_port, * protocol;
const char * ext_port, * protocol;
unsigned short eport;
#ifdef UPNP_STRICT
const char * r_host;
#endif /* UPNP_STRICT */
ParseNameValue(h->req_buf + h->req_contentoff, h->req_contentlen, &data);
r_host = GetValueFromNameValueList(&data, "NewRemoteHost");
ext_port = GetValueFromNameValueList(&data, "NewExternalPort");
protocol = GetValueFromNameValueList(&data, "NewProtocol");
#ifdef UPNP_STRICT
r_host = GetValueFromNameValueList(&data, "NewRemoteHost");
#endif /* UPNP_STRICT */
#ifdef UPNP_STRICT
if(!ext_port || !protocol || !r_host)
#else
if(!ext_port || !protocol)
#endif
#endif /* UPNP_STRICT */
{
ClearNameValueList(&data);
SoapError(h, 402, "Invalid Args");
@ -707,8 +712,8 @@ DeletePortMapping(struct upnphttp * h, const char * action)
SoapError(h, 726, "RemoteHostOnlySupportsWildcard");
return;
}
#endif
#endif
#endif /* UPNP_STRICT */
#endif /* SUPPORT_REMOTEHOST */
eport = (unsigned short)atoi(ext_port);
@ -1145,19 +1150,21 @@ GetDefaultConnectionService(struct upnphttp * h, const char * action)
static void
SetConnectionType(struct upnphttp * h, const char * action)
{
#ifdef UPNP_STRICT
const char * connection_type;
#endif /* UPNP_STRICT */
struct NameValueParserData data;
UNUSED(action);
ParseNameValue(h->req_buf + h->req_contentoff, h->req_contentlen, &data);
connection_type = GetValueFromNameValueList(&data, "NewConnectionType");
#ifdef UPNP_STRICT
connection_type = GetValueFromNameValueList(&data, "NewConnectionType");
if(!connection_type) {
ClearNameValueList(&data);
SoapError(h, 402, "Invalid Args");
return;
}
#endif
#endif /* UPNP_STRICT */
/* Unconfigured, IP_Routed, IP_Bridged */
ClearNameValueList(&data);
/* always return a ReadOnly error */