From: Ben Pfaff Date: Wed, 17 Feb 2016 21:14:26 +0000 (-0800) Subject: ofp-util: Remove 'const' from struct ofputil_packet_in's 'packet' member. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=95022b47358676771e7b8050542fd4b2edfe18b9 ofp-util: Remove 'const' from struct ofputil_packet_in's 'packet' member. It's not const in all cases so it doesn't entirely make sense to mark it const here. Signed-off-by: Ben Pfaff Acked-by: Jarno Rajahalme --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 23f7eda28..d0579156f 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 866e1bc38..19bfc4b40 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 d4f64b223..cc947f0d0 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); }