Skip to content

Commit

Permalink
lookup: Support BPF_FIB_LOOKUP_SKIP_NEIGH option
Browse files Browse the repository at this point in the history
Support setting BPF_FIB_LOOKUP_SKIP_NEIGH option through --skip-neigh
flag.

Signed-off-by: Yutaro Hayakawa <[email protected]>
  • Loading branch information
YutaroHayakawa committed Sep 1, 2024
1 parent 092b095 commit 28b18dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ var lookupCmd = &cobra.Command{
if output, _ := cmd.Flags().GetBool("output"); output {
flags |= BFP_FIB_LOOKUP_OUTPUT
}
if skipNeigh, _ := cmd.Flags().GetBool("skip-neigh"); skipNeigh {
flags |= BPF_FIB_LOOKUP_SKIP_NEIGH
}
if in.TableID != nil {
if flags&BFP_FIB_LOOKUP_DIRECT == 0 {
cmd.PrintErrf("Forcefully setting BFP_FIB_LOOKUP_DIRECT option since you specified table option which requires direct lookup. To suppress this message, set --direct flag explicitly.\n")
Expand Down Expand Up @@ -582,4 +585,5 @@ func init() {
lookupCmd.SetUsageFunc(lookupUsage)
lookupCmd.Flags().Bool("direct", false, "Set direct option (BPF_FIB_LOOKUP_DIRECT)")
lookupCmd.Flags().Bool("output", false, "Set output option (BPF_FIB_LOOKUP_OUTPUT)")
lookupCmd.Flags().Bool("skip-neigh", false, "Set skip-neigh option (BPF_FIB_LOOKUP_SKIP_NEIGH)")
}

0 comments on commit 28b18dc

Please sign in to comment.