network: don't fail on various config parse errors
We typically don't fail on config parse errors (to maximize compat), let's not do this in these cases either.
This commit is contained in:
parent
40eb1b0ae8
commit
e5f1b999eb
|
@ -851,10 +851,12 @@ int config_parse_macsec_key_id(
|
||||||
log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse KeyId \"%s\": %m", rvalue);
|
log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse KeyId \"%s\": %m", rvalue);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (l > MACSEC_KEYID_LEN)
|
if (l > MACSEC_KEYID_LEN) {
|
||||||
return log_syntax(unit, LOG_WARNING, filename, line, 0,
|
log_syntax(unit, LOG_WARNING, filename, line, 0,
|
||||||
"Specified KeyId is larger then the allowed maximum (%zu > %u), ignoring: %s",
|
"Specified KeyId is larger then the allowed maximum (%zu > %u), ignoring: %s",
|
||||||
l, MACSEC_KEYID_LEN, rvalue);
|
l, MACSEC_KEYID_LEN, rvalue);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
dest = a ? a->sa.key_id : b->sa.key_id;
|
dest = a ? a->sa.key_id : b->sa.key_id;
|
||||||
memcpy_safe(dest, p, l);
|
memcpy_safe(dest, p, l);
|
||||||
|
|
|
@ -492,13 +492,17 @@ static int wireguard_decode_key_and_warn(
|
||||||
(void) warn_file_is_world_accessible(filename, NULL, unit, line);
|
(void) warn_file_is_world_accessible(filename, NULL, unit, line);
|
||||||
|
|
||||||
r = unbase64mem_full(rvalue, strlen(rvalue), true, &key, &len);
|
r = unbase64mem_full(rvalue, strlen(rvalue), true, &key, &len);
|
||||||
if (r < 0)
|
if (r < 0) {
|
||||||
return log_syntax(unit, LOG_WARNING, filename, line, r,
|
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||||
"Failed to decode wireguard key provided by %s=, ignoring assignment: %m", lvalue);
|
"Failed to decode wireguard key provided by %s=, ignoring assignment: %m", lvalue);
|
||||||
if (len != WG_KEY_LEN)
|
return 0;
|
||||||
return log_syntax(unit, LOG_WARNING, filename, line, SYNTHETIC_ERRNO(EINVAL),
|
}
|
||||||
|
if (len != WG_KEY_LEN) {
|
||||||
|
log_syntax(unit, LOG_WARNING, filename, line, 0,
|
||||||
"Wireguard key provided by %s= has invalid length (%zu bytes), ignoring assignment.",
|
"Wireguard key provided by %s= has invalid length (%zu bytes), ignoring assignment.",
|
||||||
lvalue, len);
|
lvalue, len);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(ret, key, WG_KEY_LEN);
|
memcpy(ret, key, WG_KEY_LEN);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -292,10 +292,12 @@ int config_parse_fdb_destination(
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
r = in_addr_from_string_auto(rvalue, &fdb_entry->family, &fdb_entry->destination_addr);
|
r = in_addr_from_string_auto(rvalue, &fdb_entry->family, &fdb_entry->destination_addr);
|
||||||
if (r < 0)
|
if (r < 0) {
|
||||||
return log_syntax(unit, LOG_WARNING, filename, line, r,
|
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||||
"FDB destination IP address is invalid, ignoring assignment: %s",
|
"FDB destination IP address is invalid, ignoring assignment: %s",
|
||||||
rvalue);
|
rvalue);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
fdb_entry = NULL;
|
fdb_entry = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue