summaryrefslogtreecommitdiffstats
path: root/discover/user-event.c
diff options
context:
space:
mode:
Diffstat (limited to 'discover/user-event.c')
-rw-r--r--discover/user-event.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/discover/user-event.c b/discover/user-event.c
index 20b2bea..fb3fddb 100644
--- a/discover/user-event.c
+++ b/discover/user-event.c
@@ -37,6 +37,7 @@
#include "resource.h"
#include "event.h"
#include "user-event.h"
+#include "sysinfo.h"
#define MAC_ADDR_SIZE 6
@@ -385,6 +386,16 @@ static int user_event_dhcp(struct user_event *uev, struct event *event)
struct device_handler *handler = uev->handler;
struct discover_device *dev;
+ uint8_t hwaddr[MAC_ADDR_SIZE];
+
+ sscanf(event_get_param(event, "mac"),
+ "%hhX:%hhX:%hhX:%hhX:%hhX:%hhX",
+ hwaddr, hwaddr + 1, hwaddr + 2,
+ hwaddr + 3, hwaddr + 4, hwaddr + 5);
+
+ system_info_set_interface_address(sizeof(hwaddr), hwaddr,
+ event_get_param(event, "ip"));
+
dev = discover_device_create(handler, event_get_param(event, "mac"),
event->device);
OpenPOWER on IntegriCloud