diff options
author | Robert Swain <robert.swain@ericsson.com> | 2015-05-07 07:37:02 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-10-22 16:05:28 +0300 |
commit | 62b41b08ea1ccbcd3066e24d00fd76fea00dd32b (patch) | |
tree | e6dd878aa2ffe5e77b01fd592d704875d56889ae | |
parent | cedbf84355a9122612018b8c0560608d5f855676 (diff) |
libnice: Pull in patches that fix crashes and other bugs
6 files changed, 153 insertions, 0 deletions
diff --git a/recipes/libnice-static.recipe b/recipes/libnice-static.recipe index 634e2a91..9c261eb2 100644 --- a/recipes/libnice-static.recipe +++ b/recipes/libnice-static.recipe @@ -11,9 +11,15 @@ class Recipe(custom.GStreamerStatic): extra_configure_options = ' --without-gstreamer-0.10 \ --enable-compile-warnings=maximum' deps = ['glib', 'gtk-doc-lite', 'gstreamer-1.0'] + autoreconf = True patches = [ + "libnice/0001-agent-Remove-unnecessary-NULL-check.patch", + "libnice/0002-Do-not-update-a-remote-candidate-s-type.patch", + "libnice/0003-Do-not-compare-scope-for-IPv6-address-when-scope-is-.patch", + "libnice/0004-Removing-no-op-assignment.patch", "libnice/0001-nicesrc-spin-the-agent-mainloop-in-a-separate-thread.patch" ] + files_plugins_net_devel = ['libgstnice'] # FIXME - if_arp.h? (iOS) diff --git a/recipes/libnice.recipe b/recipes/libnice.recipe index 41dd6d89..6179d24f 100644 --- a/recipes/libnice.recipe +++ b/recipes/libnice.recipe @@ -10,7 +10,12 @@ class Recipe(recipe.Recipe): --without-gstreamer-0.10 --enable-compile-warnings=maximum \ --disable-gtk-doc' deps = ['glib', 'gtk-doc-lite', 'gstreamer-1.0'] + autoreconf = True patches = [ + "libnice/0001-agent-Remove-unnecessary-NULL-check.patch", + "libnice/0002-Do-not-update-a-remote-candidate-s-type.patch", + "libnice/0003-Do-not-compare-scope-for-IPv6-address-when-scope-is-.patch", + "libnice/0004-Removing-no-op-assignment.patch", "libnice/0001-nicesrc-spin-the-agent-mainloop-in-a-separate-thread.patch" ] diff --git a/recipes/libnice/0001-agent-Remove-unnecessary-NULL-check.patch b/recipes/libnice/0001-agent-Remove-unnecessary-NULL-check.patch new file mode 100644 index 00000000..b4ecf8c7 --- /dev/null +++ b/recipes/libnice/0001-agent-Remove-unnecessary-NULL-check.patch @@ -0,0 +1,44 @@ +From 7b7d2d986876fc53a23af7b516d78f82f2a546e9 Mon Sep 17 00:00:00 2001 +From: Philip Withnall <philip@tecnocode.co.uk> +Date: Sun, 3 May 2015 16:05:30 +0100 +Subject: [PATCH 1/4] agent: Remove unnecessary NULL check + +With the changes in commit 483bdcf8, @name is now guaranteed to be +non-NULL. Spotted by Coverity. + +CID: #109878 +--- + agent/agent.c | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/agent/agent.c b/agent/agent.c +index 259fdc9..e733c82 100644 +--- a/agent/agent.c ++++ b/agent/agent.c +@@ -5329,16 +5329,14 @@ nice_agent_set_stream_name (NiceAgent *agent, guint stream_id, + + agent_lock(); + +- if (name != NULL) { +- for (i = agent->streams; i; i = i->next) { +- Stream *stream = i->data; ++ for (i = agent->streams; i; i = i->next) { ++ Stream *stream = i->data; + +- if (stream->id != stream_id && +- g_strcmp0 (stream->name, name) == 0) +- goto done; +- else if (stream->id == stream_id) +- stream_to_name = stream; +- } ++ if (stream->id != stream_id && ++ g_strcmp0 (stream->name, name) == 0) ++ goto done; ++ else if (stream->id == stream_id) ++ stream_to_name = stream; + } + + if (stream_to_name == NULL) +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/libnice/0002-Do-not-update-a-remote-candidate-s-type.patch b/recipes/libnice/0002-Do-not-update-a-remote-candidate-s-type.patch new file mode 100644 index 00000000..81ca66c3 --- /dev/null +++ b/recipes/libnice/0002-Do-not-update-a-remote-candidate-s-type.patch @@ -0,0 +1,31 @@ +From 93862c1e1940618e06143d4788f54bffd4d1c5da Mon Sep 17 00:00:00 2001 +From: Youness Alaoui <kakaroto@kakaroto.homelinux.net> +Date: Tue, 5 May 2015 14:24:15 -0400 +Subject: [PATCH 2/4] Do not update a remote candidate's type + +When adding a remote candidate, if it's the same ip:port, we should +also check its type, otherwise it's a new candidate. We can't allow +a candidate type to be updated. This caused issues to ikonst_ on IRC +where for some reason a host candidate appeared as both host and prflx +and the update caused a remote host candidate to be updated to prflx +causing a crash when the sockptr was being accessed. +--- + agent/agent.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/agent/agent.c b/agent/agent.c +index e733c82..38b679f 100644 +--- a/agent/agent.c ++++ b/agent/agent.c +@@ -3041,7 +3041,7 @@ static gboolean priv_add_remote_candidate ( + + /* step: check whether the candidate already exists */ + candidate = component_find_remote_candidate(component, addr, transport); +- if (candidate) { ++ if (candidate && candidate->type == type) { + if (nice_debug_is_enabled ()) { + gchar tmpbuf[INET6_ADDRSTRLEN]; + nice_address_to_string (addr, tmpbuf); +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/libnice/0003-Do-not-compare-scope-for-IPv6-address-when-scope-is-.patch b/recipes/libnice/0003-Do-not-compare-scope-for-IPv6-address-when-scope-is-.patch new file mode 100644 index 00000000..806f9eb8 --- /dev/null +++ b/recipes/libnice/0003-Do-not-compare-scope-for-IPv6-address-when-scope-is-.patch @@ -0,0 +1,43 @@ +From 91a7b9324244844baf35d8fcef019a4ea3872d30 Mon Sep 17 00:00:00 2001 +From: Youness Alaoui <kakaroto@kakaroto.homelinux.net> +Date: Tue, 5 May 2015 15:00:30 -0400 +Subject: [PATCH 3/4] Do not compare scope for IPv6 address when scope is 0 + +This caused issues with thinking local host candidates were peer-reflexive +candidates because the nice_address_equal would fail since the scope +would be 6 (or some other value) but locally created NiceAddress from +a stun response would have the scope set to 0. +We ignore the scope when comparing ipv6 candidates when scope is 0 +to avoid these kinds of issues. +Thanks to ikonst_ for finding these issues +--- + agent/address.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/agent/address.c b/agent/address.c +index a8d9c76..01eebab 100644 +--- a/agent/address.c ++++ b/agent/address.c +@@ -297,7 +297,8 @@ nice_address_equal (const NiceAddress *a, const NiceAddress *b) + case AF_INET6: + return IN6_ARE_ADDR_EQUAL (&a->s.ip6.sin6_addr, &b->s.ip6.sin6_addr) + && (a->s.ip6.sin6_port == b->s.ip6.sin6_port) +- && (a->s.ip6.sin6_scope_id == b->s.ip6.sin6_scope_id); ++ && (a->s.ip6.sin6_scope_id == 0 || b->s.ip6.sin6_scope_id == 0 || ++ (a->s.ip6.sin6_scope_id == b->s.ip6.sin6_scope_id)); + + default: + g_return_val_if_reached (FALSE); +@@ -412,7 +413,8 @@ nice_address_equal_no_port (const NiceAddress *a, const NiceAddress *b) + + case AF_INET6: + return IN6_ARE_ADDR_EQUAL (&a->s.ip6.sin6_addr, &b->s.ip6.sin6_addr) +- && (a->s.ip6.sin6_scope_id == b->s.ip6.sin6_scope_id); ++ && (a->s.ip6.sin6_scope_id == 0 || b->s.ip6.sin6_scope_id == 0 || ++ (a->s.ip6.sin6_scope_id == b->s.ip6.sin6_scope_id)); + + default: + g_return_val_if_reached (FALSE); +-- +2.3.2 (Apple Git-55) + diff --git a/recipes/libnice/0004-Removing-no-op-assignment.patch b/recipes/libnice/0004-Removing-no-op-assignment.patch new file mode 100644 index 00000000..93bea920 --- /dev/null +++ b/recipes/libnice/0004-Removing-no-op-assignment.patch @@ -0,0 +1,24 @@ +From 6a8c63219c632c27707267b6510dca096c6fd511 Mon Sep 17 00:00:00 2001 +From: Youness Alaoui <kakaroto@kakaroto.homelinux.net> +Date: Tue, 5 May 2015 15:07:10 -0400 +Subject: [PATCH 4/4] Removing no-op assignment + +--- + agent/agent.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/agent/agent.c b/agent/agent.c +index 38b679f..84d4093 100644 +--- a/agent/agent.c ++++ b/agent/agent.c +@@ -3051,7 +3051,6 @@ static gboolean priv_add_remote_candidate ( + username, password, priority); + } + /* case 1: an existing candidate, update the attributes */ +- candidate->type = type; + if (base_addr) + candidate->base_addr = *base_addr; + candidate->priority = priority; +-- +2.3.2 (Apple Git-55) + |