Skip to content

Commit

Permalink
use define IGMP_V3_QUERY_MINLEN instead of IGMPV3_MINLEN
Browse files Browse the repository at this point in the history
  • Loading branch information
Merlin Krümmel committed Jun 21, 2021
1 parent 746276f commit 1577454
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static void buildIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t g
ip = (struct ip *)send_buf;
ip->ip_src.s_addr = src;
ip->ip_dst.s_addr = dst;
ip_set_len(ip, IP_HEADER_RAOPT_LEN + IGMPV3_MINLEN + datalen);
ip_set_len(ip, IP_HEADER_RAOPT_LEN + IGMP_V3_QUERY_MINLEN + datalen);

if (IN_MULTICAST(ntohl(dst))) {
ip->ip_ttl = curttl;
Expand Down Expand Up @@ -330,7 +330,7 @@ void sendIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, in
#endif
sdst.sin_addr.s_addr = dst;
if (sendto(MRouterFD, send_buf,
IP_HEADER_RAOPT_LEN + IGMPV3_MINLEN + datalen, 0,
IP_HEADER_RAOPT_LEN + IGMP_V3_QUERY_MINLEN + datalen, 0,
(struct sockaddr *)&sdst, sizeof(sdst)) < 0) {
if (errno == ENETDOWN)
my_log(LOG_ERR, errno, "Sender VIF was down.");
Expand Down
1 change: 1 addition & 0 deletions src/os-linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <linux/mroute.h>

#define IGMP_V3_MEMBERSHIP_REPORT 0x22
#define IGMP_V3_QUERY_MINLEN IGMPV3_MINLEN

#define INADDR_ALLIGMPV3_GROUP ((in_addr_t) 0xe0000016)

Expand Down

0 comments on commit 1577454

Please sign in to comment.