mirror of
https://github.com/AlchemillaHQ/Sylve.git
synced 2026-06-14 00:46:34 +03:00
fix: pkg/network/iface: correct ioctl call for caps
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user