summaryrefslogtreecommitdiff
path: root/bgpd/bgp_network.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_network.c')
-rw-r--r--bgpd/bgp_network.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index 9e3427d2..b5fa948c 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -322,6 +322,10 @@ bgp_connect (struct peer *peer)
#ifdef IPTOS_PREC_INTERNETCONTROL
if (sockunion_family (&peer->su) == AF_INET)
setsockopt_ipv4_tos (peer->fd, IPTOS_PREC_INTERNETCONTROL);
+# ifdef HAVE_IPV6
+ else if (sockunion_family (&peer->su) == AF_INET6)
+ setsockopt_ipv6_tclass (peer->fd, IPTOS_PREC_INTERNETCONTROL);
+# endif
#endif
if (peer->password)
@@ -381,6 +385,10 @@ bgp_listener (int sock, struct sockaddr *sa, socklen_t salen)
#ifdef IPTOS_PREC_INTERNETCONTROL
if (sa->sa_family == AF_INET)
setsockopt_ipv4_tos (sock, IPTOS_PREC_INTERNETCONTROL);
+# ifdef HAVE_IPV6
+ else if (sa->sa_family == AF_INET6)
+ setsockopt_ipv6_tclass (sock, IPTOS_PREC_INTERNETCONTROL);
+# endif
#endif
#ifdef IPV6_V6ONLY