Yes, it makes sense, since we use uint here. Thanks for the explanation.

On Wed, Jul 17, 2013 at 11:45 AM, Ben Pfaff <b...@nicira.com> wrote:

> On Wed, Jul 17, 2013 at 11:26:06AM -0700, Alex Wang wrote:
> > Just one question, for the code below in "lib/byteq.c"
> >
> > """
> > /* Returns the number of bytes current queued in 'q'. */
> > int
> > byteq_used(const struct byteq *q)
> > {
> >     return q->head - q->tail;
> > }
> > """
> >
> > Is it possible that the jsonrpc session last so long that the 'q->head'
> > gets overflowed? or the chance is so slim that we do not care,
>
> It can overflow but it doesn't matter, arithmetic modulo 2**N will
> always do the right thing anyway.
>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to