IGMP queries should contain the source address of the IGMP socket
they are being sent from.
Added binding the IGMP sockets to their specific source, otherwise
interfaces with multiple addresses will send multiple queries using
the same source, which is determined by the kernel.
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Reviewed-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
{
struct pim_interface *pim_ifp;
struct igmp_sock *igmp;
+ struct sockaddr_in sin;
int fd;
pim_ifp = ifp->info;
return 0;
}
+ sin.sin_family = AF_INET;
+ sin.sin_addr = ifaddr;
+ sin.sin_port = 0;
+ if (bind(fd, (struct sockaddr *) &sin, sizeof(sin)) != 0) {
+ zlog_warn("Could not bind IGMP socket for %s on %s",
+ inet_ntoa(ifaddr), ifp->name);
+ return 0;
+ }
+
igmp = igmp_sock_new(fd, ifaddr, ifp, mtrace_only);
igmp_read_on(igmp);