Merge pull request #10591 from donaldsharp/rip_packet_fix

ripd: Fix packet send for non primary addresses
This commit is contained in:
Donatas Abraitis 2022-02-17 21:58:50 +02:00 committed by GitHub
commit a4eddc6060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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