From db55eecd7267cf129feddaa7394117ef1f0eebe7 Mon Sep 17 00:00:00 2001 From: zocker007 Date: Mon, 23 Jan 2023 14:49:59 +0100 Subject: [PATCH] rename igmpv3 query struct and fix incompl struct --- src/igmp.c | 4 ++-- src/igmpv3.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/igmp.c b/src/igmp.c index 75d81317..7400bd56 100644 --- a/src/igmp.c +++ b/src/igmp.c @@ -262,7 +262,7 @@ void acceptIgmp(int recvlen) { */ static int buildIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, int datalen) { struct ip *ip; - struct igmpv3 *igmp; + struct igmpv3_query *igmp; struct Config *conf = getCommonConfig(); extern int curttl; int query_minlen = IGMP_MINLEN; @@ -289,7 +289,7 @@ static int buildIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t gr ((unsigned char*)send_buf+MIN_IP_HEADER_LEN)[2] = 0x00; ((unsigned char*)send_buf+MIN_IP_HEADER_LEN)[3] = 0x00; - igmp = (struct igmpv3 *)(send_buf + IP_HEADER_RAOPT_LEN); + igmp = (struct igmpv3_query *)(send_buf + IP_HEADER_RAOPT_LEN); igmp->igmp_type = type; igmp->igmp_code = code; igmp->igmp_group.s_addr = group; diff --git a/src/igmpv3.h b/src/igmpv3.h index 5d1d96ae..986b870d 100644 --- a/src/igmpv3.h +++ b/src/igmpv3.h @@ -24,7 +24,7 @@ /* * IGMP v3 query format. */ -struct igmpv3 { +struct igmpv3_query { u_int8_t igmp_type; /* version & type of IGMP message */ u_int8_t igmp_code; /* subtype for routing msgs */ u_int16_t igmp_cksum; /* IP-style checksum */ @@ -33,7 +33,7 @@ struct igmpv3 { u_int8_t igmp_misc; /* reserved/suppress/robustness */ u_int8_t igmp_qqi; /* querier's query interval */ u_int16_t igmp_numsrc; /* number of sources */ - /*struct in_addr igmp_sources[1];*/ /* source addresses */ + struct in_addr igmp_sources[0]; /* source addresses */ }; struct igmpv3_grec {