Skip to content
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

ldpd: fix wrong gtsm count #16226

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ldpd/neighbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,18 @@ nbr_gtsm_setup(int fd, int af, struct nbr_params *nbrp)
if (nbrp && CHECK_FLAG(nbrp->flags, F_NBRP_GTSM_HOPS))
ttl = 256 - nbrp->gtsm_hops;

/*
* In linux networking stack, the received mpls packets
* will be processed by the host twice, one as mpls packet,
* the other as ip packet, so its ttl will be decreased 1.
* This behavior is based on the new kernel (5.10 and 6.1),
* and older versions may behave differently.
*
* Here, decrease 1 for IP_MINTTL if GTSM is enabled.
* And this workaround makes the GTSM mechanism a bit deviation.
*/
ttl -= 1;
ton31337 marked this conversation as resolved.
Show resolved Hide resolved

switch (af) {
case AF_INET:
if (sock_set_ipv4_minttl(fd, ttl) == -1)
Expand Down
Loading