summaryrefslogtreecommitdiff
path: root/package/supl/patches
diff options
context:
space:
mode:
Diffstat (limited to 'package/supl/patches')
-rw-r--r--package/supl/patches/patch-configure11
-rw-r--r--package/supl/patches/patch-src_Makefile16
-rw-r--r--package/supl/patches/patch-src_supl-client_c40
-rw-r--r--package/supl/patches/patch-src_supl_c46
-rw-r--r--package/supl/patches/patch-src_supl_h19
5 files changed, 132 insertions, 0 deletions
diff --git a/package/supl/patches/patch-configure b/package/supl/patches/patch-configure
new file mode 100644
index 000000000..1c8f24d49
--- /dev/null
+++ b/package/supl/patches/patch-configure
@@ -0,0 +1,11 @@
+--- trunk.orig/configure 2011-10-25 21:41:03.000000000 +0200
++++ trunk/configure 2015-02-27 19:33:11.000000000 +0100
+@@ -91,7 +91,7 @@ cat <<EOF > config.mk
+ # Modifications to this file are lost if ./configure is ran again.
+
+ CONF_VERSION = 1.0.5
+-CONF_CFLAGS = -Wall -O2 $var_debug
++CONF_CFLAGS = -Wall $var_debug
+ CONF_ASN_CFLAGS = $var_asn1_debug
+ CONF_PREFIX = $var_prefix
+ CONF_PRECOMPILED_ASN = $var_precompiled_asn
diff --git a/package/supl/patches/patch-src_Makefile b/package/supl/patches/patch-src_Makefile
new file mode 100644
index 000000000..cec5a4771
--- /dev/null
+++ b/package/supl/patches/patch-src_Makefile
@@ -0,0 +1,16 @@
+ - use pkg-config everywhere, otherwise libs are not found
+--- trunk.orig/src/Makefile 2011-10-17 20:09:22.000000000 +0200
++++ trunk/src/Makefile 2015-02-09 16:48:37.244935714 +0100
+@@ -21,10 +21,10 @@ DIST = Makefile $(PROGRAM_SOURCE) $(SUPL
+ all: supl-client supl-proxy supl-cert
+
+ supl-client: libsupl.so supl-client.o
+- $(CC) -o $@ supl-client.o -L. -lsupl -lssl -lm
++ $(CC) -o $@ supl-client.o -L. -lsupl $(shell pkg-config --libs openssl) -lm
+
+ supl-proxy: libsupl.so supl-proxy.o
+- $(CC) -o $@ supl-proxy.o -L. -lsupl -lssl -lm
++ $(CC) -o $@ supl-proxy.o -L. -lsupl $(shell pkg-config --libs openssl) -lm
+
+ supl-cert: supl-cert.o
+ $(CC) -o $@ supl-cert.o $(shell pkg-config --libs openssl) -lm
diff --git a/package/supl/patches/patch-src_supl-client_c b/package/supl/patches/patch-src_supl-client_c
new file mode 100644
index 000000000..15e2fa727
--- /dev/null
+++ b/package/supl/patches/patch-src_supl-client_c
@@ -0,0 +1,40 @@
+ - implement bind to device functionality
+--- trunk.orig/src/supl-client.c 2011-10-21 20:51:38.000000000 +0200
++++ trunk/src/supl-client.c 2013-04-24 18:55:01.937252375 +0200
+@@ -252,6 +252,7 @@ static char *usage_str =
+ " --cell gsm:mcc,mns:lac,ci|wcdma:mcc,msn,uc set current gsm/wcdma cell id\n"
+ " --cell gsm:mcc,mns:lac,ci:lat,lon,uncert set known gsm cell id with position\n"
+ " --format|-f human machine parseable output\n"
++" --interface|-i iface bind to this interface\n"
+ " --debug|-d <n> 1 == RRLP, 2 == SUPL, 4 == DEBUG\n"
+ " --debug-file file write debug to file\n"
+ " --help|-h show this help\n"
+@@ -267,6 +268,7 @@ static struct option long_opts[] = {
+ { "cell", 1, 0, 0 },
+ { "debug", 1, 0, 'd' },
+ { "format", 1, 0, 'f' },
++ { "interface", 1, 0, 0},
+ { "test", 1, 0, 't' },
+ { "set-pos", 1, 0, 0 },
+ { "pos-helper", 1, 0, 0 },
+@@ -310,7 +312,7 @@ int main(int argc, char *argv[]) {
+ int opt_index;
+ int c;
+
+- c = getopt_long(argc, argv, "ad:f:t:", long_opts, &opt_index);
++ c = getopt_long(argc, argv, "ad:f:i:t:", long_opts, &opt_index);
+ if (c == -1) break;
+ switch (c) {
+ case 0:
+@@ -374,6 +376,11 @@ int main(int argc, char *argv[]) {
+ }
+ break;
+
++ case 'i':
++ strncpy(ctx.iface, optarg, IFNAMSIZ);
++ ctx.iface[IFNAMSIZ] = 0;
++ break;
++
+ case 'd':
+ {
+ int debug = atoi(optarg);
diff --git a/package/supl/patches/patch-src_supl_c b/package/supl/patches/patch-src_supl_c
new file mode 100644
index 000000000..26ab45b18
--- /dev/null
+++ b/package/supl/patches/patch-src_supl_c
@@ -0,0 +1,46 @@
+ - implement bind to device functionality
+--- trunk.orig/src/supl.c 2011-10-27 20:41:19.000000000 +0200
++++ trunk/src/supl.c 2013-04-24 18:56:17.742529773 +0200
+@@ -41,7 +41,7 @@ static struct supl_debug_s {
+ } debug;
+ #endif
+
+-static int server_connect(char *server);
++static int server_connect(char *server, char *iface);
+ static int pdu_make_ulp_start(supl_ctx_t *ctx, supl_ulp_t *pdu);
+ static int pdu_make_ulp_pos_init(supl_ctx_t *ctx, supl_ulp_t *pdu);
+ static int pdu_make_ulp_rrlp_ack(supl_ctx_t *ctx, supl_ulp_t *pdu, PDU_t *rrlp);
+@@ -236,7 +236,7 @@ int EXPORT supl_server_connect(supl_ctx_
+ if (!ctx->ssl) return E_SUPL_CONNECT;
+
+ if (server) {
+- ctx->fd = server_connect(server);
++ ctx->fd = server_connect(server, ctx->iface);
+ if (ctx->fd == -1) return E_SUPL_CONNECT;
+ }
+
+@@ -266,7 +266,7 @@ void EXPORT supl_close(supl_ctx_t *ctx)
+ }
+
+
+-static int server_connect(char *server) {
++static int server_connect(char *server, char *iface) {
+ int fd = -1;
+ struct addrinfo *ailist, *aip;
+ struct addrinfo hint;
+@@ -283,6 +283,15 @@ static int server_connect(char *server)
+ if ((fd = socket(aip->ai_family, SOCK_STREAM, 0)) < 0) {
+ err = errno;
+ }
++
++ if (strlen(iface)) {
++ struct ifreq ifr;
++ strncpy(ifr.ifr_name, iface, IFNAMSIZ);
++ ifr.ifr_name[IFNAMSIZ - 1] = 0;
++ if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)))
++ fprintf(stderr, "Error: binding to device %s failed\n", iface);
++ }
++
+ if (connect(fd, aip->ai_addr, aip->ai_addrlen) != 0) {
+ return -1;
+ }
diff --git a/package/supl/patches/patch-src_supl_h b/package/supl/patches/patch-src_supl_h
new file mode 100644
index 000000000..c2e9e8da4
--- /dev/null
+++ b/package/supl/patches/patch-src_supl_h
@@ -0,0 +1,19 @@
+ - implement bind to device functionality
+--- trunk.orig/src/supl.h 2011-10-21 20:08:29.000000000 +0200
++++ trunk/src/supl.h 2013-04-24 18:52:14.916232733 +0200
+@@ -19,6 +19,7 @@
+ #include <openssl/ssl.h>
+ #include <PDU.h>
+ #include <ULP-PDU.h>
++#include <net/if.h>
+
+ #define SUPL_PORT "7275"
+
+@@ -204,6 +205,7 @@ typedef struct supl_ctx_s {
+ size_t size;
+ } slp_session_id;
+
++ char iface[IFNAMSIZ + 1];
+ } supl_ctx_t;
+
+ int supl_ctx_new(supl_ctx_t *ctx);