71 |
return 0; |
return 0; |
72 |
} |
} |
73 |
|
|
74 |
|
/* Check client bit */ |
75 |
|
if(header->client) |
76 |
|
{ |
77 |
|
debug(1,"P3 - Bad packet received:\n"); |
78 |
|
debug(1,"\tthis is a client packet!\n"); |
79 |
|
return 0; |
80 |
|
} |
81 |
|
|
82 |
/* Check CRC */ |
/* Check CRC */ |
83 |
crc = htons (p3_crc16 ((char *) &header->size, data_size + 5)); |
crc = htons (p3_crc16 ((char *) &header->size, data_size + 5)); |
84 |
if (crc != header->checksum) |
if (crc != header->checksum) |
105 |
/* packet is data and the seq isn't what we expect */ |
/* packet is data and the seq isn't what we expect */ |
106 |
return 0; |
return 0; |
107 |
} |
} |
108 |
|
if ((header->type == TYPE_PING || header->type == TYPE_NACK) && |
109 |
|
header->seq !=srv.lastseq) |
110 |
|
{ |
111 |
|
debug (1, "P3 - Bad ordering for packet received\n"); |
112 |
|
debug (1, "\tseq received: %d\n", header->seq); |
113 |
|
debug (1, "\tseq expected: %d\n", srv.lastseq); |
114 |
|
/* packet is data and the seq isn't what we expect */ |
115 |
|
return 0; |
116 |
|
} |
117 |
|
|
118 |
return 1; |
return 1; |
119 |
} |
} |