Commit 97b7af09 authored by Asbjørn Sloth Tønnesen's avatar Asbjørn Sloth Tønnesen Committed by David S. Miller

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: default avatarAsbjoern Sloth Toennesen <asbjorn@asbjorn.st>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7ff516ff
...@@ -384,6 +384,16 @@ static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 portid, u32 seq, int fla ...@@ -384,6 +384,16 @@ static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 portid, u32 seq, int fla
if (nla_put_u8(skb, L2TP_ATTR_UDP_CSUM, !sk->sk_no_check_tx)) if (nla_put_u8(skb, L2TP_ATTR_UDP_CSUM, !sk->sk_no_check_tx))
goto nla_put_failure; goto nla_put_failure;
break; break;
#if IS_ENABLED(CONFIG_IPV6)
case AF_INET6:
if (udp_get_no_check6_tx(sk) &&
nla_put_flag(skb, L2TP_ATTR_UDP_ZERO_CSUM6_TX))
goto nla_put_failure;
if (udp_get_no_check6_rx(sk) &&
nla_put_flag(skb, L2TP_ATTR_UDP_ZERO_CSUM6_RX))
goto nla_put_failure;
break;
#endif
} }
if (nla_put_u16(skb, L2TP_ATTR_UDP_SPORT, ntohs(inet->inet_sport)) || if (nla_put_u16(skb, L2TP_ATTR_UDP_SPORT, ntohs(inet->inet_sport)) ||
nla_put_u16(skb, L2TP_ATTR_UDP_DPORT, ntohs(inet->inet_dport))) nla_put_u16(skb, L2TP_ATTR_UDP_DPORT, ntohs(inet->inet_dport)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment