net/ipv6: Fix CALIPSO causing GPF with datagram support

When using CALIPSO with IPPROTO_UDP it is possible to trigger a GPF as the
IP header may have moved.

Also update the payload length after adding the CALIPSO option.

Signed-off-by: Richard Haines <>
Acked-by: Paul Moore <>
Signed-off-by: Huw Davies <>
Signed-off-by: David S. Miller <>
1 file changed