@@ -386,6 +386,7 @@ struct iapp_data * iapp_init(struct hostapd_data *hapd, const char *iface)
struct iapp_data *iapp;
struct ip_mreqn mreq;
int reuseport = 1;
+ int multicast_loop = 1;
iapp = os_zalloc(sizeof(*iapp));
if (iapp == NULL)
@@ -477,6 +478,14 @@ struct iapp_data * iapp_init(struct hostapd_data *hapd, const char *iface)
return NULL;
}
+ if (setsockopt(iapp->udp_sock, IPPROTO_IP, IP_MULTICAST_LOOP, &multicast_loop,
+ sizeof(multicast_loop)) < 0) {
+ wpa_printf(MSG_INFO, "iapp_init - setsockopt[UDP,IP_MULTICAST_LOOP]: %s",
+ strerror(errno));
+ iapp_deinit(iapp);
+ return NULL;
+ }
+
iapp->packet_sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
if (iapp->packet_sock < 0) {
wpa_printf(MSG_INFO, "iapp_init - socket[PF_PACKET,SOCK_RAW]: %s",
Make it possible for hostapd instances listening on the same IP to see eachother's messages. Signed-off-by: Petko Bordjukov <bordjukov@gmail.com> --- src/ap/iapp.c | 9 +++++++++ 1 file changed, 9 insertions(+)