sunrpc: Use helper to set v4 mapped addr in ip_map_parse
authorPavel Emelyanov <xemul@parallels.com>
Tue, 5 Oct 2010 16:48:02 +0000 (20:48 +0400)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 12 Oct 2010 00:00:17 +0000 (20:00 -0400)
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/svcauth_unix.c

index 8b378f91f255f34a14b51b73407d9a022cbc0591..560677d187f1b0fc7eb3d72c119aa848eb306145 100644 (file)
@@ -220,10 +220,9 @@ static int ip_map_parse(struct cache_detail *cd,
        switch (address.sa.sa_family) {
        case AF_INET:
                /* Form a mapped IPv4 address in sin6 */
-               memset(&sin6, 0, sizeof(sin6));
                sin6.sin6_family = AF_INET6;
-               sin6.sin6_addr.s6_addr32[2] = htonl(0xffff);
-               sin6.sin6_addr.s6_addr32[3] = address.s4.sin_addr.s_addr;
+               ipv6_addr_set_v4mapped(address.s4.sin_addr.s_addr,
+                               &sin6.sin6_addr);
                break;
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
        case AF_INET6: