mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-08-30 05:50:12 +03:00
network: do not reallocate buffer
This commit is contained in:
@ -1340,17 +1340,21 @@ int routing_policy_load_rules(const char *state_file, Set **rules) {
|
|||||||
return r;
|
return r;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
_cleanup_free_ char *word = NULL, *a = NULL, *b = NULL;
|
_cleanup_free_ char *a = NULL;
|
||||||
|
char *b;
|
||||||
|
|
||||||
r = extract_first_word(&p, &word, NULL, 0);
|
r = extract_first_word(&p, &a, NULL, 0);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
if (r == 0)
|
if (r == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
r = split_pair(word, "=", &a, &b);
|
b = strchr(a, '=');
|
||||||
if (r < 0)
|
if (!b) {
|
||||||
|
log_warning_errno(r, "Failed to parse RPDB rule, ignoring: %s", a);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
*b++ = '\0';
|
||||||
|
|
||||||
if (STR_IN_SET(a, "from", "to")) {
|
if (STR_IN_SET(a, "from", "to")) {
|
||||||
union in_addr_union *buffer;
|
union in_addr_union *buffer;
|
||||||
|
Reference in New Issue
Block a user