Skip to content

Commit

Permalink
fix: clear buffer before sending
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Dec 1, 2023
1 parent 327dd39 commit d2a2e94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/transport/raweth/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const _zp_raweth_cfg_entry _ZP_RAWETH_CFG_ARRAY[] = {
const _zp_raweth_cfg_whitelist_val _ZP_RAWETH_CFG_WHITELIST[] = {
{{0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}},
{{0x00, 0x11, 0x22, 0x33, 0x44, 0x55}},
{{0x30, 0x03, 0xc8, 0x37, 0x25, 0xa1}},
};

// Don't modify
Expand Down
4 changes: 4 additions & 0 deletions src/transport/raweth/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ int8_t _z_raweth_send_t_msg(_z_transport_multicast_t *ztm, const _z_transport_me
#if Z_FEATURE_MULTI_THREAD == 1
_z_mutex_lock(&ztm->_mutex_tx);
#endif
// Reset wbuf
_z_wbuf_set_wpos(&ztm->_wbuf, 0);
// Set socket info
_Z_RETURN_IF_ERR(_zp_raweth_set_socket(NULL, &ztm->_link._socket._raweth));
// Write the message header
Expand Down Expand Up @@ -234,6 +236,8 @@ int8_t _z_raweth_send_n_msg(_z_session_t *zn, const _z_network_message_t *n_msg,
default:
break;
}
// Reset wbuf
_z_wbuf_set_wpos(&ztm->_wbuf, 0);
// Set socket info
_Z_RETURN_IF_ERR(_zp_raweth_set_socket(keyexpr, &ztm->_link._socket._raweth));
// Write the eth header
Expand Down

0 comments on commit d2a2e94

Please sign in to comment.