]> granicus.if.org Git - libtirpc/commitdiff
Add missing INET6 conditional
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 13 Nov 2012 18:36:48 +0000 (13:36 -0500)
committerSteve Dickson <steved@redhat.com>
Tue, 13 Nov 2012 18:36:48 +0000 (13:36 -0500)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
src/rpc_generic.c
src/svc_dg.c

index 509fb36d5ae5ffbdf5e48d0aaab4880be262f104..2eb91ad0b75c882f62e8f8e455ae6f1f927a4310 100644 (file)
@@ -535,7 +535,9 @@ __rpc_nconf2fd_flags(const struct netconfig *nconf, int flags)
            si.si_af == AF_INET6) {
                int val = 1;
 
+#ifdef INET6
                setsockopt(fd, SOL_IPV6, IPV6_V6ONLY, &val, sizeof(val));
+#endif
        }
        return fd;
 }
index a79a70d5cbc125c487148eaf06fb52329b74ec47..b1ac462969af0bfa791f97e369e93edb8567cec4 100644 (file)
@@ -653,10 +653,11 @@ svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
        case AF_INET:
                (void) setsockopt(fd, SOL_IP, IP_PKTINFO, &val, sizeof(val));
                break;
-
+#ifdef INET6
        case AF_INET6:
                (void) setsockopt(fd, SOL_IPV6, IPV6_RECVPKTINFO, &val, sizeof(val));
                break;
+#endif
        }
 }
 
@@ -694,6 +695,7 @@ svc_dg_valid_pktinfo(struct msghdr *msg)
                }
                break;
 
+#ifdef INET6
        case AF_INET6:
                if (cmsg->cmsg_level != SOL_IPV6
                 || cmsg->cmsg_type != IPV6_PKTINFO
@@ -706,6 +708,7 @@ svc_dg_valid_pktinfo(struct msghdr *msg)
                        pkti->ipi6_ifindex = 0;
                }
                break;
+#endif
 
        default:
                return 0;