Skip to content

Commit

Permalink
rename igmpv3 query struct and fix incompl struct
Browse files Browse the repository at this point in the history
  • Loading branch information
zocker007 committed Jan 23, 2023
1 parent 8ecda18 commit db55eec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/igmpv3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 {
Expand Down

0 comments on commit db55eec

Please sign in to comment.