diff options
author | Adriano Marto Reis <adrianomarto@gmail.com> | 2021-03-21 00:25:13 +0100 |
---|---|---|
committer | Adriano Marto Reis <adrianomarto@gmail.com> | 2021-03-21 00:25:13 +0100 |
commit | b069b5680dd738757a81e6b0d5854a27d58a63a8 (patch) | |
tree | 0b91dd0b72efac0f7c25f59d780f5e2c9c7786b2 /pimd/pim_msdp_socket.c | |
parent | Merge pull request #8129 from mjstapp/backup_recursives (diff) | |
download | frr-b069b5680dd738757a81e6b0d5854a27d58a63a8.tar.xz frr-b069b5680dd738757a81e6b0d5854a27d58a63a8.zip |
pimd: marking MSDP traffic as DSCP CS6
Configuring the sockets used to establish MSDP connections so the
packets are marked as CS6
Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
Diffstat (limited to 'pimd/pim_msdp_socket.c')
-rw-r--r-- | pimd/pim_msdp_socket.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pimd/pim_msdp_socket.c b/pimd/pim_msdp_socket.c index b613937f5..9c3cdb271 100644 --- a/pimd/pim_msdp_socket.c +++ b/pimd/pim_msdp_socket.c @@ -35,6 +35,8 @@ #include "pim_msdp.h" #include "pim_msdp_socket.h" +#include "sockopt.h" + /* increase socket send buffer size */ static void pim_msdp_update_sock_send_buffer_size(int fd) { @@ -194,6 +196,12 @@ int pim_msdp_sock_listen(struct pim_instance *pim) return rc; } + /* Set socket DSCP byte */ + if (setsockopt_ipv4_tos(sock, IPTOS_PREC_INTERNETCONTROL)) { + zlog_warn("can't set sockopt IP_TOS to MSDP socket %d: %s", + sock, safe_strerror(errno)); + } + /* add accept thread */ listener->fd = sock; memcpy(&listener->su, &sin, socklen); @@ -272,6 +280,12 @@ int pim_msdp_sock_connect(struct pim_msdp_peer *mp) return rc; } + /* Set socket DSCP byte */ + if (setsockopt_ipv4_tos(mp->fd, IPTOS_PREC_INTERNETCONTROL)) { + zlog_warn("can't set sockopt IP_TOS to MSDP socket %d: %s", + mp->fd, safe_strerror(errno)); + } + /* Connect to the remote mp. */ return (sockunion_connect(mp->fd, &mp->su_peer, htons(PIM_MSDP_TCP_PORT), 0)); |