mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 09:52:27 +00:00
Fix bgp ipv4/ipv6 accept handling
When bgp calls getaddrinfo, it gets both ipv6 and ipv4 addresses. Unless IPV6_ONLY is set on Linux, only the ipv6 bind will succeed, and the IPV4 connections will come in as mapped connections on the IPV6 socket.
This commit is contained in:
parent
21b86436a8
commit
e9a3670706
@ -412,6 +412,15 @@ bgp_socket (struct bgp *bgp, unsigned short port, char *address)
|
|||||||
setsockopt_ipv4_tos (sock, IPTOS_PREC_INTERNETCONTROL);
|
setsockopt_ipv4_tos (sock, IPTOS_PREC_INTERNETCONTROL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef IPV6_V6ONLY
|
||||||
|
/* Want only IPV6 on ipv6 socket (not mapped addresses) */
|
||||||
|
if (ainfo->ai_family == AF_INET6) {
|
||||||
|
int on = 1;
|
||||||
|
setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY,
|
||||||
|
(void *) &on, sizeof (on));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (bgpd_privs.change (ZPRIVS_RAISE) )
|
if (bgpd_privs.change (ZPRIVS_RAISE) )
|
||||||
zlog_err ("bgp_socket: could not raise privs");
|
zlog_err ("bgp_socket: could not raise privs");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user