Skip to content

Commit 1577454

Browse files
author
Merlin Krümmel
committed
use define IGMP_V3_QUERY_MINLEN instead of IGMPV3_MINLEN
1 parent 746276f commit 1577454

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/igmp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static void buildIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t g
276276
ip = (struct ip *)send_buf;
277277
ip->ip_src.s_addr = src;
278278
ip->ip_dst.s_addr = dst;
279-
ip_set_len(ip, IP_HEADER_RAOPT_LEN + IGMPV3_MINLEN + datalen);
279+
ip_set_len(ip, IP_HEADER_RAOPT_LEN + IGMP_V3_QUERY_MINLEN + datalen);
280280

281281
if (IN_MULTICAST(ntohl(dst))) {
282282
ip->ip_ttl = curttl;
@@ -330,7 +330,7 @@ void sendIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, in
330330
#endif
331331
sdst.sin_addr.s_addr = dst;
332332
if (sendto(MRouterFD, send_buf,
333-
IP_HEADER_RAOPT_LEN + IGMPV3_MINLEN + datalen, 0,
333+
IP_HEADER_RAOPT_LEN + IGMP_V3_QUERY_MINLEN + datalen, 0,
334334
(struct sockaddr *)&sdst, sizeof(sdst)) < 0) {
335335
if (errno == ENETDOWN)
336336
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)