ofproto: Fix bug in "trace" command.
authorBen Pfaff <blp@nicira.com>
Thu, 20 Jan 2011 20:27:34 +0000 (12:27 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 20 Jan 2011 20:27:34 +0000 (12:27 -0800)
tun_id is a 64-bit field but it was being treated here as a 32-bit field.

ofproto/ofproto.c

index 2eae86dd880bcc622b8f0151e5918452534643bc..e081e32e96c2a3c6f2bfbf34774cb106879a2be0 100644 (file)
@@ -5026,7 +5026,7 @@ ofproto_unixctl_trace(struct unixctl_conn *conn, const char *args_,
     struct ds result;
     struct flow flow;
     uint16_t in_port;
-    ovs_be32 tun_id;
+    ovs_be64 tun_id;
     char *s;
 
     ofpbuf_init(&packet, strlen(args) / 2);
@@ -5048,7 +5048,7 @@ ofproto_unixctl_trace(struct unixctl_conn *conn, const char *args_,
         goto exit;
     }
 
-    tun_id = ntohl(strtoul(tun_id_s, NULL, 10));
+    tun_id = htonll(strtoull(tun_id_s, NULL, 10));
     in_port = ofp_port_to_odp_port(atoi(in_port_s));
 
     packet_s = ofpbuf_put_hex(&packet, packet_s, NULL);