[PATCH 2/2] IAPP: Set IP_MULTICAST_LOOP on listening socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make it possible for hostapd instances listening on the same IP to see
eachother's messages.

Signed-off-by: Petko Bordjukov <bordjukov@xxxxxxxxx>
---
 src/ap/iapp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/ap/iapp.c b/src/ap/iapp.c
index 61776d8..a568b03 100644
--- a/src/ap/iapp.c
+++ b/src/ap/iapp.c
@@ -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",
-- 
2.6.2


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux