Fix stupid bug, test was backwards

This commit is contained in:
Jeremy Lakeman 2013-06-03 16:04:08 +09:30
parent b1f384cd63
commit d3a13f8d2c
4 changed files with 3 additions and 4 deletions

View File

@ -97,7 +97,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define PAYLOAD_FLAG_ONE_HOP (1<<2)
#define PAYLOAD_FLAG_CIPHERED (1<<4)
#define PAYLOAD_FLAG_SIGNED (1<<5)
#define PAYLOAD_FLAG_DUPLICATE (1<<6)
/* Time-to-live is a 'uint5_t'.
*/

View File

@ -227,7 +227,7 @@ int parseMdpPacketHeader(struct decode_context *context, struct overlay_frame *f
}else
frame->type=OF_TYPE_DATA;
if (context->packet_version >0){
if (context->packet_version >= 1){
int seq = ob_get(buffer);
if (seq == -1)
RETURN(WHY("Unable to read packet seq"));

View File

@ -73,7 +73,7 @@ static int overlay_frame_build_header(int packet_version, struct decode_context
if (ob_append_byte(buff, type)) return -1;
}
if (packet_version>0)
if (packet_version >= 1)
if (ob_append_byte(buff, sequence))
return -1;

View File

@ -494,7 +494,7 @@ overlay_stuff_packet(struct outgoing_packet *packet, overlay_txqueue *queue, tim
}else{
// is this packet going our way?
if (frame->interface!=packet->interface ||
frame->packet_version==packet->packet_version ||
frame->packet_version!=packet->packet_version ||
memcmp(&packet->dest, &frame->recvaddr, sizeof(packet->dest))!=0){
goto skip;
}