diff options
author | Karen Schoener <karen.voltanet.io> | 2020-05-05 23:59:00 +0200 |
---|---|---|
committer | Karen Schoener <karen@volta.io> | 2020-05-06 15:46:07 +0200 |
commit | def23eb3952f54e4c41f62554e54c00aff016a92 (patch) | |
tree | db15b12c0e9a15eb720ed9df3fd2e8bede6b673f /ldpd | |
parent | Merge pull request #6103 from mjstapp/fix_all_unnumbered (diff) | |
download | frr-def23eb3952f54e4c41f62554e54c00aff016a92.tar.xz frr-def23eb3952f54e4c41f62554e54c00aff016a92.zip |
ldpd: LDP does not always send traffic with correct DSCP value.
Adding code so that the LDP neighbor that does not initiate the
TCP connection also sets the DSCP (via setsocketopt).
Signed-off-by: Karen Schoener <karen@voltanet.io>
Diffstat (limited to 'ldpd')
-rw-r--r-- | ldpd/neighbor.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ldpd/neighbor.c b/ldpd/neighbor.c index ae51490c0..1aa53151e 100644 --- a/ldpd/neighbor.c +++ b/ldpd/neighbor.c @@ -619,6 +619,16 @@ nbr_establish_connection(struct nbr *nbr) #endif } + if (nbr->af == AF_INET) { + if (sock_set_ipv4_tos(nbr->fd, IPTOS_PREC_INTERNETCONTROL) == -1) + log_warn("%s: lsr-id %s, sock_set_ipv4_tos error", + __func__, inet_ntoa(nbr->id)); + } else if (nbr->af == AF_INET6) { + if (sock_set_ipv6_dscp(nbr->fd, IPTOS_PREC_INTERNETCONTROL) == -1) + log_warn("%s: lsr-id %s, sock_set_ipv6_dscp error", + __func__, inet_ntoa(nbr->id)); + } + addr2sa(nbr->af, &nbr->laddr, 0, &local_su); addr2sa(nbr->af, &nbr->raddr, LDP_PORT, &remote_su); if (nbr->af == AF_INET6 && nbr->raddr_scope) |