summaryrefslogtreecommitdiff
path: root/bgpd/bgp_network.h
AgeCommit message (Collapse)Author
2023-09-18bgpd: Set TCP min MSS per listenerDonatas Abraitis
Set only if at least one peer is in passive mode. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-10bgpd: Convert bgp_network.c to use peer_connectionDonald Sharp
Modify bgp_network.c to use a peer_connection as it's prime parameters. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-09-10bgpd: bgp_connect is struct peer_connection orientedDonald Sharp
Make it so. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-06-16bmp: add a interface source to bmp connect commandFrancois Dumontet
With current release, forcin the source ip address when setting up a BMP connection is not possible. The need is to add an extra parameter for the following vty command: router bgp 65500 bmp targets AAA bmp connect 2.2.2.2 port 666 min-retry 100 max-retry 700 bmp connect 2:2::2:2 port 666 min-retry 100 max-retry 700 [source-interface lo1] Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2022-01-17bgpd: Relax peer to be on the same hostDonatas Abraitis
If the existing listener is the same as the peer, treat as self and reject. ``` exit1-debian-11# sh bgp listeners Name fd Address --------------------------- default 24 192.168.10.123 exit1-debian-11# con exit1-debian-11(config)# router bgp exit1-debian-11(config-router)# neighbor 192.168.10.123 remote-as external % Can not configure the local system as neighbor exit1-debian-11# sh bgp listeners Name fd Address --------------------------- default 24 0.0.0.0 default 25 :: exit1-debian-11# con exit1-debian-11(config)# router bgp exit1-debian-11(config-router)# neighbor 192.168.10.123 remote-as external % Can not configure the local system as neighbor exit1-debian-11(config-router)# exit1-debian-11# sh bgp listeners Name fd Address --------------------------- default 24 192.168.0.1 exit1-debian-11# con exit1-debian-11(config)# router bgp exit1-debian-11(config-router)# neighbor 192.168.10.123 remote-as external exit1-debian-11(config-router)# ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-09-01bgpd: associate listener with the appropriate bgp instancePat Ruddy
When setting authentication on a BGP peer in a VRF the listener is looked up from a global list. However there is no check that the listener is the one associated with the VRF being configured. This can result in the wrong listener beiong configured with a password, leaving the intended listener in an open authentication state. To simplify this lookup stash a pointer to the bgp instance in the listener on creating (in the same way as is done for NS-based VRFS). Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-03-10bgpd: Add 'show bgp listeners' command for diagnosticsDonald Sharp
Add a command to display listen sockets and the vrf that they are associated with. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-16bgpd: add support for MD5 auth on listen rangesQuentin Young
Co-authored-by: Donald Sharp <sharpd@cumulusnetworks.com> Co-authored-by: Quentin Young <qlyoung@cumulusnetworks.com> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-02-27bgpd: server socket is created for all enabled VRFPhilippe Guibert
Upon creation of BGP instances, server socket may or may not be created. In the case of VRF instances, if the VRF backend relies on NETNS, then a new server socket will be created for each BGP VRF instance. If the VRF backend relies on VRF LITE, then only one server socket will be enough. Moreover, At startup, with BGP VRF configuration, a server socket may not be created if VRF is not the default one or VRF is not recognized yet. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-02-27bgpd: bgp support for netnsPhilippe Guibert
The change contained in this commit does the following: - discovery of vrf id from zebra daemon, and adaptation of bgp contexts with BGP. The list of network addresses contain a reference to the bgp context supporting the vrf. The bgp context contains a vrf pointer that gives information about the netns path in case the vrf is a netns path. Only some contexts are impacted, namely socket creation, and retrieval of local IP settings. ( this requires vrf identifier). Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2015-08-29BGP: Fix MD5 authentication for unnumbered neighborsvivek
Ticket: CM-6369 Reviewed By: CCR-3318 Testing Done: Manual testing of various password scenarios. This is a port of patch bgpd-unnumbered-nbr-fix-password.patch from 2.5-br. In the case of BGP unnumbered, the peer IP address is derived and not explicitly configured. If there is a password configured for the peer, it can be set on the listen socket only after the IP address has been derived and needs to be cleared when the IP address goes away.
2015-05-19bgpd-ebgp-multihop-fix.patchDonald Sharp
BGP: Fix EBGP multihop transitions correctly Since BGP connection setup has migrated to using NHT to decide when to bring a session up, we have to handle ebgp multihop transitions correctly to ensure NHT registrations are correctly handled. Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19bgpd: bgpd-fsm-fix.patchDonald Sharp
BGP: Fix FSM to handle active/passive connections better The existing code didn't work well when dual connections resulted between peers during session bringup. This patch fixes that. Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2014-05-15bgpd: increase TCP socket buffer sizeVipin Kumar
BGP does not respond fairly in high scale. As the number of BGP peers and prefixes increase, triggers like interface flaps which lead to BGP peer flaps, cause blockage in bgp_write. BGP does handle the cases of TCP socket buffer full by queuing a write event back, there is no functional issue there as such. Still, increasing the peer socket buffer size should help reduce event queueing in BGP. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com> Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com> [DL: patch split, this is item 3.] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2009-07-28bgpd: start listener on first instanceStephen Hemminger
Start BGP listener only after first instance is started. This helps the security if BGP is not used but daemon is started. It also addresses some issues like MD5 not working on listener unless IPV6 configured (because listener was not in list); as well as compiler warnings. * bgp_network.c: (bgp_listener) listen socket creation consolidated here (bgp_socket) Use bgp_listener * bgpd.c: (bgp_get) call bgp_socket on creation of first struct bgp. (bgp_init) remove bgp_socket call. * memtypes.c: Add MTYPE_BGP_LISTENER
2008-07-21[bgpd] TCP-MD5: password vty configuration and initial Linux supportPaul Jakma
2008-07-21 Paul Jakma <paul.jakma@sun.com> * bgp_packet.c: (bgp_open_receive) fix warning in a zlog call * bgp_vty.c: (bgp_vty_return) add return code * bgpd.c: (bgp_master_init) setup the socket list. * bgp_network.c: Remove the dual IPv4/6 socket thing for now, which was implemented by Michael, until such time as its clear its required for Linux (see sockopt comments). IPv6 support, including IPv4 sessions on AF_INET6 sockets, therefore is broken, and the '-l 0.0.0.0' arguments would need to be given to bgpd to make things work here. 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Tomohiko Kusuda <kusuda@inetcore.com> Leigh Brown <leigh@solinno.co.uk> * bgp_network.c: (bgp_md5_set_one) shim between libzebra tcp-md5 sockopt and bgpd. (bgp_md5_set_socket) Helper for bgp_connect (bgp_md5_set) setup TCP-MD5SIG for the given peer. (bgp_connect) call out to bgp_md5_set_socket for the outgoing connect socket. (bgp_socket) save references to the listen sockets, needed if TCP-MD5SIG is applied later or changed. * bgp_vty.c: (*neighbor_password_cmd) New 'neighbor ... password' commands. * bgpd.c: (peer_{new,delete) manage TCP-MD5 password (peer_group2peer_config_copy) inherit TCP-MD5 password (peer_password_{un,}set) orchestrate the whole add/remove of TCP-MD5 passwords: applying checks, stopping peers, and trying to return errors to UI, etc. (bgp_config_write_peer) save password. Fix missing newline in writeout of neighbor ... port. 2008-07-21 Paul Jakma <paul.jakma@sun.com> * sockunion.c: ifdef out various places that converted v4mapped sockets to pure v4. Doesn't seem necessary at all, presumably a workaround for now historical inet_ntop bugs (?) 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> * sockopt.{c,h}: (sockopt_tcp_signature) Add TCP-MD5SIG support.
2007-11-012007-10-30 Nick Hilliard <nick@inex.ie>Paul Jakma
* bgp_main.c: Add 'listenon' argument, to pass address to bind to. * bgp_network.c: (bgp_socket) Extend to take bind address. * bgpd.c: (bgp_init) Pass stored address. * bgpd.h: (struct bgp_master) storage for bind address 2007-11-01 Paul Jakma <paul.jakma@sun.com> * tools/multiple-bgpd.sh: New, quick script to launch a bunch of bgpds.
2005-06-282005-06-28 Paul Jakma <paul.jakma@sun.com>paul
* (global) The great bgpd extern and static'ification. * bgp_routemap.c: remove unused ROUTE_MATCH_ASPATH_OLD code (route_set_metric_compile) fix u_int32_t to ULONG_MAX comparison warnings. * bgp_route.h: (bgp_process, bgp_withdraw, bgp_update) export these used by various files which had their own private declarations, in the case of mplsvpn - incorrect.
2005-05-232005-05-23 Paul Jakma <paul@dishone.st>paul
* bgp_fsm.h: Add extern qualifier to exported functions * bgp_nexthop.c: add static to nexthop specific globals * *.h: Add guard defines
2002-12-13Initial revisionpaul