X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fpackets.h;h=7e2d4e991851c4f25826ca5416d15c28f6f5fe3f;hb=552e20d02a32cf70b4fcaa18d6f0817f80a3d8d0;hp=5f9be01e415fdc243fdc6bf41f708a7a86baac98;hpb=038341d1c1c33107a7f2ad06a5acb47c5fff7967;p=sliver-openvswitch.git diff --git a/lib/packets.h b/lib/packets.h index 5f9be01e4..7e2d4e991 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -272,16 +272,12 @@ struct vlan_eth_header { } __attribute__((packed)); BUILD_ASSERT_DECL(VLAN_ETH_HEADER_LEN == sizeof(struct vlan_eth_header)); -/* The "(void) (ip)[0]" below has no effect on the value, since it's the first - * argument of a comma expression, but it makes sure that 'ip' is a pointer. - * This is useful since a common mistake is to pass an integer instead of a - * pointer to IP_ARGS. */ -#define IP_FMT "%"PRIu8".%"PRIu8".%"PRIu8".%"PRIu8 +#define IP_FMT "%"PRIu32".%"PRIu32".%"PRIu32".%"PRIu32 #define IP_ARGS(ip) \ - ((void) (ip)[0], ((uint8_t *) ip)[0]), \ - ((uint8_t *) ip)[1], \ - ((uint8_t *) ip)[2], \ - ((uint8_t *) ip)[3] + ntohl(ip) >> 24, \ + (ntohl(ip) >> 16) & 0xff, \ + (ntohl(ip) >> 8) & 0xff, \ + ntohl(ip) & 0xff /* Example: *