Blame SOURCES/rpcbind-0.2.0-warnings.patch

23402f
commit d62f79d7905149719715f74c188b47d7911c928c
23402f
Author: Steve Dickson <steved@redhat.com>
23402f
Date:   Mon Aug 18 11:44:19 2014 -0400
23402f
23402f
    rpcbind: Remove a strict-aliasing warning
23402f
    
23402f
    src/util.c: In function ?in6_fillscopeid?:
23402f
    src/util.c:106:3: warning: dereferencing type-punned pointer will break
23402f
    strict-aliasing rules [-Wstrict-aliasing]
23402f
       ifindex = ntohs(*(u_int16_t *)&sin6->sin6_addr.s6_addr[2]);
23402f
       ^
23402f
    
23402f
    src/util.c:109:4: warning: dereferencing type-punned pointer will break
23402f
    strict-aliasing rules [-Wstrict-aliasing]
23402f
        *(u_int16_t *)&sin6->sin6_addr.s6_addr[2] = 0;
23402f
    
23402f
    Signed-off-by: Steve Dickson <steved@redhat.com>
23402f
23402f
diff --git a/src/util.c b/src/util.c
23402f
index 9a5fb69..7d56479 100644
23402f
--- a/src/util.c
23402f
+++ b/src/util.c
23402f
@@ -101,12 +101,14 @@ static void
23402f
 in6_fillscopeid(struct sockaddr_in6 *sin6)
23402f
 {
23402f
 	u_int16_t ifindex;
23402f
+	u_int16_t *addr;
23402f
 
23402f
         if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
23402f
-		ifindex = ntohs(*(u_int16_t *)&sin6->sin6_addr.s6_addr[2]);
23402f
+		addr = (u_int16_t *)&sin6->sin6_addr.s6_addr[2];
23402f
+		ifindex = ntohs(*addr);
23402f
 		if (sin6->sin6_scope_id == 0 && ifindex != 0) {
23402f
 			sin6->sin6_scope_id = ifindex;
23402f
-			*(u_int16_t *)&sin6->sin6_addr.s6_addr[2] = 0;
23402f
+			*addr = 0;
23402f
 		}
23402f
 	}
23402f
 }