IPv6 packet's 'length' field contains length of payload excluding headers. Header's length (40) needs to be added to that to get complete packet length. This patch seems to be fixing random VPN drops. Signed-off-by: Nikolay Martynov <mar.kolya at gmail.com> --- oncp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oncp.c b/oncp.c index b0f6d12..3c7cfa1 100644 --- a/oncp.c +++ b/oncp.c @@ -1002,7 +1002,7 @@ int oncp_mainloop(struct openconnect_info *vpninfo, int *timeout) iplen = load_be16(vpninfo->cstp_pkt->data + 2); break; case 6: - iplen = load_be16(vpninfo->cstp_pkt->data + 4); + iplen = load_be16(vpninfo->cstp_pkt->data + 4) + 40; break; default: badiplen: -- 2.9.3