What does this error log message mean?

When I'm debugging my VPN tunnel provider application on the iPhone device I found some error logs in the console:

Code Block sh
udp_validate_cksum_internal [C8.1:1] udp incorrect IPv4-UDP non-offload checksum 0xeaff ulen 1502

It only appears when I'm tuning the MTU to a bigger value for the NEPacketTunnelNetworkSettings.

What does this message mean? Does it mean the inbound udp packet has a bad checksum and will it be dropped by iOS?
When a UDP packet is received the checksum value in the header of the packet is calculated and that is what is happening in (udpvalidatecksum_internal). There does seem to be an issue here but it's hard to tell if it's because of an incorrect MTU or invalid checksum value.

Regarding:

What does this message mean? Does it mean the inbound udp packet has a bad checksum and will it be dropped by iOS?

It does look like if the checksum fails to be validate that this frame is skipped. However, I would double check this by doing some tests of your own. One way to do this is by intentionally injecting a packet with bogus data to see what happens when the frame is processed.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Thanks Matt.

I just found that the checksum errors only happens when I'm testing with an iOS 14 device. When I'm testing with an iOS 12 device it works quite normal.
When I set the MTU of the UTUN to be 1480(with an iOS 14 iPhone and WIFI with VLAN settings) and load *google.com* then there will be such errors shown on console.
With other WIFI or mobile network I didn't see such errors.
And another found is that on the home Wifi network(which has PPPoE router provided by carrier) with an iOS 14 iPhone the message will be like
Code Block Code Block sh
udp_validate_cksum_internal * udp incorrect IPv4-UDP non-offload checksum * ulen 1506

And the pppoe header length is 6.
Compared with previous network with Vlan the error message showed ulen is 1502.

I believe there most probably a bug exists somewhere in iOS 14 kernel or in network extension.

Since I didn't found such issue under the same condition on iOS 12, this issue may only exists in iOS 14.

The reproduce condition is with NEPacketTunnelProvider set the MTU of the UTUN to be a value bigger or equal than 1480(Theoretically we should be able to set this value to a very big size like 65535 and without any problem) or overhead size to be 0, and run it on an iOS 14 iPhone, on a Wifi network which has a Vlan setting or PPPoE, on inbound packets there will be such problem.
What does this error log message mean?
 
 
Q