> On Apr 14, 2015, at 1:25 PM, Sorin Vinturis 
> <svintu...@cloudbasesolutions.com> wrote:
> 
> The nl_sock_transact_multiple function enters in an infinite loop,
> when invalid error, EINVAL, is returned by nl_sock_transact_multiple__.
> EINVAL is the error returned by the latter function when a driver
> request fails.
> 
> Signed-off-by: Sorin Vinturis <svintu...@cloudbasesolutions.com>
> Reported-by: Alin Gabriel Serdean <aserd...@cloudbasesolutions.com>
> Reported-at: 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_57&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=pNHQcdr7B40b4h6Yb7FIedI1dnBsxdDuTLBYD3JqV80&m=1f2zIwPFpWSly3U5H2dM14tDO37_VH_brPu_4tZ73l8&s=0ycr1AWzIKJha9qokQS0bWBv6yrVNhNQ7USXYajfxZw&e=
>  
> ---
> lib/netlink-socket.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
> index fab2a66..cdc80e5 100644
> --- a/lib/netlink-socket.c
> +++ b/lib/netlink-socket.c
> @@ -909,6 +909,10 @@ nl_sock_transact_multiple(struct nl_sock *sock,
>         } else if (error) {
>             VLOG_ERR_RL(&rl, "transaction error (%s)", ovs_strerror(error));
>             nl_sock_record_errors__(transactions, n, error);
> +            if (error == EINVAL) {
> +                /* driver request failed. */

minor: you could say “a fatal must have occurred” for clarity.

Also, we should generalize for all error codes, and not specifically for 
EINVAL. You can perhaps leave out EAGAIN. The current Windows code returns only 
EINVAL, but this will change. Also, Linux code can return something else.

> +                break;
> +            }
>         }
>     }
> }

Like we have discussed in the thread (thanks Ben & Alin), we need more changes, 
but this change is good in itself (but for the comments above).

-- Nithin
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to