Blame SOURCES/rpcbind-0.2.0-warnings.patch

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