network: tunnel: reduce indentation in config_parse_encap_limit()
This commit is contained in:
@@ -79,7 +79,7 @@ Tunnel.DiscoverPathMTU, config_parse_bool,
|
||||
Tunnel.Mode, config_parse_ip6tnl_mode, 0, offsetof(Tunnel, ip6tnl_mode)
|
||||
Tunnel.IPv6FlowLabel, config_parse_ipv6_flowlabel, 0, 0
|
||||
Tunnel.CopyDSCP, config_parse_bool, 0, offsetof(Tunnel, copy_dscp)
|
||||
Tunnel.EncapsulationLimit, config_parse_encap_limit, 0, offsetof(Tunnel, encap_limit)
|
||||
Tunnel.EncapsulationLimit, config_parse_encap_limit, 0, 0
|
||||
Tunnel.Independent, config_parse_bool, 0, offsetof(Tunnel, independent)
|
||||
Tunnel.AssignToLoopback, config_parse_bool, 0, offsetof(Tunnel, assign_to_loopback)
|
||||
Tunnel.AllowLocalRemote, config_parse_tristate, 0, offsetof(Tunnel, allow_localremote)
|
||||
|
||||
+20
-18
@@ -885,31 +885,33 @@ int config_parse_encap_limit(
|
||||
void *data,
|
||||
void *userdata) {
|
||||
|
||||
Tunnel *t = userdata;
|
||||
int k = 0;
|
||||
int r;
|
||||
Tunnel *t = ASSERT_PTR(userdata);
|
||||
int k, r;
|
||||
|
||||
assert(filename);
|
||||
assert(lvalue);
|
||||
assert(rvalue);
|
||||
|
||||
if (streq(rvalue, "none"))
|
||||
if (streq(rvalue, "none")) {
|
||||
t->flags |= IP6_TNL_F_IGN_ENCAP_LIMIT;
|
||||
else {
|
||||
r = safe_atoi(rvalue, &k);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse Tunnel Encapsulation Limit option, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (k > 255 || k < 0)
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0, "Invalid Tunnel Encapsulation value, ignoring: %d", k);
|
||||
else {
|
||||
t->encap_limit = k;
|
||||
t->flags &= ~IP6_TNL_F_IGN_ENCAP_LIMIT;
|
||||
}
|
||||
t->encap_limit = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = safe_atoi(rvalue, &k);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to parse Tunnel Encapsulation Limit option, ignoring assignment: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (k > 255 || k < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0,
|
||||
"Invalid Tunnel Encapsulation value, ignoring assignment: %d", k);
|
||||
return 0;
|
||||
}
|
||||
|
||||
t->encap_limit = k;
|
||||
t->flags &= ~IP6_TNL_F_IGN_ENCAP_LIMIT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user