sure, thanks,

On Tue, Dec 17, 2013 at 3:12 PM, Ben Pfaff <b...@nicira.com> wrote:

> On Tue, Dec 17, 2013 at 02:37:10PM -0800, Alex Wang wrote:
> > This commit adds check of sock pointer in dpif_linux_port_get_pid().
> > If the pointer is NULL, do not call nl_sock_pid().
> >
> > Signed-off-by: Alex Wang <al...@nicira.com>
> > ---
> >  lib/dpif-linux.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
> > index 52c3f65..a88f8aa 100644
> > --- a/lib/dpif-linux.c
> > +++ b/lib/dpif-linux.c
> > @@ -688,7 +688,8 @@ dpif_linux_port_get_pid(const struct dpif *dpif_,
> odp_port_t port_no)
> >          /* The ODPP_NONE "reserved" port number uses the "ovs-system"'s
> >           * channel, since it is not heavily loaded. */
> >          uint32_t idx = port_idx >= dpif->uc_array_size ? 0 : port_idx;
> > -        pid = nl_sock_pid(dpif->channels[idx].sock);
> > +        pid = !dpif->channels[idx].sock ? 0
> > +                  : nl_sock_pid(dpif->channels[idx].sock);
>
> Thanks, I'm going to apply both patches in a minute.
>
> I'm going to change the code here to:
>         const struct nl_sock *sock = dpif->channels[idx].sock;
>         pid = sock ? nl_sock_pid(sock) : 0;
> because it reads better to me.
>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to