Commit 6285217f authored by David Lebrun's avatar David Lebrun Committed by David S. Miller

ipv6: sr: enforce IPv6 packets for seg6local lwt

This patch ensures that the seg6local lightweight tunnel is used solely
with IPv6 routes and processes only IPv6 packets.
Signed-off-by: default avatarDavid Lebrun <david.lebrun@uclouvain.be>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 38ee7f2d
...@@ -357,6 +357,11 @@ static int seg6_local_input(struct sk_buff *skb) ...@@ -357,6 +357,11 @@ static int seg6_local_input(struct sk_buff *skb)
struct seg6_action_desc *desc; struct seg6_action_desc *desc;
struct seg6_local_lwt *slwt; struct seg6_local_lwt *slwt;
if (skb->protocol != htons(ETH_P_IPV6)) {
kfree_skb(skb);
return -EINVAL;
}
slwt = seg6_local_lwtunnel(orig_dst->lwtstate); slwt = seg6_local_lwtunnel(orig_dst->lwtstate);
desc = slwt->desc; desc = slwt->desc;
...@@ -623,6 +628,9 @@ static int seg6_local_build_state(struct nlattr *nla, unsigned int family, ...@@ -623,6 +628,9 @@ static int seg6_local_build_state(struct nlattr *nla, unsigned int family,
struct seg6_local_lwt *slwt; struct seg6_local_lwt *slwt;
int err; int err;
if (family != AF_INET6)
return -EINVAL;
err = nla_parse_nested(tb, SEG6_LOCAL_MAX, nla, seg6_local_policy, err = nla_parse_nested(tb, SEG6_LOCAL_MAX, nla, seg6_local_policy,
extack); extack);
......
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