Skip to content

Commit

Permalink
bgpd: Set extended msg size only if we advertised and received capabi…
Browse files Browse the repository at this point in the history
…lity

If we don't advertise any capabilities (dont-capability-negotiate), we
shouldn't set msg size to 65k only if received this capability from another
peer.

Before:

```
~/frr# vtysh -c 'show ip bgp update-group' | grep 'Max packet size'
    Max packet size: 65535
```

After:

```
~/frr# vtysh -c 'show ip bgp update-group' | grep 'Max packet size'
    Max packet size: 4096
```

Signed-off-by: Donatas Abraitis <[email protected]>
(cherry picked from commit 8d976b0)
  • Loading branch information
ton31337 authored and mergify-bot committed Aug 2, 2021
1 parent cf3e953 commit 71d826b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bgpd/bgp_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,8 @@ int bgp_open_option_parse(struct peer *peer, uint8_t length, int *mp_capability)

/* Extended Message Support */
peer->max_packet_size =
CHECK_FLAG(peer->cap, PEER_CAP_EXTENDED_MESSAGE_RCV)
(CHECK_FLAG(peer->cap, PEER_CAP_EXTENDED_MESSAGE_RCV)
&& CHECK_FLAG(peer->cap, PEER_CAP_EXTENDED_MESSAGE_ADV))
? BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE
: BGP_STANDARD_MESSAGE_MAX_PACKET_SIZE;

Expand Down

0 comments on commit 71d826b

Please sign in to comment.