network: re-indent conf parser and wrap long lines in bond.c

This commit is contained in:
Yu Watanabe 2019-04-12 14:15:29 +09:00
parent 674c96fc44
commit 3e8afae5b5

View file

@ -358,16 +358,17 @@ int config_parse_arp_ip_target_address(
} }
} }
int config_parse_ad_actor_sys_prio(const char *unit, int config_parse_ad_actor_sys_prio(
const char *filename, const char *unit,
unsigned line, const char *filename,
const char *section, unsigned line,
unsigned section_line, const char *section,
const char *lvalue, unsigned section_line,
int ltype, const char *lvalue,
const char *rvalue, int ltype,
void *data, const char *rvalue,
void *userdata) { void *data,
void *userdata) {
Bond *b = userdata; Bond *b = userdata;
uint16_t v; uint16_t v;
int r; int r;
@ -379,12 +380,15 @@ int config_parse_ad_actor_sys_prio(const char *unit,
r = safe_atou16(rvalue, &v); r = safe_atou16(rvalue, &v);
if (r < 0) { if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse actor system priority '%s', ignoring: %m", rvalue); log_syntax(unit, LOG_ERR, filename, line, r,
"Failed to parse actor system priority '%s', ignoring: %m", rvalue);
return 0; return 0;
} }
if (v == 0) { if (v == 0) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse actor system priority '%s'. Range is [1,65535], ignoring.", rvalue); log_syntax(unit, LOG_ERR, filename, line, 0,
"Failed to parse actor system priority '%s'. Range is [1,65535], ignoring.",
rvalue);
return 0; return 0;
} }
@ -393,16 +397,17 @@ int config_parse_ad_actor_sys_prio(const char *unit,
return 0; return 0;
} }
int config_parse_ad_user_port_key(const char *unit, int config_parse_ad_user_port_key(
const char *filename, const char *unit,
unsigned line, const char *filename,
const char *section, unsigned line,
unsigned section_line, const char *section,
const char *lvalue, unsigned section_line,
int ltype, const char *lvalue,
const char *rvalue, int ltype,
void *data, const char *rvalue,
void *userdata) { void *data,
void *userdata) {
Bond *b = userdata; Bond *b = userdata;
uint16_t v; uint16_t v;
int r; int r;
@ -414,12 +419,14 @@ int config_parse_ad_user_port_key(const char *unit,
r = safe_atou16(rvalue, &v); r = safe_atou16(rvalue, &v);
if (r < 0) { if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse user port key '%s', ignoring: %m", rvalue); log_syntax(unit, LOG_ERR, filename, line, r,
"Failed to parse user port key '%s', ignoring: %m", rvalue);
return 0; return 0;
} }
if (v > 1023) { if (v > 1023) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse user port key '%s'. Range is [0,1023], ignoring.", rvalue); log_syntax(unit, LOG_ERR, filename, line, 0,
"Failed to parse user port key '%s'. Range is [0…1023], ignoring.", rvalue);
return 0; return 0;
} }