Jiri,

I think this series brings a nice improvement, on second look. But the
change in this patch could be better yet?

See below...

On Fri, Apr 11, 2014 at 12:25:54PM +0200, Jiri Benc wrote:
> diff --git a/transport.c b/transport.c
> index cb799a68aa9f..25d569607f71 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -39,23 +39,25 @@ int transport_open(struct transport *t, const char *name,
>  
>  int transport_recv(struct transport *t, int fd, struct ptp_message *msg)
>  {
> -     return t->recv(t, fd, msg, sizeof(msg->data), &msg->hwts);
> +     return t->recv(t, fd, msg, sizeof(msg->data), &msg->address, 
> &msg->hwts);
>  }
>  
>  int transport_send(struct transport *t, struct fdarray *fda, int event,
>                  struct ptp_message *msg)
>  {
>       int len = ntohs(msg->header.messageLength);
> +     struct address *addr = t->default_addr(t, event, 0);

I don't see why you need to call into the transport twice.

Can't you pass addr=NULL in order to get the default address?
  
> -     return t->send(t, fda, event, 0, msg, len, &msg->hwts);
> +     return t->send(t, fda, event, msg, len, addr, &msg->hwts);
>  }
>  

Thanks,
Richard

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to