Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds bugfix for lwip multicast group commands #20133

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/inet/UDPEndPointImplLwIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ CHIP_ERROR UDPEndPointImplLwIP::LwIPBindInterface(struct udp_pcb * aUDP, Interfa
InterfaceId UDPEndPointImplLwIP::GetBoundInterface() const
{
#if HAVE_LWIP_UDP_BIND_NETIF
return InterfaceId(netif_get_by_index(mUDP->netif_idx));
return InterfaceId(netif_get_by_index(mUDP->netif_idx + 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "+ 1"?

The intent of the calling code is to do "all interfaces". Why is adding 1 here the right thing?

Copy link
Contributor Author

@rosahay-silabs rosahay-silabs Jun 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mUDP->netif_idx is passing a value of 0, netif_get_by_index returns NULL in that case. Since there is a check for 0, ideally the right thing would be for the netif function to return the interface at 0 position.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is, either that 0 is wrong to start with or we are misusing it if it's meant to mean "all interfaces"...

#else
return InterfaceId(mUDP->intf_filter);
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/lwip/efr32/lwipopts-rs911x.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
#define LWIP_IPV6_AUTOCONFIG (1)
#define LWIP_IPV6_ROUTER_SUPPORT 1
#define LWIP_ND6_LISTEN_RA 1
#define LWIP_IPV6_MLD 1

#define LWIP_ND6_NUM_NEIGHBORS (2)
#define LWIP_ND6_NUM_DESTINATIONS (3)
Expand Down Expand Up @@ -150,9 +151,7 @@

#define LWIP_IPV6_NUM_ADDRESSES 5

#ifndef LWIP_IPV6_ND
#define LWIP_IPV6_ND 1
#endif
#define LWIP_ND6_QUEUEING 1
#define LWIP_NUM_ND6_QUEUE 3

Expand Down