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 authored and zocker007 committed Feb 18, 2022
1 parent 048924b commit 9d21de9
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 @@ -269,7 +269,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 @@ -323,7 +323,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 9d21de9

Please sign in to comment.