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
@@ -133,6 +133,8 @@ 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;
+ result0.fields.session_index =
+ ~0; // avoid tracing random data
next0 = PPPOE_INPUT_NEXT_DROP;
goto trace0;
}
@@ -228,6 +230,8 @@ 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;
+ result1.fields.session_index =
+ ~0; // avoid tracing random data
next1 = PPPOE_INPUT_NEXT_DROP;
goto trace1;
}
@@ -354,6 +358,8 @@ 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;
+ result0.fields.session_index =
+ ~0; // avoid tracing random data
next0 = PPPOE_INPUT_NEXT_DROP;
goto trace00;
}
