mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:12:48 +01:00
ap: Drop unneeded broadcast address calculation
It's already done in l_rtnl_address_new().
This commit is contained in:
parent
45c7aa0d18
commit
e9a33524a2
19
src/ap.c
19
src/ap.c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user