Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-13 22:03:09 +00:00

AI fixes, update builder-linux

This commit is contained in:
bol-van
2026-02-18 12:15:19 +03:00
parent e30f99e106
commit f70fb89754
5 changed files with 12 additions and 13 deletions

View File

@@ -6,7 +6,7 @@ make -C /opt/zapret2 systemd
linux static :
need any x86_64 classic linux distribution
dependencies: apt install curl xz-utils bzip2 unzip make gcc libcap-dev pkg-config
dependencies: apt install curl xz-utils bzip2 unzip make gcc gcc-multilib libc6-dev libcap-dev pkg-config
copy directory "builder-linux" somethere with enough free disk space (up to 2G for all toolchains)
run "get_toolchains.sh"
select architectures you need or "ALL"

View File

@@ -46,7 +46,7 @@ target_has_luajit()
return 1
}
REQD_H_FILES="/usr/include/x86_64-linux-gnu/sys/queue.h /usr/include/sys/capability.h"
REQD_H_FILES="/usr/include/x86_64-linux-gnu/sys/queue.h /usr/include/sys/capability.h /usr/include/bits/libc-header-start.h"
check_h_files()
{
check_file $REQD_H_FILES
@@ -206,7 +206,7 @@ check_prog()
while [ -n "$1" ]; do
exists $1 || {
echo $1 is not available
echo "debian/ubuntu: apt install curl xz-utils bzip2 unzip make gcc libcap-dev pkg-config"
echo "debian/ubuntu: apt install curl xz-utils bzip2 unzip make gcc gcc-multilib libc6-dev libcap-dev pkg-config"
exit 10
}
shift

View File

@@ -2093,6 +2093,7 @@ static uint16_t wlan_get_family_id(struct mnl_socket* nl)
static int wlan_info_attr_cb(const struct nlattr *attr, void *data)
{
struct wlan_interface *wlan = (struct wlan_interface *)data;
size_t len;
switch(mnl_attr_get_type(attr))
{
case NL80211_ATTR_IFINDEX:
@@ -2104,12 +2105,10 @@ static int wlan_info_attr_cb(const struct nlattr *attr, void *data)
wlan->ifindex = mnl_attr_get_u32(attr);
break;
case NL80211_ATTR_SSID:
if (mnl_attr_validate(attr, MNL_TYPE_STRING) < 0)
{
DLOG_PERROR("mnl_attr_validate(ssid)");
return MNL_CB_ERROR;
}
snprintf(wlan->ssid,sizeof(wlan->ssid),"%s",mnl_attr_get_str(attr));
len = mnl_attr_get_payload_len(attr);
if (len>=sizeof(wlan->ssid)) len=sizeof(wlan->ssid)-1;
memcpy(wlan->ssid, mnl_attr_get_payload(attr), len);
wlan->ssid[len]=0;
break;
case NL80211_ATTR_IFNAME:
if (mnl_attr_validate(attr, MNL_TYPE_STRING) < 0)

View File

@@ -1648,6 +1648,7 @@ static const uint8_t *dns_extract_name(const uint8_t *a, const uint8_t *b, const
size_t nl, off;
const uint8_t *p;
bool bptr = (*a & 0xC0)==0xC0;
uint8_t x,y;
if (bptr)
{
@@ -1666,9 +1667,8 @@ static const uint8_t *dns_extract_name(const uint8_t *a, const uint8_t *b, const
// do not support mixed ptr+real
if ((*p & 0xC0) || (p+*p+1)>=e || (*p+1)>=(name_size-nl)) return NULL;
if (nl) name[nl++] = '.';
memcpy(name + nl, p + 1, *p);
nl += *p;
p += *p + 1;
for(y=*p++,x=0 ; x<y ; x++,p++) name[nl+x] = tolower(*p);
nl += y;
}
name[nl] = 0;
return bptr ? a+2 : p+1;

View File

@@ -248,7 +248,7 @@ void ResolveMultiPos(const uint8_t *data, size_t sz, t_l7payload l7payload, cons
}
static const char *http_methods[] = { "GET ","POST ","HEAD ","OPTIONS ","PUT ","DELETE ","CONNECT ","TRACE ",NULL };
static const char *http_methods[] = { "GET ","POST ","HEAD ","OPTIONS ","PUT ","DELETE ","CONNECT ","TRACE ", "PATCH ", NULL };
static const char *HttpMethod(const uint8_t *data, size_t len)
{
const char **method;