aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@basename.se>2019-05-02 18:17:43 +0200
committerAnton Lindqvist <anton@basename.se>2019-05-02 19:21:37 +0200
commite9039493d754416e9ed6cae41d967261cf0b342d (patch)
tree84ccd3c23d5b286c94b55b39ec5b57726ec13044
parent1852eb1814586da4d527df5b75a2850eff3f7144 (diff)
executor: unbreak on OpenBSD at runtime
Not using `elif GOOS_freebsd' since it could cause breakage on other *BSDs due to unused variables. Regression introduced in commit c7c3f772 (executor: improve setup for packet handling on *BSD).
-rw-r--r--executor/common_bsd.h4
-rw-r--r--pkg/csource/generated.go4
2 files changed, 8 insertions, 0 deletions
diff --git a/executor/common_bsd.h b/executor/common_bsd.h
index 2a9f677c7..d39d2aded 100644
--- a/executor/common_bsd.h
+++ b/executor/common_bsd.h
@@ -153,7 +153,11 @@ static void initialize_tun(int tun_id)
char local_mac[sizeof(LOCAL_MAC)];
snprintf_check(local_mac, sizeof(local_mac), LOCAL_MAC);
+#if GOOS_openbsd
+ execute_command(1, "ifconfig %s lladdr %s", tun_iface, local_mac);
+#else
execute_command(1, "ifconfig %s ether %s", tun_iface, local_mac);
+#endif
char local_ipv4[sizeof(LOCAL_IPV4)];
snprintf_check(local_ipv4, sizeof(local_ipv4), LOCAL_IPV4, tun_id);
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index 2a9c22002..7f1424f36 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -533,7 +533,11 @@ static void initialize_tun(int tun_id)
char local_mac[sizeof(LOCAL_MAC)];
snprintf_check(local_mac, sizeof(local_mac), LOCAL_MAC);
+#if GOOS_openbsd
+ execute_command(1, "ifconfig %s lladdr %s", tun_iface, local_mac);
+#else
execute_command(1, "ifconfig %s ether %s", tun_iface, local_mac);
+#endif
char local_ipv4[sizeof(LOCAL_IPV4)];
snprintf_check(local_ipv4, sizeof(local_ipv4), LOCAL_IPV4, tun_id);