3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

ap: Drop unneeded broadcast address calculation

It's already done in l_rtnl_address_new().
This commit is contained in:
Andrew Zaborowski 2021-06-04 03:50:38 +02:00 committed by Denis Kenzior
parent 45c7aa0d18
commit e9a33524a2

View File

@ -131,18 +131,6 @@ static char **global_addr4_strs;
static uint32_t netdev_watch;
static struct l_netlink *rtnl;
static const char *broadcast_from_ip(const char *ip, uint8_t prefix_len)
{
struct in_addr ia;
uint32_t netmask = util_netmask_from_prefix(prefix_len);
if (inet_aton(ip, &ia) != 1)
return NULL;
ia.s_addr |= htonl(~netmask);
return inet_ntoa(ia);
}
static void ap_stop_handshake(struct sta_state *sta)
{
if (sta->sm) {
@ -2444,13 +2432,6 @@ static int ap_setup_netconfig4(struct ap_state *ap, const char **addr_str_list,
}
new_addr = l_rtnl_address_new(addr_str_buf, prefix_len);
if (!l_rtnl_address_set_broadcast(new_addr,
broadcast_from_ip(addr_str_buf, prefix_len))) {
ret = -EIO;
goto cleanup;
}
ret = 0;
} else {
if (!prefix_len)