2 * Support routine for configuring link layer address
9 int set_lladdr(const char *ifname
, const char *lladdr
,
10 const struct env_set
*es
)
12 struct argv argv
= argv_new ();
15 if (!ifname
|| !lladdr
)
18 #if defined(TARGET_LINUX)
19 #ifdef CONFIG_FEATURE_IPROUTE
21 "%s link set addr %s dev %s",
22 iproute_path
, lladdr
, ifname
);
29 #elif defined(TARGET_SOLARIS)
34 #elif defined(TARGET_OPENBSD)
39 #elif defined(TARGET_DARWIN)
44 #elif defined(TARGET_FREEBSD)
50 msg (M_WARN
, "Sorry, but I don't know how to configure link layer addresses on this operating system.");
54 argv_msg (M_INFO
, &argv
);
55 r
= openvpn_execve_check (&argv
, es
, M_WARN
, "ERROR: Unable to set link layer address.");
57 msg (M_INFO
, "TUN/TAP link layer address set to %s", lladdr
);