This change makes lwip set the system hostname to the one it receives
during initialization, using the `sethostname` library call.
Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #49
#include <uk/config.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#include <uk/alloc.h>
#include <uk/print.h>
return NULL;
}
- if (hostname)
+ if (hostname) {
netif_set_hostname(nf, hostname);
+#if CONFIG_LIBPOSIX_SYSINFO
+ sethostname(hostname, strlen(hostname));
+#endif /* CONFIG_LIBPOSIX_SYSINFO */
+ }
return ret;
}