mirror of
https://github.com/strongswan/strongswan.git
synced 2025-12-06 00:00:10 -05:00
Fix 'stroke loglevel any'
Before b46a5cd4 this worked if debug_t was unsigned. In that case -1, as returned by enum_from_name(), would result in a large positive number. So any unknown debug group (including 'any') had the same effect that was only intended for 'any'.
This commit is contained in:
parent
5374fe3a09
commit
96a2d2077b
@ -516,11 +516,18 @@ static void stroke_loglevel(private_stroke_socket_t *this,
|
||||
DBG1(DBG_CFG, "received stroke: loglevel %d for %s",
|
||||
msg->loglevel.level, msg->loglevel.type);
|
||||
|
||||
group = enum_from_name(debug_names, msg->loglevel.type);
|
||||
if ((int)group < 0)
|
||||
if (strcaseeq(msg->loglevel.type, "any"))
|
||||
{
|
||||
fprintf(out, "invalid type (%s)!\n", msg->loglevel.type);
|
||||
return;
|
||||
group = DBG_ANY;
|
||||
}
|
||||
else
|
||||
{
|
||||
group = enum_from_name(debug_names, msg->loglevel.type);
|
||||
if ((int)group < 0)
|
||||
{
|
||||
fprintf(out, "invalid type (%s)!\n", msg->loglevel.type);
|
||||
return;
|
||||
}
|
||||
}
|
||||
charon->set_level(charon, group, msg->loglevel.level);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user