mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-13 09:18:55 +07:00
refactor: remove redundant assignments (#634)
This commit is contained in:
@ -302,14 +302,14 @@ enum __attribute__((packed)) MatchType {
|
|||||||
|
|
||||||
enum L4ProtoType {
|
enum L4ProtoType {
|
||||||
L4ProtoType_TCP = 1,
|
L4ProtoType_TCP = 1,
|
||||||
L4ProtoType_UDP = 2,
|
L4ProtoType_UDP,
|
||||||
L4ProtoType_X = 3,
|
L4ProtoType_X,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum IpVersionType {
|
enum IpVersionType {
|
||||||
IpVersionType_4 = 1,
|
IpVersionType_4 = 1,
|
||||||
IpVersionType_6 = 2,
|
IpVersionType_6,
|
||||||
IpVersionType_X = 3,
|
IpVersionType_X,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct port_range {
|
struct port_range {
|
||||||
@ -1285,15 +1285,15 @@ refresh_udp_conn_state_timer(struct tuples_key *key, bool is_egress)
|
|||||||
if (unlikely(!value))
|
if (unlikely(!value))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((ret = bpf_timer_init(&value->timer, &udp_conn_state_map,
|
if ((bpf_timer_init(&value->timer, &udp_conn_state_map,
|
||||||
CLOCK_MONOTONIC)))
|
CLOCK_MONOTONIC)))
|
||||||
goto retn;
|
goto retn;
|
||||||
|
|
||||||
if ((ret = bpf_timer_set_callback(&value->timer,
|
if ((bpf_timer_set_callback(&value->timer,
|
||||||
refresh_udp_conn_state_timer_cb)))
|
refresh_udp_conn_state_timer_cb)))
|
||||||
goto retn;
|
goto retn;
|
||||||
|
|
||||||
if ((ret = bpf_timer_start(&value->timer, TIMEOUT_UDP_CONN_STATE, 0)))
|
if ((bpf_timer_start(&value->timer, TIMEOUT_UDP_CONN_STATE, 0)))
|
||||||
goto retn;
|
goto retn;
|
||||||
|
|
||||||
retn:
|
retn:
|
||||||
@ -1710,7 +1710,7 @@ static __always_inline int _update_map_elem_by_cookie(const __u64 cookie)
|
|||||||
// __builtin_memset(&buf, 0, MAX_ARG_SCANNER_BUFFER_SIZE);
|
// __builtin_memset(&buf, 0, MAX_ARG_SCANNER_BUFFER_SIZE);
|
||||||
unsigned long to_read = arg_end - (arg_start + j);
|
unsigned long to_read = arg_end - (arg_start + j);
|
||||||
|
|
||||||
if (to_read >= MAX_ARG_SCANNER_BUFFER_SIZE)
|
if (to_read > MAX_ARG_SCANNER_BUFFER_SIZE)
|
||||||
to_read = MAX_ARG_SCANNER_BUFFER_SIZE;
|
to_read = MAX_ARG_SCANNER_BUFFER_SIZE;
|
||||||
else
|
else
|
||||||
buf[to_read] = 0;
|
buf[to_read] = 0;
|
||||||
|
Reference in New Issue
Block a user