Add multicast support to loopif

This commit adds support to send and receive multicast on the loopback
netif by enabling IGMP via NETIF_FLAG_IGMP

This commit also introduces an LwIP configuration option,
LWIP_LOOPIF_MCAST, to control the behavior and it defaults to off
This commit is contained in:
Joel Cunningham 2015-08-24 11:28:13 -05:00 committed by sg
parent 204bd29e52
commit 0ab21da820
2 changed files with 10 additions and 0 deletions

View File

@ -126,6 +126,9 @@ netif_loopif_init(struct netif *netif)
#endif
#if LWIP_IPV6
netif->output_ip6 = netif_loop_output_ipv6;
#endif
#if LWIP_LOOPIF_MCAST
netif->flags |= NETIF_FLAG_IGMP;
#endif
return ERR_OK;
}

View File

@ -1424,6 +1424,13 @@
#define LWIP_HAVE_LOOPIF LWIP_NETIF_LOOPBACK
#endif
/**
* LWIP_LOOPIF_MCAST==1: Support multicast on loop interface (127.0.0.1).
*/
#ifndef LWIP_LOOPIF_MCAST
#define LWIP_LOOPIF_MCAST 0
#endif
/*
------------------------------------
---------- SLIPIF options ----------