From e1c846907c2e5de49590d66761a841004c5f0cac Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sat, 26 Dec 2020 15:57:31 +0000 Subject: [PATCH] linux: ARM64 stock kernel does not emit hardware in cpuinfo They have no plans to add it either, so just hardcode AArch64. --- src/if-linux.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/if-linux.c b/src/if-linux.c index 69f75e12..da143e7f 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -167,10 +167,19 @@ static int if_addressexists(struct interface *, struct in_addr *); #define SYS_LAYER2 "/sys/class/net/%s/device/layer2" #define SYS_TUNTAP "/sys/class/net/%s/tun_flags" +#if defined(__aarch64__) +static const char *mproc = "AArch64"; +int +if_machinearch(char *str, size_t len) +{ + + return snprintf(str, len, "%s", mproc); +} +#else static const char *mproc = #if defined(__alpha__) "system type" -#elif defined(__arm__) || defined(__aarch64__) +#elif defined(__arm__) "Hardware" #elif defined(__avr32__) "cpu family" @@ -232,6 +241,7 @@ if_machinearch(char *str, size_t len) errno = ESRCH; return -1; } +#endif static int check_proc_int(struct dhcpcd_ctx *ctx, const char *path) -- 2.47.2