mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-28 19:21:20 +00:00
minor: fixed coding style in mld6.c
This commit is contained in:
parent
6cdea62638
commit
9d28549f32
@ -218,8 +218,9 @@ mld6_free_group(struct mld_group *group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Group not find group */
|
/* Group not find group */
|
||||||
if (tmpGroup == NULL)
|
if (tmpGroup == NULL) {
|
||||||
err = ERR_ARG;
|
err = ERR_ARG;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* free group */
|
/* free group */
|
||||||
memp_free(MEMP_MLD6_GROUP, group);
|
memp_free(MEMP_MLD6_GROUP, group);
|
||||||
@ -255,7 +256,6 @@ mld6_input(struct pbuf *p, struct netif *inp)
|
|||||||
|
|
||||||
switch (mld_hdr->type) {
|
switch (mld_hdr->type) {
|
||||||
case ICMP6_TYPE_MLQ: /* Multicast listener query. */
|
case ICMP6_TYPE_MLQ: /* Multicast listener query. */
|
||||||
{
|
|
||||||
/* Is it a general query? */
|
/* Is it a general query? */
|
||||||
if (ip6_addr_isallnodes_linklocal(ip6_current_dest_addr()) &&
|
if (ip6_addr_isallnodes_linklocal(ip6_current_dest_addr()) &&
|
||||||
ip6_addr_isany(&(mld_hdr->multicast_address))) {
|
ip6_addr_isany(&(mld_hdr->multicast_address))) {
|
||||||
@ -270,8 +270,7 @@ mld6_input(struct pbuf *p, struct netif *inp)
|
|||||||
}
|
}
|
||||||
group = group->next;
|
group = group->next;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/* Have we joined this group?
|
/* Have we joined this group?
|
||||||
* We use IP6 destination address to have a memory aligned copy.
|
* We use IP6 destination address to have a memory aligned copy.
|
||||||
* mld_hdr->multicast_address should be the same. */
|
* mld_hdr->multicast_address should be the same. */
|
||||||
@ -283,9 +282,7 @@ mld6_input(struct pbuf *p, struct netif *inp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break; /* ICMP6_TYPE_MLQ */
|
break; /* ICMP6_TYPE_MLQ */
|
||||||
}
|
|
||||||
case ICMP6_TYPE_MLR: /* Multicast listener report. */
|
case ICMP6_TYPE_MLR: /* Multicast listener report. */
|
||||||
{
|
|
||||||
/* Have we joined this group?
|
/* Have we joined this group?
|
||||||
* We use IP6 destination address to have a memory aligned copy.
|
* We use IP6 destination address to have a memory aligned copy.
|
||||||
* mld_hdr->multicast_address should be the same. */
|
* mld_hdr->multicast_address should be the same. */
|
||||||
@ -300,12 +297,9 @@ mld6_input(struct pbuf *p, struct netif *inp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break; /* ICMP6_TYPE_MLR */
|
break; /* ICMP6_TYPE_MLR */
|
||||||
}
|
|
||||||
case ICMP6_TYPE_MLD: /* Multicast listener done. */
|
case ICMP6_TYPE_MLD: /* Multicast listener done. */
|
||||||
{
|
|
||||||
/* Do nothing, router will query us. */
|
/* Do nothing, router will query us. */
|
||||||
break; /* ICMP6_TYPE_MLD */
|
break; /* ICMP6_TYPE_MLD */
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
MLD6_STATS_INC(mld6.proterr);
|
MLD6_STATS_INC(mld6.proterr);
|
||||||
MLD6_STATS_INC(mld6.drop);
|
MLD6_STATS_INC(mld6.drop);
|
||||||
@ -338,8 +332,7 @@ mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr)
|
|||||||
match = 0;
|
match = 0;
|
||||||
if (ip6_addr_isany(srcaddr)) {
|
if (ip6_addr_isany(srcaddr)) {
|
||||||
match = 1;
|
match = 1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
|
for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
|
||||||
if (!ip6_addr_isinvalid(netif_ip6_addr_state(netif, i)) &&
|
if (!ip6_addr_isinvalid(netif_ip6_addr_state(netif, i)) &&
|
||||||
ip6_addr_cmp(srcaddr, netif_ip6_addr(netif, i))) {
|
ip6_addr_cmp(srcaddr, netif_ip6_addr(netif, i))) {
|
||||||
@ -423,8 +416,7 @@ mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr)
|
|||||||
match = 0;
|
match = 0;
|
||||||
if (ip6_addr_isany(srcaddr)) {
|
if (ip6_addr_isany(srcaddr)) {
|
||||||
match = 1;
|
match = 1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
|
for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
|
||||||
if (!ip6_addr_isinvalid(netif_ip6_addr_state(netif, i)) &&
|
if (!ip6_addr_isinvalid(netif_ip6_addr_state(netif, i)) &&
|
||||||
ip6_addr_cmp(srcaddr, netif_ip6_addr(netif, i))) {
|
ip6_addr_cmp(srcaddr, netif_ip6_addr(netif, i))) {
|
||||||
@ -624,6 +616,4 @@ mld6_send(struct mld_group *group, u8_t type)
|
|||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* LWIP_IPV6 */
|
#endif /* LWIP_IPV6 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user