Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Necessary changes to miniupnp #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/miniupnpd/cscope.out
/tags
cscope.out
2 changes: 1 addition & 1 deletion miniupnpc/connecthostport.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ int connecthostport(const char * host, unsigned short port,
/* EINTR The system call was interrupted by a signal that was caught
* EINPROGRESS The socket is nonblocking and the connection cannot
* be completed immediately. */
while(n < 0 && (errno == EINTR || errno = EINPROGRESS))
while(n < 0 && (errno == EINTR || errno == EINPROGRESS))
{
socklen_t len;
fd_set wset;
Expand Down
Empty file modified miniupnpc/external-ip.sh
100755 → 100644
Empty file.
Empty file modified miniupnpc/java/testjava.bat
100755 → 100644
Empty file.
Empty file modified miniupnpc/java/testjava.sh
100755 → 100644
Empty file.
20 changes: 13 additions & 7 deletions miniupnpc/miniupnpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ parseMSEARCHReply(const char * reply, int size,
* no devices was found.
* It is up to the caller to free the chained list
* delay is in millisecond (poll) */
MINIUPNP_LIBSPEC struct UPNPDev *
upnpDiscoverDevices(const char * const deviceTypes[],
MINIUPNP_LIBSPEC struct UPNPDev *upnpDiscoverDevices(const char * const deviceTypes[],
int delay, const char * multicastif,
const char * minissdpdsock, int sameport,
int ipv6,
Expand Down Expand Up @@ -383,7 +382,8 @@ upnpDiscoverDevices(const char * const deviceTypes[],
if(!minissdpdsock)
minissdpdsock = "/var/run/minissdpd.sock";
for(deviceIndex = 0; !devlist && deviceTypes[deviceIndex]; deviceIndex++) {
devlist = getDevicesFromMiniSSDPD(deviceTypes[deviceIndex],
char * myDev = deviceTypes[deviceIndex];
devlist = getDevicesFromMiniSSDPD(deviceTypes[deviceIndex],
minissdpdsock);
/* We return what we have found if it was not only a rootdevice */
if(devlist && !strstr(deviceTypes[deviceIndex], "rootdevice")) {
Expand Down Expand Up @@ -561,6 +561,7 @@ upnpDiscoverDevices(const char * const deviceTypes[],
}
/* receiving SSDP response packet */
for(deviceIndex = 0; deviceTypes[deviceIndex]; deviceIndex++) {
char * device = deviceTypes[deviceIndex];
/* sending the SSDP M-SEARCH packet */
n = snprintf(bufr, sizeof(bufr),
MSearchMsgFmt,
Expand Down Expand Up @@ -651,6 +652,9 @@ upnpDiscoverDevices(const char * const deviceTypes[],
} else if (n == 0) {
/* no data or Time Out */
if (devlist) {
//TODO need new condition: if there are any devices left on the list ,NOT if there was any device found
/* Search for other devices */
goto contin;
/* found some devices, stop now*/
if(error)
*error = UPNPDISCOVER_SUCCESS;
Expand Down Expand Up @@ -706,10 +710,12 @@ upnpDiscoverDevices(const char * const deviceTypes[],
}
}
} while(n > 0);
}
error:
closesocket(sudp);
return devlist;
contin:
;
}
error: //TODO undo 711 till here and uncomment this
closesocket(sudp);
return devlist;
}

/* upnpDiscover() Discover IGD device */
Expand Down
1 change: 1 addition & 0 deletions miniupnpc/miniupnpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ MINIUPNP_LIBSPEC void parserootdesc(const char *, int, struct IGDdatas *);
* ipcondescURL: url of the description of the WANIPConnection
* controlURL_CIF: controlURL of the WANCommonInterfaceConfig
* controlURL_6FC: controlURL of the WANIPv6FirewallControl
*
*/
struct UPNPUrls {
char * controlURL;
Expand Down
Empty file modified miniupnpc/pymoduletest.py
100755 → 100644
Empty file.
Empty file modified miniupnpc/testminiwget.sh
100755 → 100644
Empty file.
Empty file modified miniupnpc/testupnpigd.py
100755 → 100644
Empty file.
Empty file modified miniupnpc/testupnpreplyparse.sh
100755 → 100644
Empty file.
Empty file modified miniupnpc/updateminiupnpcstrings.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/genconfig.sh
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion miniupnpd/miniupnpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ clean_ruleset_interval=600
#quickrules=no

# uuid : generate your own with "make genuuid"
uuid=00000000-0000-0000-0000-000000000000
uuid=414f481d-7a39-4159-a3ab-482f1e9ff58c

# serial and model number the daemon will report to clients
# in its XML description
Expand Down
Empty file modified miniupnpd/netfilter/ip6tables_display.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/netfilter/ip6tables_flush.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/netfilter/ip6tables_init.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/netfilter/ip6tables_init_and_clean.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/netfilter/ip6tables_removeall.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/netfilter/iptables_display.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/netfilter/iptables_flush.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/netfilter/iptables_init.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/netfilter/iptables_init_and_clean.sh
100755 → 100644
Empty file.
Empty file modified miniupnpd/netfilter/iptables_removeall.sh
100755 → 100644
Empty file.