]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix build failure on systems missing IPV6_TCLASS
authorMike Miller <mtmiller@debian.org>
Thu, 10 Jan 2019 20:14:58 +0000 (12:14 -0800)
committerDavid Woodhouse <dwmw2@infradead.org>
Thu, 10 Jan 2019 23:57:03 +0000 (23:57 +0000)
Some operating systems such as GNU/Hurd support IPv6 but do not define
the IPV6_TCLASS socket option.

Signed-off-by: Mike Miller <mtmiller@debian.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
ssl.c

diff --git a/ssl.c b/ssl.c
index 6bcb5e0a1efcfc65f6818f7e45e89c19a1d6e5de..29250a09bb6d89f30a3da91632db388fe36ebd79 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -913,8 +913,10 @@ int udp_sockaddr(struct openconnect_info *vpninfo, int port)
        } else if (vpninfo->peer_addr->sa_family == AF_INET6) {
                struct sockaddr_in6 *sin = (void *)vpninfo->dtls_addr;
                sin->sin6_port = htons(port);
+#if defined(IPV6_TCLASS)
                vpninfo->dtls_tos_proto = IPPROTO_IPV6;
                vpninfo->dtls_tos_optname = IPV6_TCLASS;
+#endif
        } else {
                vpn_progress(vpninfo, PRG_ERR,
                             _("Unknown protocol family %d. Cannot create UDP server address\n"),