session: incomprehensible error message for adding sdl and rule-table entry 72/41672/1
authorSteven Luong <[email protected]>
Wed, 2 Oct 2024 16:35:33 +0000 (09:35 -0700)
committerSteven Luong <[email protected]>
Wed, 2 Oct 2024 16:41:53 +0000 (09:41 -0700)
commit2c52f5e8886fe2d7fa2aeb1fa15a8c9491b0128e
tree42e0a661a5f5a83feb42877f22a2add6823258f4
parent056b7d05875083fcb30637db848607c47cc9d3c9
session: incomprehensible error message for adding sdl and rule-table entry

1. When the backend engine is not enable, adding an entry returns
a confusing error message.

DBGvpp# session sdl add 191.1.1.30/32 action 1 tag blue-v4-rule1
session sdl add 191.1.1.30/32 action 1 tag blue-v4-rule1
unknown input `add  191.1.1.30/32 action 1 ta...'
DBGvpp#

2. When the sdl or rule-table entry is already present, adding the duplicate
entry returns a confusing error message.

DBGvpp# session sdl add  8.8.8.1/32 action 0
session sdl add  8.8.8.1/32 action 0
DBGvpp# session sdl add  8.8.8.1/32 action 0
session sdl add  8.8.8.1/32 action 0
session: session is already enable. Must disable first
DBGvpp#

The problem is because there are multiple cli commands start with "session".
When the command is failed with the best match chain, it passes the
command to the other parser chains which start with the keyword "session".
The other cli chain also fails to parse the command. The error message
that the previous parser chain returned may be overwritten by
the newest error message.

The fix is to not return an error in sdl and rule-table parser command chain.

Type: fix

Change-Id: If0165324a763f47ec98ab79a41c3ee9b10057454
Signed-off-by: Steven Luong <[email protected]>
src/vnet/session/session_lookup.c
src/vnet/session/session_sdl.c