diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2014-09-01 23:05:26 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2014-09-01 23:05:26 +0000 |
commit | 39a5b78f8797ded2c50107a77794cd671dff707f (patch) | |
tree | 39f650e2e85c255908675444e0ce32d9639f251f /net/ushare/files/patch-ushare.c | |
parent | Remove non staged ports without pending PR from net-im and net-mgmt (diff) |
Remove non staged ports without pending PR from net-p2p, net and news
Notes
Notes:
svn path=/head/; revision=366967
Diffstat (limited to 'net/ushare/files/patch-ushare.c')
-rw-r--r-- | net/ushare/files/patch-ushare.c | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/net/ushare/files/patch-ushare.c b/net/ushare/files/patch-ushare.c deleted file mode 100644 index d5959c0af17d..000000000000 --- a/net/ushare/files/patch-ushare.c +++ /dev/null @@ -1,118 +0,0 @@ ---- src/ushare.c.orig 2007-12-09 15:03:36.000000000 +0200 -+++ src/ushare.c 2010-11-09 14:56:44.261445831 +0200 -@@ -171,6 +171,19 @@ - pthread_mutex_unlock (&ut->termination_mutex); - } - -+ -+#ifdef __FreeBSD__ -+static void -+*get_ip_addr(struct sockaddr *sa) -+{ -+ if (sa->sa_family == AF_INET) -+ return &(((struct sockaddr_in*)sa)->sin_addr); -+ else -+ return &(((struct sockaddr_in6*)sa)->sin6_addr); -+} -+#endif /* __FreeBSD__ */ -+ -+ - static void - handle_action_request (struct Upnp_Action_Request *request) - { -@@ -188,7 +201,11 @@ - if (strcmp (request->DevUDN + 5, ut->udn)) - return; - -+#ifndef __FreeBSD__ - ip = request->CtrlPtIPAddr.s_addr; -+#else -+ ip = get_ip_addr((struct sockaddr *)&request->CtrlPtIPAddr) ; -+#endif /* __FreeBSD__ */ - ip = ntohl (ip); - sprintf (val, "%d.%d.%d.%d", - (ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF); -@@ -348,6 +365,7 @@ - - UpnpEnableWebserver (TRUE); - -+#ifndef __FreeBSD__ - res = UpnpSetVirtualDirCallbacks (&virtual_dir_callbacks); - if (res != UPNP_E_SUCCESS) - { -@@ -355,6 +373,43 @@ - free (description); - return -1; - } -+#else -+ if ((res = UpnpVirtualDir_set_GetInfoCallback(virtual_dir_callbacks.get_info)) != UPNP_E_SUCCESS ) { -+ log_error (_("Cannot set virtual directory callback - get_info\n")); -+ free (description); -+ return -1; -+ } -+ -+ if ((res = UpnpVirtualDir_set_OpenCallback(virtual_dir_callbacks.open)) != UPNP_E_SUCCESS ) { -+ log_error (_("Cannot set virtual directory callback - open\n")); -+ free (description); -+ return -1; -+ } -+ -+ if ((res = UpnpVirtualDir_set_ReadCallback(virtual_dir_callbacks.read)) != UPNP_E_SUCCESS ) { -+ log_error (_("Cannot set virtual directory callback - read\n")); -+ free (description); -+ return -1; -+ } -+ -+ if ((res = UpnpVirtualDir_set_WriteCallback(virtual_dir_callbacks.write)) != UPNP_E_SUCCESS ) { -+ log_error (_("Cannot set virtual directory callback - write\n")); -+ free (description); -+ return -1; -+ } -+ -+ if ((res = UpnpVirtualDir_set_SeekCallback(virtual_dir_callbacks.seek)) != UPNP_E_SUCCESS ) { -+ log_error (_("Cannot set virtual directory callback - seek\n")); -+ free (description); -+ return -1; -+ } -+ -+ if ((res = UpnpVirtualDir_set_CloseCallback(virtual_dir_callbacks.close)) != UPNP_E_SUCCESS ) { -+ log_error (_("Cannot set virtual directory callback - close\n")); -+ free (description); -+ return -1; -+ } -+#endif /* __FreeBSD__ */ - - res = UpnpAddVirtualDir (VIRTUAL_DIR); - if (res != UPNP_E_SUCCESS) -@@ -421,6 +476,7 @@ - itf = itflist; - while (itf) - { -+#ifndef __FreeBSD__ - if ((itf->ifa_flags & IFF_UP) - && !strncmp (itf->ifa_name, interface, IFNAMSIZ)) - { -@@ -430,6 +486,23 @@ - return true; - } - itf = itf->ifa_next; -+#else -+ if (strncmp (itf->ifa_name, interface, IFNAMSIZ)) { -+ itf = itf->ifa_next; -+ continue ; -+ } -+ -+ if (itf->ifa_flags & IFF_UP) { -+ log_info (_("Interface %s is up.\n"), interface); -+ freeifaddrs (itflist); -+ return true ; -+ } else { -+ log_error (_("Interface %s is down.\n"), interface); -+ log_error (_("Recheck uShare's configuration and try again !\n")); -+ freeifaddrs (itflist); -+ return false ; -+ } -+#endif /* __FreeBSD__ */ - } - - freeifaddrs (itf); |