> From: [email protected] [mailto:[email protected]] On
> Behalf Of Chris Buechler
>
> On Thu, Jul 30, 2009 at 8:33 PM, Evgeny
> Yurchenko<[email protected]> wrote:
> >
> > The code of igmpproxy is heavily inherited from mrouted and actual
> > proxying of IGMP-packets does not happen. It is not a
> problem if mcast
> > sender on upstream interface does not care about
> memberships and just
> > multicasts always, but if it is wise sender, or if sender
> is located
> > in several routers upstream then IGMP is needed. So I fixed
> this small issue for 1.2.2 (I have only this development
> version). There was another problem with understanding
> interfaces consisting of more than 3 letters (em1 - ok, bge1
> - can't start), also fixed. Could somebody validate and put
> my several lines of code in repository please? How does it
> work at all - if somebody found solution for some problem, what to do?
> >
>
> You can send a patch here (diff -rub please) and I'm sure
> Ermal will review (he does most of our C work, and did this multicast
> implementation) and get it committed.
>
> Thanks!
>
diff -rub original/igmpproxy/work/igmpproxy/src/config.c
igmpproxy/work/igmpproxy/src/config.c
--- original/igmpproxy/work/igmpproxy/src/config.c 2009-07-31
17:17:16.000000000 +0000
+++ igmpproxy/work/igmpproxy/src/config.c 2009-07-31
17:21:28.000000000 +0000
@@ -241,7 +241,7 @@
tmpPtr->allowednets = NULL;
// Make a copy of the token to store the IF name
- tmpPtr->name = (char *)malloc( sizeof(char) * strlen(token) );
+ tmpPtr->name = (char *)malloc( sizeof(char) * strlen(token) + 1 );
if(tmpPtr->name == NULL) {
log(LOG_ERR, 0, "Out of memory.");
}
diff -rub original/igmpproxy/work/igmpproxy/src/mcgroup.c
igmpproxy/work/igmpproxy/src/mcgroup.c
--- original/igmpproxy/work/igmpproxy/src/mcgroup.c 2009-07-31
17:17:16.000000000 +0000
+++ igmpproxy/work/igmpproxy/src/mcgroup.c 2009-07-31
17:11:00.000000000 +0000
@@ -63,13 +63,18 @@
}
#else
if( setsockopt( UdpSock, IPPROTO_IP,
- Cmd == 'j' ? IP_ADD_SOURCE_MEMBERSHIP :
IP_DROP_SOURCE_MEMBERSHIP,
+ Cmd == 'j' ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP,
(void *)&CtlReq, sizeof( CtlReq ) ) )
{
log( LOG_WARNING, errno, "MRT_%s_MEMBERSHIP failed", Cmd == 'j'
? "ADD" : "DROP" );
return 1;
}
#endif
+ /* We have to send IGMP packet on upstream interface */
+ if( Cmd == 'j' )
+ sendIgmp(0, mcastaddr, IGMP_V2_MEMBERSHIP_REPORT, 0, mcastaddr,
0);
+ else
+ sendIgmp(0, mcastaddr, IGMP_V2_LEAVE_GROUP, 0, mcastaddr, 0);
return 0;
}
diff -rub original/igmpproxy/work/igmpproxy/src/rttable.c
igmpproxy/work/igmpproxy/src/rttable.c
--- original/igmpproxy/work/igmpproxy/src/rttable.c 2009-07-31
17:17:16.000000000 +0000
+++ igmpproxy/work/igmpproxy/src/rttable.c 2009-07-31
17:25:18.000000000 +0000
@@ -344,12 +344,8 @@
return 0;
}
}
- }
-
- // Send join message upstream, if the route has no joined flag...
- if(croute->upstrState != ROUTESTATE_JOINED) {
- // Send Join request upstream
- sendJoinLeaveUpstream(croute, 1);
+ // Send join message upstream
+ sendIgmp(0, group, IGMP_V2_MEMBERSHIP_REPORT, 0, group, 0);
}
IF_DEBUG logRouteTable("Insert Route");
Eugene.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Commercial support available - https://portal.pfsense.org