[ovs-dev] [PATCH v4 02/14] ofp-util: Remove 'const' from struct ofputil_packet_in's 'packet' member.
Jarno Rajahalme
jarno at ovn.org
Fri Feb 19 21:50:02 UTC 2016
Acked-by: Jarno Rajahalme <jarno at ovn.org>
> On Feb 19, 2016, at 12:34 AM, Ben Pfaff <blp at ovn.org> wrote:
>
> It's not const in all cases so it doesn't entirely make sense to mark
> it const here.
>
> Signed-off-by: Ben Pfaff <blp at ovn.org>
> ---
> lib/ofp-util.c | 2 +-
> lib/ofp-util.h | 2 +-
> ofproto/connmgr.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/ofp-util.c b/lib/ofp-util.c
> index 23f7eda..d057915 100644
> --- a/lib/ofp-util.c
> +++ b/lib/ofp-util.c
> @@ -3341,7 +3341,7 @@ ofputil_decode_packet_in(const struct ofp_header *oh,
>
> opi = ofpbuf_pull(&b, offsetof(struct ofp10_packet_in, data));
>
> - pin->packet = opi->data;
> + pin->packet = CONST_CAST(uint8_t *, opi->data);
> pin->len = b.size;
>
> match_init_catchall(&pin->flow_metadata);
> diff --git a/lib/ofp-util.h b/lib/ofp-util.h
> index 866e1bc..19bfc4b 100644
> --- a/lib/ofp-util.h
> +++ b/lib/ofp-util.h
> @@ -426,7 +426,7 @@ struct ofputil_packet_in {
> * On decoding, the 'len' bytes in 'packet' might only be the first part of
> * the original packet. ofputil_decode_packet_in() reports the full
> * original length of the packet using its 'total_len' output parameter. */
> - const void *packet; /* The packet. */
> + void *packet; /* The packet. */
> size_t len; /* Length of 'packet' in bytes. */
>
> /* Input port and other metadata for packet. */
> diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
> index d4f64b2..cc947f0 100644
> --- a/ofproto/connmgr.c
> +++ b/ofproto/connmgr.c
> @@ -2247,6 +2247,6 @@ ofmonitor_wait(struct connmgr *mgr)
> void
> ofproto_async_msg_free(struct ofproto_async_msg *am)
> {
> - free(CONST_CAST(void *, am->pin.up.packet));
> + free(am->pin.up.packet);
> free(am);
> }
> --
> 2.1.3
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list