--- gio/gipv6tclassmessage.c.orig	2026-05-02 20:26:52.000000000 +0800
+++ gio/gipv6tclassmessage.c	2026-05-06 19:21:50.000000000 +0800
@@ -70,7 +70,11 @@
 static int
 g_ipv6_tclass_message_get_msg_type (GSocketControlMessage *message)
 {
+#ifdef IPV6_TCLASS
   return IPV6_TCLASS;
+#else
+  return -1;
+#endif
 }
 
 static void
@@ -82,6 +86,7 @@
 static GSocketControlMessage *
 g_ipv6_tclass_message_deserialize (gint level, gint type, gsize size, gpointer data)
 {
+#ifdef IPV6_TCLASS
   GIPv6TclassMessage *message;
 
   if (level != IPPROTO_IPV6 || type != IPV6_TCLASS)
@@ -94,6 +99,9 @@
   message->tclass = *(int *) data;
 
   return G_SOCKET_CONTROL_MESSAGE (message);
+#else
+  return NULL;
+#endif
 }
 
 static void
