Commit 525c65ff authored by Andrea Mayer's avatar Andrea Mayer Committed by Paolo Abeni

seg6: factor out End lookup nexthop processing to a dedicated function

The End nexthop lookup/input operations are moved into a new helper
function named input_action_end_finish(). This avoids duplicating the
code needed to compute the nexthop in the different flavors of the End
behavior.
Signed-off-by: default avatarAndrea Mayer <andrea.mayer@uniroma2.it>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent f5b12be3
...@@ -364,6 +364,14 @@ static void seg6_next_csid_advance_arg(struct in6_addr *addr, ...@@ -364,6 +364,14 @@ static void seg6_next_csid_advance_arg(struct in6_addr *addr,
memset(&addr->s6_addr[16 - fnc_octects], 0x00, fnc_octects); memset(&addr->s6_addr[16 - fnc_octects], 0x00, fnc_octects);
} }
static int input_action_end_finish(struct sk_buff *skb,
struct seg6_local_lwt *slwt)
{
seg6_lookup_nexthop(skb, NULL, 0);
return dst_input(skb);
}
static int input_action_end_core(struct sk_buff *skb, static int input_action_end_core(struct sk_buff *skb,
struct seg6_local_lwt *slwt) struct seg6_local_lwt *slwt)
{ {
...@@ -375,9 +383,7 @@ static int input_action_end_core(struct sk_buff *skb, ...@@ -375,9 +383,7 @@ static int input_action_end_core(struct sk_buff *skb,
advance_nextseg(srh, &ipv6_hdr(skb)->daddr); advance_nextseg(srh, &ipv6_hdr(skb)->daddr);
seg6_lookup_nexthop(skb, NULL, 0); return input_action_end_finish(skb, slwt);
return dst_input(skb);
drop: drop:
kfree_skb(skb); kfree_skb(skb);
...@@ -395,9 +401,7 @@ static int end_next_csid_core(struct sk_buff *skb, struct seg6_local_lwt *slwt) ...@@ -395,9 +401,7 @@ static int end_next_csid_core(struct sk_buff *skb, struct seg6_local_lwt *slwt)
/* update DA */ /* update DA */
seg6_next_csid_advance_arg(daddr, finfo); seg6_next_csid_advance_arg(daddr, finfo);
seg6_lookup_nexthop(skb, NULL, 0); return input_action_end_finish(skb, slwt);
return dst_input(skb);
} }
static bool seg6_next_csid_enabled(__u32 fops) static bool seg6_next_csid_enabled(__u32 fops)
......
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