summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_network.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_network.c')
-rw-r--r--bgpd/bgp_network.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index 9a49051a9..1358ebc5e 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -598,10 +598,8 @@ bgp_connect (struct peer *peer)
zlog_err ("%s: could not raise privs", __func__);
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
if (bgpd_privs.change (ZPRIVS_LOWER))
zlog_err ("%s: could not lower privs", __func__);
#endif
@@ -618,10 +616,8 @@ bgp_connect (struct peer *peer)
return connect_error;
}
-#ifdef HAVE_IPV6
if (peer->conf_if || peer->ifname)
ifindex = ifname2ifindex (peer->conf_if ? peer->conf_if : peer->ifname);
-#endif /* HAVE_IPV6 */
if (bgp_debug_neighbor_events(peer))
zlog_debug ("%s [Event] Connect start to %s fd %d",
@@ -681,10 +677,8 @@ 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
sockopt_v6only (sa->sa_family, sock);
@@ -717,7 +711,6 @@ bgp_listener (int sock, struct sockaddr *sa, socklen_t salen)
}
/* IPv6 supported version of BGP server socket setup. */
-#ifdef HAVE_IPV6
int
bgp_socket (unsigned short port, const char *address)
{
@@ -774,50 +767,6 @@ bgp_socket (unsigned short port, const char *address)
return 0;
}
-#else
-/* Traditional IPv4 only version. */
-int
-bgp_socket (unsigned short port, const char *address)
-{
- int sock;
- int socklen;
- struct sockaddr_in sin;
- int ret;
-
- sock = socket (AF_INET, SOCK_STREAM, 0);
- if (sock < 0)
- {
- zlog_err ("socket: %s", safe_strerror (errno));
- return sock;
- }
-
- /* if we intend to implement ttl-security, this socket needs ttl=255 */
- sockopt_ttl (AF_INET, sock, MAXTTL);
-
- memset (&sin, 0, sizeof (struct sockaddr_in));
- sin.sin_family = AF_INET;
- sin.sin_port = htons (port);
- socklen = sizeof (struct sockaddr_in);
-
- if (address && ((ret = inet_aton(address, &sin.sin_addr)) < 1))
- {
- zlog_err("bgp_socket: could not parse ip address %s: %s",
- address, safe_strerror (errno));
- return ret;
- }
-#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
- sin.sin_len = socklen;
-#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
-
- ret = bgp_listener (sock, (struct sockaddr *) &sin, socklen);
- if (ret < 0)
- {
- close (sock);
- return ret;
- }
- return sock;
-}
-#endif /* HAVE_IPV6 */
void
bgp_close (void)