ofp-util: Remove 'const' from struct ofputil_packet_in's 'packet' member.
authorBen Pfaff <blp@ovn.org>
Wed, 17 Feb 2016 21:14:26 +0000 (13:14 -0800)
committerBen Pfaff <blp@ovn.org>
Sat, 20 Feb 2016 00:15:44 +0000 (16:15 -0800)
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@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
lib/ofp-util.c
lib/ofp-util.h
ofproto/connmgr.c

index 23f7eda..d057915 100644 (file)
@@ -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);
index 866e1bc..19bfc4b 100644 (file)
@@ -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. */
index d4f64b2..cc947f0 100644 (file)
@@ -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);
 }