[ORBit2] Fix link_protocol_is_local_ipv46 for ipv4 on some ipv6-enabled machines



commit 623749eb6e2a87f6a8723b68e0d224b8ea08ff60
Author: Alexandre Rostovtsev <tetromino gentoo org>
Date:   Tue Feb 12 00:27:41 2013 -0500

    Fix link_protocol_is_local_ipv46 for ipv4 on some ipv6-enabled machines
    
    Ensure that saddr is compared to an ipv4 local_addr, not to an ipv6 one,
    by setting hints.ai_family before calling getaddrinfo().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693636

 linc2/src/linc-protocols.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/linc2/src/linc-protocols.c b/linc2/src/linc-protocols.c
index e6895f4..22a77aa 100644
--- a/linc2/src/linc-protocols.c
+++ b/linc2/src/linc-protocols.c
@@ -383,6 +383,7 @@ link_protocol_is_local_ipv46 (const LinkProtocolInfo *proto,
 		memset(&hints, 0, sizeof(hints));
 		hints.ai_socktype = SOCK_STREAM;
 		hints.ai_flags = AI_CANONNAME;
+		hints.ai_family = proto->family;
 
 		if (getaddrinfo(link_get_local_hostname(), NULL, &hints, &local_addr) != 0) {
 			if (!warned++)


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