Skip to content

Commit 525c65f

Browse files
skorpion17Paolo Abeni
authored andcommitted
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: Andrea Mayer <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent f5b12be commit 525c65f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

net/ipv6/seg6_local.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,14 @@ static void seg6_next_csid_advance_arg(struct in6_addr *addr,
364364
memset(&addr->s6_addr[16 - fnc_octects], 0x00, fnc_octects);
365365
}
366366

367+
static int input_action_end_finish(struct sk_buff *skb,
368+
struct seg6_local_lwt *slwt)
369+
{
370+
seg6_lookup_nexthop(skb, NULL, 0);
371+
372+
return dst_input(skb);
373+
}
374+
367375
static int input_action_end_core(struct sk_buff *skb,
368376
struct seg6_local_lwt *slwt)
369377
{
@@ -375,9 +383,7 @@ static int input_action_end_core(struct sk_buff *skb,
375383

376384
advance_nextseg(srh, &ipv6_hdr(skb)->daddr);
377385

378-
seg6_lookup_nexthop(skb, NULL, 0);
379-
380-
return dst_input(skb);
386+
return input_action_end_finish(skb, slwt);
381387

382388
drop:
383389
kfree_skb(skb);
@@ -395,9 +401,7 @@ static int end_next_csid_core(struct sk_buff *skb, struct seg6_local_lwt *slwt)
395401
/* update DA */
396402
seg6_next_csid_advance_arg(daddr, finfo);
397403

398-
seg6_lookup_nexthop(skb, NULL, 0);
399-
400-
return dst_input(skb);
404+
return input_action_end_finish(skb, slwt);
401405
}
402406

403407
static bool seg6_next_csid_enabled(__u32 fops)

0 commit comments

Comments
 (0)