Skip to content

Commit db55eec

Browse files
committed
rename igmpv3 query struct and fix incompl struct
1 parent 8ecda18 commit db55eec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/igmp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void acceptIgmp(int recvlen) {
262262
*/
263263
static int buildIgmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, int datalen) {
264264
struct ip *ip;
265-
struct igmpv3 *igmp;
265+
struct igmpv3_query *igmp;
266266
struct Config *conf = getCommonConfig();
267267
extern int curttl;
268268
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
289289
((unsigned char*)send_buf+MIN_IP_HEADER_LEN)[2] = 0x00;
290290
((unsigned char*)send_buf+MIN_IP_HEADER_LEN)[3] = 0x00;
291291

292-
igmp = (struct igmpv3 *)(send_buf + IP_HEADER_RAOPT_LEN);
292+
igmp = (struct igmpv3_query *)(send_buf + IP_HEADER_RAOPT_LEN);
293293
igmp->igmp_type = type;
294294
igmp->igmp_code = code;
295295
igmp->igmp_group.s_addr = group;

src/igmpv3.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/*
2525
* IGMP v3 query format.
2626
*/
27-
struct igmpv3 {
27+
struct igmpv3_query {
2828
u_int8_t igmp_type; /* version & type of IGMP message */
2929
u_int8_t igmp_code; /* subtype for routing msgs */
3030
u_int16_t igmp_cksum; /* IP-style checksum */
@@ -33,7 +33,7 @@ struct igmpv3 {
3333
u_int8_t igmp_misc; /* reserved/suppress/robustness */
3434
u_int8_t igmp_qqi; /* querier's query interval */
3535
u_int16_t igmp_numsrc; /* number of sources */
36-
/*struct in_addr igmp_sources[1];*/ /* source addresses */
36+
struct in_addr igmp_sources[0]; /* source addresses */
3737
};
3838

3939
struct igmpv3_grec {

0 commit comments

Comments
 (0)