Skip to content
Snippets Groups Projects
Commit 15c64864 authored by Aomx's avatar Aomx
Browse files

injecting custom hb-information with heartbeat-ack-chunk now possible

parent 989994ad
No related branches found
No related tags found
No related merge requests found
......@@ -2479,6 +2479,10 @@ static int send_live_ip_packet(struct netdev *netdev,
return netdev_send(netdev, packet);
}
static inline bool is_generic_chunk(struct sctp_chunk_list_item *item) {
return item->flags & FLAG_CHUNK_IS_GENERIC_CHUNK;
}
/* Perform the action implied by an inbound packet in a script */
static int do_inbound_script_packet(
struct state *state, struct packet *packet,
......@@ -2559,6 +2563,10 @@ static int do_inbound_script_packet(
}
break;
case SCTP_HEARTBEAT_ACK_CHUNK_TYPE:
if (is_generic_chunk(item)) {
break;
}
temp_offset = socket->prepared_heartbeat_ack_length - item->length;
assert(packet->ip_bytes + temp_offset <= packet->buffer_bytes);
memmove((u8 *)item->chunk + item->length + temp_offset,
......
......@@ -325,6 +325,9 @@ sctp_generic_chunk_new(s64 type, s64 flgs, s64 len,
u16 length, padding_length, i;
flags = 0;
flags |= FLAG_CHUNK_IS_GENERIC_CHUNK;
if (bytes == NULL) {
flags |= FLAG_CHUNK_VALUE_NOCHECK;
}
......
......@@ -187,6 +187,7 @@ sctp_chunk_list_item_new(struct sctp_chunk *chunk, u32 length, u32 flags,
#define FLAG_CHUNK_FLAGS_NOCHECK 0x00000002
#define FLAG_CHUNK_LENGTH_NOCHECK 0x00000004
#define FLAG_CHUNK_VALUE_NOCHECK 0x00000008
#define FLAG_CHUNK_IS_GENERIC_CHUNK 0x00000010
struct sctp_chunk_list_item *
sctp_generic_chunk_new(s64 type, s64 flgs, s64 len,
......
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