4

I'm in the process of creating an Android VPN app and I'm hitting a brick wall whenever I try to deliver inbound multicast packets to a test app. When my VPN app writes an inbound multicast IP packet (destination address field of IP header has an address in the multicast range) to the file descriptor side of the TUN device I don't see the packet show up on the test app I'm using to receive multicast packets. However, I do see unicast packets being received by the test app. I also see my test app receiving multicast packets when the VPN app is not in the mix, so I know it's capable of receiving multicast.

I have my suspicion that the TUN device created by my VPN app does not enable multicast functionality by default, and I have not found any means exposed by Android to do so. Does anyone know if it's possible to enable multicast for a TUN device? Or, am I possibly missing something else entirely?

I use the following code to create the TUN device using the VpnService.Builder class

Builder builder = new Builder();
builder.setMtu( 1250 );
builder.addAddress( "2.3.1.1", 32 );

I use the following code to create the file descriptor to send IP packets to the TUN device

ParcelFileDescriptor parcelFileDescriptor = builder.setSession( "my_session" ).setConfigureIntent( myConfigureIntent ).establish();    
FileOutputStream tunOut = new FileOutputStream( parcelFileDescriptor.getFileDescriptor() );
unbrokenrabbit
  • 301
  • 4
  • 12
  • 2
    hi,unbrokenrabbit, do you solved this problem? I now have the same issue. – IFQ Apr 14 '16 at 07:43

0 Answers0