summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-12-26 15:57:31 +0000
committerRoy Marples <roy@marples.name>2020-12-26 15:57:31 +0000
commite1c846907c2e5de49590d66761a841004c5f0cac (patch)
tree509a818e4b56127d6bf74cc51cea810594f65c2a
parent08140d736cfce19710823c56d57a1d7499385ab9 (diff)
downloaddhcpcd-e1c846907c2e5de49590d66761a841004c5f0cac.tar.xz
linux: ARM64 stock kernel does not emit hardware in cpuinfo
They have no plans to add it either, so just hardcode AArch64.
-rw-r--r--src/if-linux.c12
1 files changed, 11 insertions, 1 deletions
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)