On Mon, Mar 30, 2020 at 12:15:46PM -0700, [email protected] wrote:
> From: Usman Ansari <[email protected]>
> 
> Coverity reports unreachable code in "?" statement
> Fixed by removing code segment
> 
> Signed-off-by: Usman Ansari <[email protected]>

This code looks pretty confused.  I don't think we should just change it
without understanding it.

Pieter and Simon, you were both involved in the following code in
tc_add_matchall_policer().  It sets block_id to a constant zero, never
changes it, and then tests its value.  Surely that was not the
intention.  What's the real goal here?

>     int ifindex, index, err = 0;
>     struct tc_police pol_act;
>     uint32_t block_id = 0;
>     struct ofpbuf request;
>     struct ofpbuf *reply;
>     struct tcmsg *tcmsg;
>     uint32_t handle = 1;
> 
>     err = get_ifindex(netdev, &ifindex);
>     if (err) {
>         return err;
>     }
> 
>     index = block_id ? TCM_IFINDEX_MAGIC_BLOCK : ifindex;
>     tcmsg = tc_make_request(index, RTM_NEWTFILTER, NLM_F_CREATE | NLM_F_ECHO,
>                             &request);
>     tcmsg->tcm_parent = block_id ? : TC_INGRESS_PARENT;
>     tcmsg->tcm_info = tc_make_handle(prio, eth_type);
>     tcmsg->tcm_handle = handle;

Thanks,

Ben.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to