commit
This commit is contained in:
1 parent
824fffb2cf
commit
b02be8d620
2 files changed
+54
-5
No files matched your search
+1
-5
@@ -165,11 +165,6 @@ static __always_inline int is_filtered_port(__u16 port) {
|
||||
return (port <= 1024);
|
||||
}
|
||||
|
||||
// Função otimizada para verificar se é porta WireGuard
|
||||
static __always_inline int is_wireguard_traffic(__u8 protocol, __u16 port) {
|
||||
return (protocol == IPPROTO_UDP && port == 32100);
|
||||
}
|
||||
|
||||
// Função para atualizar estatísticas de tráfego
|
||||
static __always_inline void update_stats(__u32 action, __u8 flags) {
|
||||
__u32 key = 0;
|
||||
@@ -229,6 +224,7 @@ int xdp_ddos_filter(struct xdp_md *ctx) {
|
||||
struct udphdr *udp = (void *)(ip + 1);
|
||||
if ((void *)(udp + 1) <= data_end) {
|
||||
__u16 dest_port = __constant_ntohs(udp->dest);
|
||||
|
||||
if (dest_port == 32100) { // WireGuard port
|
||||
// Permitir todo tráfego WireGuard sem verificação adicional
|
||||
update_stats(XDP_PASS, 0);
|
||||
|
||||
Reference in new issue
Block a user