diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2011-01-17 14:54:51 -0500 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2011-01-17 14:54:51 -0500 |
commit | 7c1e02a931cb249ac17a4a5663f1bc86f5371aca (patch) | |
tree | c3de96aee33f2f5a0eb0c34237354a4553bb653f | |
parent | 251a7c4bf1817a98140ab1ca80a0c636945d65bb (diff) | |
download | gupnp-igd-7c1e02a931cb249ac17a4a5663f1bc86f5371aca.tar.gz |
Correctly give GError if the local router gives a bogus reply
-rw-r--r-- | libgupnp-igd/gupnp-simple-igd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libgupnp-igd/gupnp-simple-igd.c b/libgupnp-igd/gupnp-simple-igd.c index d9a421f..fc8c9a5 100644 --- a/libgupnp-igd/gupnp-simple-igd.c +++ b/libgupnp-igd/gupnp-simple-igd.c @@ -617,12 +617,14 @@ _service_proxy_got_external_ip_address (GUPnPServiceProxy *proxy, for (i=0; i < prox->proxymappings->len; i++) { struct ProxyMapping *pm = g_ptr_array_index (prox->proxymappings, i); - - g_signal_emit (self, signals[SIGNAL_ERROR_MAPPING_PORT], - GUPNP_SIMPLE_IGD_ERROR, GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS, - pm->mapping->protocol, pm->mapping->requested_external_port, - pm->mapping->local_ip, pm->mapping->local_port, - pm->mapping->description); + GError gerror = {GUPNP_SIMPLE_IGD_ERROR, + GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS, + "Invalid IP address returned by router"}; + + g_signal_emit (self, signals[SIGNAL_ERROR_MAPPING_PORT], 0, + &gerror, pm->mapping->protocol, + pm->mapping->requested_external_port, pm->mapping->local_ip, + pm->mapping->local_port, pm->mapping->description); } return; } |