Wifi plugin will be able to set it through a simple function. This will be useful to match the dhcp server lease with the distant peer. --- include/peer.h | 2 ++ src/peer.c | 9 +++++++++ 2 files changed, 11 insertions(+)
diff --git a/include/peer.h b/include/peer.h index 8a690f5..8066393 100644 --- a/include/peer.h +++ b/include/peer.h @@ -64,6 +64,8 @@ void connman_peer_unref_debug(struct connman_peer *peer, const char *connman_peer_get_identifier(struct connman_peer *peer); void connman_peer_set_name(struct connman_peer *peer, const char *name); +void connman_peer_set_iface_address(struct connman_peer *peer, + const unsigned char *iface_address); void connman_peer_set_device(struct connman_peer *peer, struct connman_device *device); struct connman_device *connman_peer_get_device(struct connman_peer *peer); diff --git a/src/peer.c b/src/peer.c index caff70c..81fc1d2 100644 --- a/src/peer.c +++ b/src/peer.c @@ -27,6 +27,7 @@ #include <ctype.h> #include <gdbus.h> #include <gdhcp/gdhcp.h> +#include <netinet/if_ether.h> #include <connman/agent.h> @@ -54,6 +55,7 @@ struct connman_peer { int refcount; struct connman_device *device; struct connman_device *sub_device; + unsigned char *iface_address[ETH_ALEN]; char *identifier; char *name; char *path; @@ -725,6 +727,13 @@ void connman_peer_set_name(struct connman_peer *peer, const char *name) peer->name = g_strdup(name); } +void connman_peer_set_iface_address(struct connman_peer *peer, + const unsigned char *iface_address) +{ + memset(peer->iface_address, 0, ETH_ALEN); + memcpy(peer->iface_address, iface_address, ETH_ALEN); +} + void connman_peer_set_device(struct connman_peer *peer, struct connman_device *device) { -- 2.0.4 _______________________________________________ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman