On Wed, Jan 16, 2019 at 09:04:16AM +0000, Pieter Jansen van Vuuren wrote:
> +/* These functions specifically help shifting values that are in
> + * network byte order but stored in uint32_t variables. */
> +static uint32_t shift_ovs_be32_left(uint32_t word, int shift)
> +{
> +        uint32_t word_shifted = ntohl((OVS_FORCE ovs_be32)word) << shift;
> +
> +        return (OVS_FORCE uint32_t)htonl(word_shifted);
> +}
> +
> +static uint32_t shift_ovs_be32_right(uint32_t word, int shift)
> +{
> +        uint32_t word_shifted = ntohl((OVS_FORCE ovs_be32)word) >> shift;
> +
> +        return (OVS_FORCE uint32_t)htonl(word_shifted);
> +}

Let me try this again.

Why are we storing network-byte-order data in uint32_t?  It should be in
ovs_be32.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to