fix: pkg/network/iface: correct ioctl call for caps

This commit is contained in:
hayzamjs
2025-05-06 22:10:59 +04:00
parent fb3469e008
commit e2c3350215
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -113,12 +113,16 @@ static uint32_t get_flagshigh(const struct ifreq *req) {
return *pun.u32;
}
#ifndef SIOCGIFCAP
#define SIOCGIFCAP 1
#endif
static void get_capabilities(int fd, const char* name, uint32_t *enabled, uint32_t *supported) {
struct ifreq req;
memset(&req, 0, sizeof(req));
strncpy(req.ifr_name, name, IFNAMSIZ - 1);
if (ioctl(fd, SIOCGIFCAPNV, &req) < 0) {
if (ioctl(fd, SIOCGIFCAP, &req) < 0) {
*enabled = 0;
*supported = 0;
return;
+2 -2
View File
@@ -67,8 +67,8 @@ export const IfaceDetailSchema = z.object({
}),
driver: z.string().default(''),
description: z.string().default(''),
ipv4: z.array(IPv4Schema).default([]),
ipv6: z.array(IPv6Schema).default([]),
ipv4: z.array(IPv4Schema).default([]).nullable().optional(),
ipv6: z.array(IPv6Schema).default([]).nullable().optional(),
media: MediaSchema.nullable().optional(),
nd6: ND6Schema.nullable().optional()
});