Skip to content

Commit 97b7af0

Browse files
asbjornstdavem330
authored andcommitted
net: l2tp: netlink: l2tp_nl_tunnel_send: set UDP6 checksum flags
This patch causes the proper attribute flags to be set, in the case that IPv6 UDP checksums are disabled, so that userspace ie. `ip l2tp show tunnel` knows about it. Signed-off-by: Asbjoern Sloth Toennesen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7ff516f commit 97b7af0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

net/l2tp/l2tp_netlink.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,16 @@ static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 portid, u32 seq, int fla
384384
if (nla_put_u8(skb, L2TP_ATTR_UDP_CSUM, !sk->sk_no_check_tx))
385385
goto nla_put_failure;
386386
break;
387+
#if IS_ENABLED(CONFIG_IPV6)
388+
case AF_INET6:
389+
if (udp_get_no_check6_tx(sk) &&
390+
nla_put_flag(skb, L2TP_ATTR_UDP_ZERO_CSUM6_TX))
391+
goto nla_put_failure;
392+
if (udp_get_no_check6_rx(sk) &&
393+
nla_put_flag(skb, L2TP_ATTR_UDP_ZERO_CSUM6_RX))
394+
goto nla_put_failure;
395+
break;
396+
#endif
387397
}
388398
if (nla_put_u16(skb, L2TP_ATTR_UDP_SPORT, ntohs(inet->inet_sport)) ||
389399
nla_put_u16(skb, L2TP_ATTR_UDP_DPORT, ntohs(inet->inet_dport)))

0 commit comments

Comments
 (0)