forecast: Fix undefined shift if traffic selector is /0
Not an issue in typical scenarios where the plugin is used on a gateway
with roadwarriors that use /32 addresses. But could be an issue if used
on a client that tunnels everything to the gateway.
Fixes: e5ad2e6614 ("forecast: Add the broadcast/multicast forwarding plugin called forecast")
This commit is contained in:
@@ -122,7 +122,7 @@ static bool ts2in(traffic_selector_t *ts,
|
|||||||
{
|
{
|
||||||
memcpy(&addr->s_addr, net->get_address(net).ptr, 4);
|
memcpy(&addr->s_addr, net->get_address(net).ptr, 4);
|
||||||
net->destroy(net);
|
net->destroy(net);
|
||||||
mask->s_addr = htonl(0xffffffffU << (32 - bits));
|
mask->s_addr = bits ? htonl(0xffffffffU << (32 - bits)) : 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user