is a list of changes: - Ignore interfaces that are not listed in the configuration file: fixes an abort when trying to configure interface located in a different rdomain and doesn't look to the address of interfaces outside the configuration (otherwise it would pick the wrong interface in some cases). - Improve the routing code: use a rb-tree to store groups avoiding group duplications and having to fix hand-rolled list implementations. - Fixed some warnings and improved debug messages. As discussed with ajacoutot@, ok reyk@
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
$OpenBSD: patch-mcgroup_c,v 1.1 2016/12/23 13:44:31 rzalamena Exp $
|
|
--- mcgroup.c.orig Thu Dec 15 19:48:18 2016
|
|
+++ mcgroup.c Mon Dec 19 21:22:07 2016
|
|
@@ -49,7 +49,6 @@
|
|
CtlReq.imr_interface.s_addr = IfDp->InAdr.s_addr;
|
|
|
|
{
|
|
- char FmtBu[ 32 ];
|
|
log( LOG_NOTICE, 0, "%sMcGroup: %s on %s", CmdSt,
|
|
inetFmt( mcastaddr, s1 ), IfDp ? IfDp->Name : "<any>" );
|
|
}
|
|
@@ -58,7 +57,7 @@
|
|
Cmd == 'j' ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP,
|
|
(void *)&CtlReq, sizeof( CtlReq ) ) )
|
|
{
|
|
- log( LOG_WARNING, errno, "MRT_%s_MEMBERSHIP failed", Cmd == 'j' ? "ADD" : "DROP" );
|
|
+ log( LOG_WARNING, errno, "IP_%s_MEMBERSHIP failed", Cmd == 'j' ? "ADD" : "DROP" );
|
|
return 1;
|
|
}
|
|
|
|
@@ -73,6 +72,8 @@
|
|
* @return 0 if the function succeeds, 1 if parameters are wrong or the join fails
|
|
*/
|
|
int joinMcGroup( int UdpSock, struct IfDesc *IfDp, uint32 mcastaddr ) {
|
|
+ if (config_getinterface(IfDp->Name) == NULL)
|
|
+ return (1);
|
|
return joinleave( 'j', UdpSock, IfDp, mcastaddr );
|
|
}
|
|
|
|
@@ -82,5 +83,7 @@
|
|
* @return 0 if the function succeeds, 1 if parameters are wrong or the join fails
|
|
*/
|
|
int leaveMcGroup( int UdpSock, struct IfDesc *IfDp, uint32 mcastaddr ) {
|
|
+ if (config_getinterface(IfDp->Name) == NULL)
|
|
+ return (1);
|
|
return joinleave( 'l', UdpSock, IfDp, mcastaddr );
|
|
}
|