aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/xfrm4_tunnel.c
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2022-09-27 17:45:32 +0200
committerSteffen Klassert <steffen.klassert@secunet.com>2022-09-29 07:18:00 +0200
commit25ec92cd042ace0c109c3f6e5e6b634073414cc0 (patch)
treed03a2b5bc48a501fbfe89bdba109114ed933cda6 /net/ipv4/xfrm4_tunnel.c
parentxfrm: esp: add extack to esp_init_state, esp6_init_state (diff)
downloadlinux-dev-25ec92cd042ace0c109c3f6e5e6b634073414cc0.tar.xz
linux-dev-25ec92cd042ace0c109c3f6e5e6b634073414cc0.zip
xfrm: tunnel: add extack to ipip_init_state, xfrm6_tunnel_init_state
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to '')
-rw-r--r--net/ipv4/xfrm4_tunnel.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c
index 08826e0d7962..8489fa106583 100644
--- a/net/ipv4/xfrm4_tunnel.c
+++ b/net/ipv4/xfrm4_tunnel.c
@@ -24,11 +24,15 @@ static int ipip_xfrm_rcv(struct xfrm_state *x, struct sk_buff *skb)
static int ipip_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
{
- if (x->props.mode != XFRM_MODE_TUNNEL)
+ if (x->props.mode != XFRM_MODE_TUNNEL) {
+ NL_SET_ERR_MSG(extack, "IPv4 tunnel can only be used with tunnel mode");
return -EINVAL;
+ }
- if (x->encap)
+ if (x->encap) {
+ NL_SET_ERR_MSG(extack, "IPv4 tunnel is not compatible with encapsulation");
return -EINVAL;
+ }
x->props.header_len = sizeof(struct iphdr);