gerbera icon indicating copy to clipboard operation
gerbera copied to clipboard

Gerbera not receiving multicast packets: detect if return path filter is on for interface and log warning if so

Open crass opened this issue 6 years ago • 2 comments

Its not obvious that return path filtering must be turned off in order for the gerbera server to receive multicast packets. Modern Ubuntu installations turn on return path filtering by default on all interfaces. This can be frustrating to debug because multicast packets are seen coming in with tcpdump, but strace shows no packets being received. In my case, I was seeing ipv6 multicast packets being received, apparently there is no return path filter for ipv6 addresses. This SO answer sums up the issue I was seeing.

Once I turned off the return path filter for all interfaces and the interface gerbera was listening on, I could see gerbera receiving multicast packets. I used the following commands as root:

echo 0 > /proc/sys/net/ipv4/conf/${GERBERA_INTERFACE}/rp_filter
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter

I propose that gerbera check these two files at start up and if either has a value of 1, then log a warning (eg. Return path filtering is on, you most likely will need to run 'sysctl net.ipv4.conf.all.rp_filter=0' and 'sysctl net.ipv4.conf.${GERBERA_IF}.rp_filter=0'. replacing ${GERBERA_IF} with the interface gerbera is using) and continue booting.

crass avatar Jan 19 '20 08:01 crass

Nice idea. Maybe you could take a stab at a patch?

whyman avatar Jan 19 '20 16:01 whyman

Unfortunately, I don't have this time right now. I've opened this in the hopes someone else will, or I get back to it when I have more time.

crass avatar Jan 20 '20 06:01 crass