Skip to content

Commit 9d21de9

Browse files
Merlin Krümmelzocker007
authored andcommitted
use define IGMP_V3_QUERY_MINLEN instead of IGMPV3_MINLEN
1 parent 048924b commit 9d21de9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/igmp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static void buildIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t g
269269
ip = (struct ip *)send_buf;
270270
ip->ip_src.s_addr = src;
271271
ip->ip_dst.s_addr = dst;
272-
ip_set_len(ip, IP_HEADER_RAOPT_LEN + IGMPV3_MINLEN + datalen);
272+
ip_set_len(ip, IP_HEADER_RAOPT_LEN + IGMP_V3_QUERY_MINLEN + datalen);
273273

274274
if (IN_MULTICAST(ntohl(dst))) {
275275
ip->ip_ttl = curttl;
@@ -323,7 +323,7 @@ void sendIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, in
323323
#endif
324324
sdst.sin_addr.s_addr = dst;
325325
if (sendto(MRouterFD, send_buf,
326-
IP_HEADER_RAOPT_LEN + IGMPV3_MINLEN + datalen, 0,
326+
IP_HEADER_RAOPT_LEN + IGMP_V3_QUERY_MINLEN + datalen, 0,
327327
(struct sockaddr *)&sdst, sizeof(sdst)) < 0) {
328328
if (errno == ENETDOWN)
329329
my_log(LOG_ERR, errno, "Sender VIF was down.");

src/os-linux.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/mroute.h>
99

1010
#define IGMP_V3_MEMBERSHIP_REPORT 0x22
11+
#define IGMP_V3_QUERY_MINLEN IGMPV3_MINLEN
1112

1213
#define INADDR_ALLIGMPV3_GROUP ((in_addr_t) 0xe0000016)
1314

0 commit comments

Comments
 (0)