Add IPv4 link-local multicast range to local routing tables

This commit allows local multicast traffic to be sent locally
instead of being sent through VPN when using a VPN automatic
bypass for local traffic.

Currently, the local network that is considered in VPN local
exclusion mode is the same subnet of the network assigned
address. If apps try to make some traffic to multicast range,
it may be routed to VPN and block the traffic. E.g. If app
connect a UDP socket to multicast range(224.0.0.x) and sends
from the socket, or app send to 224.0.0.x from an unconnected
socket. The traffic will send from VPN network. This traffic
may not be well-routed in VPN network. So the case should be
also considered to make the function work in the VPN bypass
mode because it usually won't be the network assigned subnet
range. Add the multicast range as a fixed range in the local
exclusion table.

The multicast range is 224.0.0.0/4 but only limit it to
224.0.0.0/24 since the IPv4 definitions are not as precise as
for IPv6, it is the only range that the standards (RFC 2365
and RFC 5771) specify is link-local and must not be forwarded.

Bug: 243200566
Test: cd system/netd ; atest
Test: connect to Wifi or cellular network and check the routing
Test: manually test with chromecast with local routes exclusion
      enabled
Change-Id: I79fe499fb02a88ec687fadf3fad461c204fe3e47
3 files changed
tree: f7d4dae6e1693b18ee2c50a3e24cb4b50565bdd3
  1. client/
  2. include/
  3. netutils_wrappers/
  4. server/
  5. tests/
  6. .editorconfig
  7. Android.bp
  8. NOTICE
  9. OWNERS
  10. PREUPLOAD.cfg
  11. TEST_MAPPING