Galaxy S5 device does not receive ip packet I have the following setup:

Android Galaxy S5 Mini. Android version 5.1.1.

I have 2 network interfaces:


Interface1 with ip: 192.168.5.1
Interface2 with ip: 192.168.5.10


I create a DatagramSocket using Android SDK and bind it to address: 192.168.5.10(Interface 2), port 2525.
I put this socket in receive and wait for packets. I use another device to send the packets.

Packets from ip address: 192.168.5.4 is received.

Packets from ip address(different device): 192.168.5.1 (same as the device's Interface1 ip) is never received.

It seams that the network stack rejects packets which have source ip address which exists in the device, regardless of the interface it was received in.

If I modify the ip address for Interface1 to something other than 192.168.5.1 it works fine.

Devices on which it didn't happen:


Samsung tablet T113 Android 4.4.4 (Stock rom)
LG G4 Android 6.0 (Stock rom)
LG Nexus 5X Android 7.1.2 (Stock rom)


Devices on which it did happen:


Galaxy S5 Mini Android 5.1.1 (Stock rom)
Galaxy Note 3 Android 6.0.1 (CyanogenMod)
One+1 Android 6.0.1 (CyanogenMod)


What is the mechanism which rejects the packet with source IP 192.168.5.1(same as the device's Interface1 ip)?
I found why this happens, but not sure if I can do anything about it without root. There is a system configuration per network interface  called accept_local. For example: net.ipv4.conf.wlan0.accept_local. When it is set to 0, it can't receive packets from another local interface. Probably when it works on other devices, this configuration is set to 1. On Galaxy Note 3 it was set to 0. Once I did this, everything started working, but root was needed.
Update
Found a site which list the system variables values: https://census.tsyrklevich.net/
Specifically:

https://census.tsyrklevich.net/sysctls/net.ipv4.conf.wlan0.accept_local
https://census.tsyrklevich.net/sysctls/net.ipv4.conf.wlan0.rp_filter