-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BGP TCP non established : get port and ip #15686
Merged
ton31337
merged 2 commits into
FRRouting:master
from
pguibert6WIND:tcp_non_established_get_port_and_ip
Apr 15, 2024
Merged
BGP TCP non established : get port and ip #15686
ton31337
merged 2 commits into
FRRouting:master
from
pguibert6WIND:tcp_non_established_get_port_and_ip
Apr 15, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pguibert6WIND
changed the title
Tcp non established get port and ip
BGP TCP non established get port and ip
Apr 5, 2024
pguibert6WIND
changed the title
BGP TCP non established get port and ip
BGP TCP non established : get port and ip
Apr 5, 2024
ton31337
reviewed
Apr 5, 2024
pguibert6WIND
force-pushed
the
tcp_non_established_get_port_and_ip
branch
from
April 8, 2024 08:20
a6cee29
to
fde7905
Compare
ton31337
reviewed
Apr 11, 2024
When attempting to get the src and destination addresses of a given connection, the API may return the NULL pointer, but further code in bgp_zebra_nexthop_set() already does a check about the given pointer. Relaxing the error code for all the returned adressing. Fixes: 1ff9a34 ("bgpd: bgpd-fsm-fix.patch") Signed-off-by: Philippe Guibert <[email protected]>
When trying to connect to a BGP peer that does not respons, the 'show bgp neighbors' command does not give any indication on the local and remote addresses used: > # show bgp neighbors > BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link > Local Role: undefined > Remote Role: undefined > BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1 > BGP state = Connect > [..] > Connections established 0; dropped 0 > Last reset 00:00:04, Waiting for peer OPEN (n/a) > Internal BGP neighbor may be up to 255 hops away. > BGP Connect Retry Timer in Seconds: 120 > Next connect timer due in 117 seconds > Read thread: off Write thread: off FD used: 27 The addressing information (address and port) are only available when TCP session is established, whereas this information is present at the system level: > root@ubuntu2204:~# netstat -pan | grep 192.0.2.1 > tcp 0 0 192.0.2.1:179 192.0.2.150:38060 SYN_RECV - > tcp 0 1 192.0.2.1:46526 192.0.2.150:179 SYN_SENT 488310/bgpd Add the display for outgoing BGP session, as the information in the getsockname() API provides information for connected streams. When getpeername() API does not give any information, use the peer configuration (destination port is encoded in peer->port). > # show bgp neighbors > BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link > Local Role: undefined > Remote Role: undefined > BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1 > BGP state = Connect > [..] > Connections established 0; dropped 0 > Last reset 00:00:16, Waiting for peer OPEN (n/a) > Local host: 192.0.2.1, Local port: 46084 > Foreign host: 192.0.2.150, Foreign port: 179 Signed-off-by: Philippe Guibert <[email protected]>
pguibert6WIND
force-pushed
the
tcp_non_established_get_port_and_ip
branch
from
April 15, 2024 07:20
fde7905
to
78ce639
Compare
@Mergifyio backport stable/10.0 stable/9.1 stable/9.0 |
✅ Backports have been created
|
This was referenced Nov 11, 2024
2 tasks
riw777
added a commit
that referenced
this pull request
Nov 12, 2024
BGP TCP non established : get port and ip (backport #15686)
riw777
added a commit
that referenced
this pull request
Nov 12, 2024
BGP TCP non established : get port and ip (backport #15686)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On non established TCP sessions, the remote/local address/port information is not available.
However, for outgoing TCP connections, this is possible.
Lets do it.