[gssdp/wip/ipv6: 2/3] wip: Add max hops for v6



commit 4419e59f26e62640784ca4f47c768197ebf85611
Author: Jens Georg <mail jensge org>
Date:   Thu Feb 18 11:20:17 2016 +0100

    wip: Add max hops for v6
    
    Signed-off-by: Jens Georg <mail jensge org>

 libgssdp/gssdp-socket-source.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/libgssdp/gssdp-socket-source.c b/libgssdp/gssdp-socket-source.c
index c677ea4..e01807b 100644
--- a/libgssdp/gssdp-socket-source.c
+++ b/libgssdp/gssdp-socket-source.c
@@ -225,9 +225,14 @@ gssdp_socket_source_do_init (GInitable                   *initable,
         }
 
         /* TTL */
-        if (!self->priv->ttl)
+        if (self->priv->ttl == 0) {
                 /* UDA/1.0 says 4, UDA/1.1 says 2 */
                 self->priv->ttl = 4;
+                if (family == G_SOCKET_FAMILY_IPV6) {
+                        /* UDA 2.0, Annex A says 10 hops */
+                        self->priv->ttl = 10;
+                }
+        }
 
         g_socket_set_multicast_ttl (self->priv->socket, self->priv->ttl);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]