Skip to content

Instantly share code, notes, and snippets.

@afh
Created July 21, 2013 07:33
Show Gist options
  • Select an option

  • Save afh/6047832 to your computer and use it in GitHub Desktop.

Select an option

Save afh/6047832 to your computer and use it in GitHub Desktop.
Patch for ushare 1.1a to compile with libupnp 1.6.18
diff --git a/src/.ushare.c.swp b/src/.ushare.c.swp
index 2936c41..e88f39b 100644
Binary files a/src/.ushare.c.swp and b/src/.ushare.c.swp differ
diff --git a/src/ushare.c b/src/ushare.c
index 717e862..8e51bf7 100644
--- a/src/ushare.c
+++ b/src/ushare.c
@@ -188,7 +188,7 @@ handle_action_request (struct Upnp_Action_Request *request)
if (strcmp (request->DevUDN + 5, ut->udn))
return;
- ip = request->CtrlPtIPAddr.s_addr;
+ ip = ((struct sockaddr *) &request->CtrlPtIPAddr)->sa_data;
ip = ntohl (ip);
sprintf (val, "%d.%d.%d.%d",
(ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment