Skip to content
Snippets Groups Projects
Commit d9f02651 authored by Michael Tüxen's avatar Michael Tüxen
Browse files

Allow multiple COOKIE-ECHO to be injected.

parent 29fd00d9
No related branches found
No related tags found
No related merge requests found
...@@ -2522,8 +2522,7 @@ static int do_inbound_script_packet( ...@@ -2522,8 +2522,7 @@ static int do_inbound_script_packet(
} }
break; break;
case SCTP_COOKIE_ECHO_CHUNK_TYPE: case SCTP_COOKIE_ECHO_CHUNK_TYPE:
if ((socket->state == SOCKET_PASSIVE_INIT_ACK_SENT) && if (item->flags & FLAG_CHUNK_VALUE_NOCHECK) {
(item->flags & FLAG_CHUNK_VALUE_NOCHECK)) {
temp_offset = socket->prepared_cookie_echo_length - item->length; temp_offset = socket->prepared_cookie_echo_length - item->length;
assert(packet->ip_bytes + temp_offset <= packet->buffer_bytes); assert(packet->ip_bytes + temp_offset <= packet->buffer_bytes);
memmove((u8 *)item->chunk + item->length + temp_offset, memmove((u8 *)item->chunk + item->length + temp_offset,
...@@ -2550,9 +2549,14 @@ static int do_inbound_script_packet( ...@@ -2550,9 +2549,14 @@ static int do_inbound_script_packet(
assert(packet->headers[i + 1].type == HEADER_SCTP); assert(packet->headers[i + 1].type == HEADER_SCTP);
packet->headers[i].total_bytes += temp_offset; packet->headers[i].total_bytes += temp_offset;
packet->headers[i + 1].total_bytes += temp_offset; packet->headers[i + 1].total_bytes += temp_offset;
socket->state = SOCKET_PASSIVE_COOKIE_ECHO_RECEIVED;
offset += temp_offset; offset += temp_offset;
} }
if (((packet->flags & FLAGS_SCTP_BAD_CRC32C) == 0) &&
(((packet->flags & FLAGS_SCTP_EXPLICIT_TAG) == 0) ||
((ntohl(packet->sctp->v_tag) == socket->script.local_initiate_tag) &&
(socket->script.local_initiate_tag != 0)))) {
socket->state = SOCKET_PASSIVE_COOKIE_ECHO_RECEIVED;
}
break; break;
case SCTP_HEARTBEAT_ACK_CHUNK_TYPE: case SCTP_HEARTBEAT_ACK_CHUNK_TYPE:
temp_offset = socket->prepared_heartbeat_ack_length - item->length; temp_offset = socket->prepared_heartbeat_ack_length - item->length;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment