]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Mark Default TOS Values for PIM & IGMP Outgoing packets 5045/head
authorSatheesh Kumar K <sathk@cumulusnetworks.com>
Tue, 24 Sep 2019 03:45:05 +0000 (20:45 -0700)
committerSatheesh Kumar K <sathk@cumulusnetworks.com>
Tue, 24 Sep 2019 06:03:12 +0000 (23:03 -0700)
This will facilitate the Hardware to prefer control packets over
Normal Data packets while queuing, so that during congestion, the
chance of dropping control packet will be minimised.

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
pimd/pim_pim.c
pimd/pim_sock.c

index 12b28ed9af68015f44d2b858929b4842967e7648..cd2d306f3db2e52b931e953a3ff1dd38e8edd2a8 100644 (file)
@@ -574,6 +574,7 @@ int pim_msg_send(int fd, struct in_addr src, struct in_addr dst,
        ip->ip_id = htons(++ip_id);
        ip->ip_hl = 5;
        ip->ip_v = 4;
+       ip->ip_tos = IPTOS_PREC_INTERNETCONTROL;
        ip->ip_p = PIM_IP_PROTO_PIM;
        ip->ip_src = src;
        ip->ip_dst = dst;
index 82255cd3b077f6bc679b172f52bdb6dd04831a33..7f03e18389e879db8275efe4862ae63937a133a1 100644 (file)
@@ -255,6 +255,12 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, struct interface *ifp,
                }
        }
 
+       /* Set Tx socket DSCP byte */
+       if (setsockopt_ipv4_tos(fd, IPTOS_PREC_INTERNETCONTROL)) {
+               zlog_warn("can't set sockopt IP_TOS to PIM/IGMP socket %d: %s",
+                         fd, safe_strerror(errno));
+       }
+
        return fd;
 }