mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-04 00:00:14 -04:00
kernel-pfroute: Make sure there is a netmask when enumerating subnets
This commit is contained in:
parent
ef6b710f19
commit
fd0a7b4795
@ -1831,7 +1831,7 @@ METHOD(enumerator_t, enumerate_subnets, bool,
|
||||
for (; this->current < this->buf + this->len;
|
||||
this->current += rtm->rtm_msglen)
|
||||
{
|
||||
struct sockaddr *netmask;
|
||||
struct sockaddr *netmask = NULL;
|
||||
uint8_t netbits = 0;
|
||||
|
||||
rtm = (struct rt_msghdr*)this->current;
|
||||
@ -1864,7 +1864,7 @@ METHOD(enumerator_t, enumerate_subnets, bool,
|
||||
this->ifname = strndup(sdl->sdl_data, sdl->sdl_nlen);
|
||||
}
|
||||
}
|
||||
if (this->net)
|
||||
if (this->net && netmask)
|
||||
{
|
||||
netbits = sockaddr_to_netmask(netmask, this->net);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user