pull main (#320)

* fix IPv6 masking

* Prometheus support (#316)

* Add prometheus support

* Add prometheus support

* Add prometheus support

* Add prometheus support

* Add prometheus support

---------

Co-authored-by: avigailo <avigailo@checkpoint.com>

* Fix Watchdog restarts  (#319)

* don't exit

* fix restarting agent

* fix watchdog restarts

* Waf tag (#317)

* add waf-tag to openappsec

* fix waf tag to openappsec

---------

Co-authored-by: wiaamm <wiaamm@checkpoint.com>

---------

Co-authored-by: Wills Ward <wward@warddevelopment.com>
Co-authored-by: orianelou <126462046+orianelou@users.noreply.github.com>
Co-authored-by: avigailo <avigailo@checkpoint.com>
Co-authored-by: wiaam96 <142393189+wiaam96@users.noreply.github.com>
Co-authored-by: wiaamm <wiaamm@checkpoint.com>
This commit is contained in:
Daniel-Eisenberg
2025-06-11 15:18:17 +03:00
committed by GitHub
parent 6847c1faba
commit b02eb3d2e1
21 changed files with 771 additions and 19 deletions

View File

@@ -41,6 +41,7 @@ static in6_addr applyMaskV6(const in6_addr& addr, uint8_t prefixLength) {
in6_addr maskedAddr = addr;
int fullBytes = prefixLength / 8;
int remainingBits = prefixLength % 8;
uint8_t partialByte = maskedAddr.s6_addr[fullBytes];
// Mask full bytes
for (int i = fullBytes; i < 16; ++i) {
@@ -50,7 +51,7 @@ static in6_addr applyMaskV6(const in6_addr& addr, uint8_t prefixLength) {
// Mask remaining bits
if (remainingBits > 0) {
uint8_t mask = ~((1 << (8 - remainingBits)) - 1);
maskedAddr.s6_addr[fullBytes] &= mask;
maskedAddr.s6_addr[fullBytes] = partialByte & mask;
}
return maskedAddr;