diff options
author | Klement Sekera <ksekera@cisco.com> | 2021-10-14 15:41:42 +0200 |
---|---|---|
committer | Matthew Smith <mgsmith@netgate.com> | 2021-10-14 18:49:23 +0000 |
commit | 353575f604324154e1582364918ac10aea12dad4 (patch) | |
tree | 1b4345d4e3fb0030988cf511f9a1f8c467e065c4 /src/plugins/pppoe | |
parent | ff334db797c9cede308367ef1c27bd8dfce0baf4 (diff) |
pppoe: fix coverity warning
Initialise variable used in tracing code in case of early error so that
tracing doesn't use this uninitialised variable.
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I6b1cef07e1f126cee56e1116606869dd667274d2
Diffstat (limited to 'src/plugins/pppoe')
-rw-r--r-- | src/plugins/pppoe/pppoe_decap.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/plugins/pppoe/pppoe_decap.c b/src/plugins/pppoe/pppoe_decap.c index 71b9874081e..fe83c3a2c54 100644 --- a/src/plugins/pppoe/pppoe_decap.c +++ b/src/plugins/pppoe/pppoe_decap.c @@ -133,8 +133,10 @@ VLIB_NODE_FN (pppoe_input_node) (vlib_main_t * vm, pppoe0 = (pppoe_header_t*)(vlan0+1); if( type0 != ETHERNET_TYPE_PPPOE_DISCOVERY && type0 != ETHERNET_TYPE_PPPOE_SESSION ) { error0 = PPPOE_ERROR_BAD_VER_TYPE; - next0 = PPPOE_INPUT_NEXT_DROP; - goto trace0; + result0.fields.session_index = + ~0; // avoid tracing random data + next0 = PPPOE_INPUT_NEXT_DROP; + goto trace0; } } else { pppoe0 = (pppoe_header_t*)(h0+1); @@ -228,8 +230,10 @@ VLIB_NODE_FN (pppoe_input_node) (vlib_main_t * vm, pppoe1 = (pppoe_header_t*)(vlan1+1); if( type1 != ETHERNET_TYPE_PPPOE_DISCOVERY && type1 != ETHERNET_TYPE_PPPOE_SESSION ) { error1 = PPPOE_ERROR_BAD_VER_TYPE; - next1 = PPPOE_INPUT_NEXT_DROP; - goto trace1; + result1.fields.session_index = + ~0; // avoid tracing random data + next1 = PPPOE_INPUT_NEXT_DROP; + goto trace1; } } else { pppoe1 = (pppoe_header_t*)(h1+1); @@ -354,8 +358,10 @@ VLIB_NODE_FN (pppoe_input_node) (vlib_main_t * vm, pppoe0 = (pppoe_header_t*)(vlan0+1); if( type0 != ETHERNET_TYPE_PPPOE_DISCOVERY && type0 != ETHERNET_TYPE_PPPOE_SESSION ) { error0 = PPPOE_ERROR_BAD_VER_TYPE; - next0 = PPPOE_INPUT_NEXT_DROP; - goto trace00; + result0.fields.session_index = + ~0; // avoid tracing random data + next0 = PPPOE_INPUT_NEXT_DROP; + goto trace00; } } else { pppoe0 = (pppoe_header_t*)(h0+1); |