M7350/oe-core/meta-msm/recipes/miniupnpd/files/0001-enable-backhaul.patch
2024-09-09 08:52:07 +00:00

84 lines
1.9 KiB
Diff
Executable File

From 411cd3814d0e62a0a69fdd4e2cb23b9107d625ba Mon Sep 17 00:00:00 2001
From: Tyler Wear <twear@codeaurora.org>
Date: Fri, 14 Jun 2013 11:01:56 -0700
Subject: [PATCH 1/1] enable-backhaul
---
upnpsoap.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
mode change 100644 => 100755 upnpsoap.c
diff --git a/upnpsoap.c b/upnpsoap.c
old mode 100644
new mode 100755
index efe8c2a..07967d9
--- a/upnpsoap.c
+++ b/upnpsoap.c
@@ -1156,16 +1156,63 @@ SetConnectionType(struct upnphttp * h, const char * action)
static void
RequestConnection(struct upnphttp * h, const char * action)
{
+#ifndef QCMAP
UNUSED(action);
SoapError(h, 606, "Action not authorized");
+#else
+ static const char resp[] =
+ "<u:RequestConnectionResponse "
+ "xmlns:u=\"" SERVICE_TYPE_WANIPC "\">"
+ "</u:RequestConnectionResponse>";
+ if(getWanStatus() == 1)/* Connecting */
+ {
+ SoapError(h, 705, "ConnectionSetupInProgress");
+ return;
+ }
+ if(getWanStatus() == 4)/* Disconnecting */
+ {
+ SoapError(h, 707, "DisconnectInProgress");
+ return;
+ }
+ if(startConnection() < 0) {
+ SoapError(h, 501, "Action Failed");
+ return;
+ }
+
+ BuildSendAndCloseSoapResp(h, resp, sizeof(resp)-1);
+#endif
}
/* Added for compliance with WANIPConnection v2 */
static void
ForceTermination(struct upnphttp * h, const char * action)
{
+#ifndef QCMAP
UNUSED(action);
SoapError(h, 606, "Action not authorized");
+#else
+ static const char resp[] =
+ "<u:ForceTerminationResponse "
+ "xmlns:u=\"" SERVICE_TYPE_WANIPC "\">"
+ "</u:ForceTerminationResponse>";
+
+ if(getWanStatus() == 4)/* Disconnecting */
+ {
+ SoapError(h, 707, "DisconnectInProgress");
+ return;
+ }
+ if(getWanStatus() == 5)/* Disconnected */
+ {
+ SoapError(h, 711, "ConnectionAlreadyTerminated");
+ return;
+ }
+ if(stopConnection() < 0) {
+ SoapError(h, 501, "Action Failed");
+ return;
+ }
+
+ BuildSendAndCloseSoapResp(h, resp, sizeof(resp)-1);
+#endif
}
/*
--
1.7.8.3