]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ripd: Fix packet send for non primary addresses
authorDonald Sharp <sharpd@nvidia.com>
Wed, 16 Feb 2022 00:47:23 +0000 (19:47 -0500)
committermergify-bot <noreply@mergify.com>
Thu, 17 Feb 2022 19:59:59 +0000 (19:59 +0000)
When rip is configured to work on secondary addresses
on an interface, rip was not properly sending out
the packets on secondary addresses because the source of the
packet was never properly being setup and rip would
send the packet out multiple times for the primary address
not once for each address on the interface that is setup to work.

tcpdump + rip debugs output with fix:

2022/02/15 19:59:50 RIP: [ZG173-BHW0K] turn on virbr0
2022/02/15 19:59:51 RIP: [PYB7S-80D89] multicast join at virbr0
2022/02/15 19:59:51 RIP: [GZR24-FCQGG] multicast request on virbr0
2022/02/15 19:59:51 RIP: [JTNCV-XD8S1] rip_send_packet 192.168.122.1 > 224.0.0.9 (virbr0)
2022/02/15 19:59:51 RIP: [VEJY5-67P5X] SEND to  224.0.0.9520
2022/02/15 19:59:51 RIP: [JTNCV-XD8S1] rip_send_packet 73.3.3.8 > 224.0.0.9 (virbr0)
2022/02/15 19:59:51 RIP: [VEJY5-67P5X] SEND to  224.0.0.9520
19:59:51.831128 IP 192.168.122.1.route > rip2-routers.mcast.net.route: RIPv2, Request, length: 24
19:59:51.831161 IP c-73-3-3-8.hsd1.mo.comcast.net.route > rip2-routers.mcast.net.route: RIPv2, Request, length: 24

Fixes: #10588
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 114918bd0ba2a54f144bcd672973f3a3b88a4251)

ripd/ripd.c

index 346c11ad301ae73f1dc1de4893005c8f5ec90388..b7b62e28e1d57e0b95a891df99bfacce1a6a0b36 100644 (file)
@@ -1522,6 +1522,7 @@ static int rip_send_packet(uint8_t *buf, int size, struct sockaddr_in *to,
        cmsgptr->cmsg_type = IP_PKTINFO;
        pkt = (struct in_pktinfo *)CMSG_DATA(cmsgptr);
        pkt->ipi_ifindex = ifc->ifp->ifindex;
+       pkt->ipi_spec_dst.s_addr = ifc->address->u.prefix4.s_addr;
 #endif /* GNU_LINUX */
 
        ret = sendmsg(rip->sock, &msg, 0);