Added support for using TCPIP_ADAPTER_IF_MAX to join igmp groups on all (#2279)

interfaces
This commit is contained in:
Shelby Merrick 2019-01-06 14:29:38 -05:00 committed by Me No Dev
parent 812d131663
commit a6e3b29004

View File

@ -561,7 +561,6 @@ static esp_err_t joinMulticastGroup(const ip_addr_t *addr, bool join, tcpip_adap
return ESP_ERR_INVALID_ARG;
}
netif = (struct netif *)nif;
}
if (addr->type == IPADDR_TYPE_V4) {
if(join){
@ -584,6 +583,29 @@ static esp_err_t joinMulticastGroup(const ip_addr_t *addr, bool join, tcpip_adap
}
}
}
} else {
if (addr->type == IPADDR_TYPE_V4) {
if(join){
if (igmp_joingroup((const ip4_addr *)IP4_ADDR_ANY, (const ip4_addr *)&(addr->u_addr.ip4))) {
return ESP_ERR_INVALID_STATE;
}
} else {
if (igmp_leavegroup((const ip4_addr *)IP4_ADDR_ANY, (const ip4_addr *)&(addr->u_addr.ip4))) {
return ESP_ERR_INVALID_STATE;
}
}
} else {
if(join){
if (mld6_joingroup((const ip6_addr *)IP6_ADDR_ANY, &(addr->u_addr.ip6))) {
return ESP_ERR_INVALID_STATE;
}
} else {
if (mld6_leavegroup((const ip6_addr *)IP6_ADDR_ANY, &(addr->u_addr.ip6))) {
return ESP_ERR_INVALID_STATE;
}
}
}
}
return ESP_OK;
}