Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next/96/60x/20230722/v1 #9277

Merged
merged 3 commits into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/src/dcerpc/dcerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ impl DCERPCState {
if let Some(ref mut bind) = self.bind {
let mut uuid_internal_id = 0;
for r in back.ctxitems.iter() {
for mut uuid in bind.uuid_list.iter_mut() {
for uuid in bind.uuid_list.iter_mut() {
if uuid.internal_id == uuid_internal_id {
uuid.result = r.ack_result;
if uuid.result != 0 {
Expand Down
4 changes: 2 additions & 2 deletions rust/src/ssh/ssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl SSHState {
fn parse_record(
&mut self, mut input: &[u8], resp: bool, pstate: *mut std::os::raw::c_void,
) -> AppLayerResult {
let (mut hdr, ohdr) = if !resp {
let (hdr, ohdr) = if !resp {
(&mut self.transaction.cli_hdr, &self.transaction.srv_hdr)
} else {
(&mut self.transaction.srv_hdr, &self.transaction.cli_hdr)
Expand Down Expand Up @@ -276,7 +276,7 @@ impl SSHState {
fn parse_banner(
&mut self, input: &[u8], resp: bool, pstate: *mut std::os::raw::c_void,
) -> AppLayerResult {
let mut hdr = if !resp {
let hdr = if !resp {
&mut self.transaction.cli_hdr
} else {
&mut self.transaction.srv_hdr
Expand Down
1 change: 1 addition & 0 deletions src/decode-ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ int DecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *
DecodeIP6inIP6(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p));
return TM_ECODE_OK;
case IPPROTO_GRE:
IPV6_SET_L4PROTO(p, IPPROTO_GRE);
DecodeGRE(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p));
break;
case IPPROTO_FRAGMENT:
Expand Down
4 changes: 2 additions & 2 deletions src/detect-engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -2591,7 +2591,7 @@ static TmEcode DetectEngineThreadCtxInitForMT(ThreadVars *tv, DetectEngineThread
DetectEngineTenantMapping *map_array = NULL;
uint32_t map_array_size = 0;
uint32_t map_cnt = 0;
int max_tenant_id = 0;
uint32_t max_tenant_id = 0;
DetectEngineCtx *list = master->list;
HashTable *mt_det_ctxs_hash = NULL;

Expand Down Expand Up @@ -3923,7 +3923,7 @@ static uint32_t DetectEngineTentantGetIdFromPcap(const void *ctx, const Packet *
return p->pcap_v.tenant_id;
}

DetectEngineCtx *DetectEngineGetByTenantId(int tenant_id)
DetectEngineCtx *DetectEngineGetByTenantId(uint32_t tenant_id)
{
DetectEngineMasterCtx *master = &g_master_de_ctx;
SCMutexLock(&master->lock);
Expand Down
2 changes: 1 addition & 1 deletion src/detect-engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ uint32_t DetectEngineGetVersion(void);
void DetectEngineBumpVersion(void);
int DetectEngineAddToMaster(DetectEngineCtx *de_ctx);
DetectEngineCtx *DetectEngineGetCurrent(void);
DetectEngineCtx *DetectEngineGetByTenantId(int tenant_id);
DetectEngineCtx *DetectEngineGetByTenantId(uint32_t tenant_id);
void DetectEnginePruneFreeList(void);
int DetectEngineMoveToFreeList(DetectEngineCtx *de_ctx);
DetectEngineCtx *DetectEngineReference(DetectEngineCtx *);
Expand Down
2 changes: 1 addition & 1 deletion src/detect.h
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ typedef struct DetectEngineCtx_ {
uint8_t flags;
int failure_fatal;

int tenant_id;
uint32_t tenant_id;

Signature *sig_list;
uint32_t sig_cnt;
Expand Down
26 changes: 9 additions & 17 deletions src/runmode-unix-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int unix_socket_mode_is_running = 0;
typedef struct PcapFiles_ {
char *filename;
char *output_dir;
int tenant_id;
uint32_t tenant_id;
time_t delay;
time_t poll_interval;
bool continuous;
Expand Down Expand Up @@ -246,16 +246,8 @@ static void PcapFilesFree(PcapFiles *cfile)
*
* \retval 0 in case of error, 1 in case of success
*/
static TmEcode UnixListAddFile(
PcapCommand *this,
const char *filename,
const char *output_dir,
int tenant_id,
bool continuous,
bool should_delete,
time_t delay,
time_t poll_interval
)
static TmEcode UnixListAddFile(PcapCommand *this, const char *filename, const char *output_dir,
uint32_t tenant_id, bool continuous, bool should_delete, time_t delay, time_t poll_interval)
{
PcapFiles *cfile = NULL;
if (filename == NULL || this == NULL)
Expand Down Expand Up @@ -308,7 +300,7 @@ static TmEcode UnixSocketAddPcapFileImpl(json_t *cmd, json_t* answer, void *data
PcapCommand *this = (PcapCommand *) data;
const char *filename;
const char *output_dir;
int tenant_id = 0;
uint32_t tenant_id = 0;
bool should_delete = false;
time_t delay = 30;
time_t poll_interval = 5;
Expand Down Expand Up @@ -769,7 +761,7 @@ TmEcode UnixSocketRegisterTenantHandler(json_t *cmd, json_t* answer, void *data)
json_object_set_new(answer, "message", json_string("id is not an integer"));
return TM_ECODE_FAILED;
}
int tenant_id = json_integer_value(jarg);
uint32_t tenant_id = json_integer_value(jarg);

/* 2 get tenant handler type */
jarg = json_object_get(cmd, "htype");
Expand Down Expand Up @@ -850,7 +842,7 @@ TmEcode UnixSocketUnregisterTenantHandler(json_t *cmd, json_t* answer, void *dat
json_object_set_new(answer, "message", json_string("id is not an integer"));
return TM_ECODE_FAILED;
}
int tenant_id = json_integer_value(jarg);
uint32_t tenant_id = json_integer_value(jarg);

/* 2 get tenant handler type */
jarg = json_object_get(cmd, "htype");
Expand Down Expand Up @@ -935,7 +927,7 @@ TmEcode UnixSocketRegisterTenant(json_t *cmd, json_t* answer, void *data)
json_object_set_new(answer, "message", json_string("id is not an integer"));
return TM_ECODE_FAILED;
}
int tenant_id = json_integer_value(jarg);
uint32_t tenant_id = json_integer_value(jarg);

/* 2 get tenant yaml */
jarg = json_object_get(cmd, "filename");
Expand Down Expand Up @@ -1011,7 +1003,7 @@ TmEcode UnixSocketReloadTenant(json_t *cmd, json_t* answer, void *data)
json_object_set_new(answer, "message", json_string("id is not an integer"));
return TM_ECODE_FAILED;
}
int tenant_id = json_integer_value(jarg);
uint32_t tenant_id = json_integer_value(jarg);

/* 2 get tenant yaml */
jarg = json_object_get(cmd, "filename");
Expand Down Expand Up @@ -1081,7 +1073,7 @@ TmEcode UnixSocketUnregisterTenant(json_t *cmd, json_t* answer, void *data)
json_object_set_new(answer, "message", json_string("id is not an integer"));
return TM_ECODE_FAILED;
}
int tenant_id = json_integer_value(jarg);
uint32_t tenant_id = json_integer_value(jarg);

SCLogInfo("remove-tenant: removing tenant %d", tenant_id);

Expand Down
Loading