[ovs-dev] [PATCH] bfd: Use htonll() instead of htonl() for tunnel ID constant.

Ben Pfaff blp at nicira.com
Wed Jul 17 17:36:22 UTC 2013


Thanks, applied to master.

On Wed, Jul 17, 2013 at 03:06:58PM +0900, Joe Stringer wrote:
> Looks good.
> 
> On Wed, Jul 17, 2013 at 2:06 AM, Ben Pfaff <blp at nicira.com> wrote:
> > This is not a real bug, since htonl(0) and htonll(0) have the same value
> > although not the same type.
> >
> > Found by sparse.
> >
> > CC: Pavithra Ramesh <paramesh at vmware.com>
> > CC: Ethan Jackson <ethan at nicira.com>
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > ---
> >  lib/bfd.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> >
> > diff --git a/lib/bfd.c b/lib/bfd.c
> > index a06611a..3ac257a 100644
> > --- a/lib/bfd.c
> > +++ b/lib/bfd.c
> > @@ -17,6 +17,7 @@
> >
> >  #include <arpa/inet.h>
> >
> > +#include "byte-order.h"
> >  #include "csum.h"
> >  #include "dpif.h"
> >  #include "dynamic-string.h"
> > @@ -458,7 +459,7 @@ bfd_should_process_flow(const struct bfd *bfd, const struct flow *flow,
> >      return (flow->dl_type == htons(ETH_TYPE_IP)
> >              && flow->nw_proto == IPPROTO_UDP
> >              && flow->tp_dst == htons(3784)
> > -            && (!bfd->check_tnl_key || flow->tunnel.tun_id == htonl(0)));
> > +            && (!bfd->check_tnl_key || flow->tunnel.tun_id == htonll(0)));
> >  }
> >
> >  void
> > --
> > 1.7.2.5
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list