Skip to content

Commit

Permalink
Show error message when IP_ADD_MEMBERSHIP fails with errno ENOBUFS
Browse files Browse the repository at this point in the history
Also on Linux show hint how to increase maximum number of multicast groups.

Fixes: pali#30
  • Loading branch information
pali committed Feb 26, 2020
1 parent 4914ad9 commit b7940fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mcgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ static int joinleave( int Cmd, int UdpSock, struct IfDesc *IfDp, uint32_t mcasta
Cmd == 'j' ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP,
(void *)&CtlReq, sizeof( CtlReq ) ) )
{
int mcastGroupExceeded = (Cmd == 'j' && errno == ENOBUFS);
my_log( LOG_WARNING, errno, "MRT_%s_MEMBERSHIP failed", Cmd == 'j' ? "ADD" : "DROP" );
if (mcastGroupExceeded) {
my_log(LOG_WARNING, 0, "Maximum number of multicast groups were exceeded");
#ifdef __linux__
my_log(LOG_WARNING, 0, "Check settings of '/sbin/sysctl net.ipv4.igmp_max_memberships'");
#endif
}
return 1;
}

Expand Down

0 comments on commit b7940fc

Please sign in to comment.