1
0
mirror of https://github.com/rtbrick/bngblaster.git synced 2024-05-06 15:54:57 +00:00

Fix MC Traffic

This commit is contained in:
Christian Giese
2021-10-27 16:15:07 +02:00
parent 1c3cdcc429
commit ca9f38c184
2 changed files with 4 additions and 2 deletions

View File

@ -77,6 +77,7 @@ bbl_ctx_add (void)
CIRCLEQ_INIT(&ctx->interface_qhead);
ctx->flow_id = 1;
ctx->multicast_traffic = true;
/* Initialize hash table dictionaries. */
ctx->vlan_session_dict = hashtable_dict_new((dict_compare_func)bbl_compare_key64, bbl_key64_hash, BBL_SESSION_HASHTABLE_SIZE);

View File

@ -1778,7 +1778,7 @@ bbl_tx(bbl_ctx_s *ctx, bbl_interface_s *interface, uint8_t *buf, uint16_t *len)
return PROTOCOL_SUCCESS;
}
/* Write Multicast frames. */
if(ctx->config.send_multicast_traffic && ctx->config.igmp_group_count && ctx->multicast_traffic ) {
if(ctx->config.send_multicast_traffic && ctx->config.igmp_group_count && ctx->multicast_traffic) {
if(interface->mc_packet_cursor < ctx->config.igmp_group_count) {
memcpy(buf, interface->mc_packets + (interface->mc_packet_cursor*interface->mc_packet_len), interface->mc_packet_len);
*(uint64_t*)(buf + (interface->mc_packet_len - 16)) = interface->mc_packet_seq;
@ -1786,10 +1786,11 @@ bbl_tx(bbl_ctx_s *ctx, bbl_interface_s *interface, uint8_t *buf, uint16_t *len)
*(uint32_t*)(buf + (interface->mc_packet_len - 4)) = interface->tx_timestamp.tv_nsec;
*len = interface->mc_packet_len;
interface->mc_packet_cursor++;
interface->stats.mc_tx++;
return PROTOCOL_SUCCESS;
} else {
/* This must be the last send operation in this function to fill up remaining slots
* with multicast traffic but all other types of traffic have priority. */
* with multicast traffic but all other types of traffic have priority. */
interface->mc_packet_cursor = 0;
interface->mc_packet_seq++;
}