All the places that call ubus_bcast_dhcp_event() have already checked that the
hardware adress is a MAC address, and it's not like we support anything else,
so remove the length argument.
The function is actually DHCPv4 specific, but that's a topic for another time.
Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/270
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
if (reqmsg == DHCPV4_MSG_RELEASE) {
struct in_addr ciaddr = req->ciaddr; // ensure pointer alignment
- ubus_bcast_dhcp_event("dhcp.release", req->chaddr, req->hlen,
+ ubus_bcast_dhcp_event("dhcp.release", req->chaddr,
&ciaddr, a ? a->hostname : NULL, iface->ifname);
}
if (msg == DHCPV4_MSG_ACK) {
struct in_addr yiaddr = reply.yiaddr; // ensure pointer alignment
- ubus_bcast_dhcp_event("dhcp.ack", req->chaddr, req->hlen, &yiaddr,
+ ubus_bcast_dhcp_event("dhcp.ack", req->chaddr, &yiaddr,
a ? a->hostname : NULL, iface->ifname);
}
}
void ubus_apply_network(void);
bool ubus_has_prefix(const char *name, const char *ifname);
void ubus_bcast_dhcp_event(const char *type, const uint8_t *mac,
- const size_t mac_len, const struct in_addr *addr,
- const char *name, const char *interface);
+ const struct in_addr *addr, const char *name,
+ const char *interface);
#else
static inline int ubus_init(void)
{
static inline
void ubus_bcast_dhcp_event(const char *type, const uint8_t *mac,
- const size_t mac_len, const struct in_addr *addr,
- const char *name, const char *interface)
+ const struct in_addr *addr, const char *name,
+ const char *interface)
{
return;
}
};
void ubus_bcast_dhcp_event(const char *type, const uint8_t *mac,
- const size_t mlen, const struct in_addr *addr, const char *name,
- const char *interface)
+ const struct in_addr *addr, const char *name,
+ const char *interface)
{
if (!ubus || !main_object.has_subscribers)
return;
blob_buf_init(&b, 0);
if (mac)
- blobmsg_add_string(&b, "mac", odhcpd_print_mac(mac, mlen));
+ blobmsg_add_string(&b, "mac", odhcpd_print_mac(mac, ETH_ALEN));
if (addr)
blobmsg_add_string(&b, "ip", inet_ntoa(*addr));
if (name)