Drop extra newline from xtables_error() calls
Phil Sutter
reviewerPATCH 1/1 Drop extra newline from xtables_error() calls
Since basic_exit_err() appends a newline to the message itself, drop explicit ones.
While being at it, fix indentation and join texts split over multiple lines.
Signed-off-by Phil Sutter <[email protected]>
--- extensions/dscp_helper.c | 4 +-- extensions/libebt_among.c | 4 +-- extensions/libip6t_icmp6.c | 6 ++-- extensions/libip6t_mh.c | 2 +- extensions/libipt_CLUSTERIP.c | 10 +++--- extensions/libipt_icmp.c | 6 ++-- extensions/libxt_CONNSECMARK.c | 3 +- extensions/libxt_CT.c | 2 +- extensions/libxt_SECMARK.c | 2 +- extensions/libxt_bpf.c | 3 +- extensions/libxt_hashlimit.c | 8 ++--- extensions/libxt_limit.c | 4 +-- extensions/libxt_sctp.c | 9 +++-- extensions/libxt_set.c | 59 +++++++++++++-------------------- iptables/ip6tables.c | 4 +-- iptables/iptables-restore.c | 38 ++++++++++----------- iptables/iptables-save.c | 5 ++- iptables/iptables-xml.c | 16 ++++----- iptables/iptables.c | 4 +-- iptables/nft-cache.c | 3 +- iptables/nft.c | 2 +- iptables/xshared.c | 30 ++++++++--------- iptables/xtables-eb-translate.c | 2 +- iptables/xtables-eb.c | 2 +- iptables/xtables-restore.c | 26 +++++++-------- libxtables/xtoptions.c | 4 +-- 26 files changed, 121 insertions(+), 137 deletions(-)
extensions/dscp_helper.c +2 -2
@@ -58,7 +58,7 @@ class_to_dscp(const char *name) }xtables_error (PARAMETER_PROBLEM , -"Invalid DSCP value `%s'\n" , name); +"Invalid DSCP value `%s'" , name); }
@@ -73,7 +73,7 @@ dscp_to_name(unsigned int dscp)return ds_classes[i].name;xtables_error (PARAMETER_PROBLEM , - "Invalid DSCP value `%d'\n", dscp); + "Invalid DSCP value `%d'", dscp); }#endif
extensions/libebt_among.c +2 -2
@@ -68,12 +68,12 @@ parse_nft_among_pair(char *buf, struct nft_among_pair *pair, bool have_ip)if (!inet_pton (AF_INET , sep +1 , &pair->in))xtables_error (PARAMETER_PROBLEM , -"Invalid IP address '%s'\n" , sep +1 ); +"Invalid IP address '%s'" , sep +1 ); } ether =ether_aton (buf);if (!ether)xtables_error (PARAMETER_PROBLEM , -"Invalid MAC address '%s'\n" , buf); +"Invalid MAC address '%s'" , buf);memcpy (&pair->ether, ether,sizeof (*ether)); }
extensions/libip6t_icmp6.c +3 -3
@@ -108,13 +108,13 @@ parse_icmpv6(const char *icmpv6type, uint8_t *type, uint8_t code[])if (!xtables_strtoui (buffer,NULL , &number,0 ,UINT8_MAX ))xtables_error (PARAMETER_PROBLEM , -"Invalid ICMPv6 type `%s'\n" , buffer); +"Invalid ICMPv6 type `%s'" , buffer); *type = number;if (slash) {if (!xtables_strtoui (slash+1 ,NULL , &number,0 ,UINT8_MAX ))xtables_error (PARAMETER_PROBLEM , -"Invalid ICMPv6 code `%s'\n" , - slash+1 ); +"Invalid ICMPv6 code `%s'" , + slash +1 ); code[0 ] = code[1 ] = number; }else { code[0 ] =0 ;
extensions/libip6t_mh.c +1 -1
@@ -97,7 +97,7 @@ static unsigned int name_to_type(const char *name)if (!xtables_strtoui (name,NULL , &number,0 ,UINT8_MAX ))xtables_error (PARAMETER_PROBLEM , -"Invalid MH type `%s'\n" , name); +"Invalid MH type `%s'" , name);return number; } }
extensions/libipt_CLUSTERIP.c +6 -4
@@ -87,12 +87,13 @@ static void CLUSTERIP_parse(struct xt_option_call *cb)else if (strcmp (cb->arg,"sourceip-sourceport-destport" ) ==0 ) cipinfo->hash_mode =CLUSTERIP_HASHMODE_SIP_SPT_DPT ;else -xtables_error (PARAMETER_PROBLEM ,"Unknown hashmode \"%s\"\n" , - cb->arg); +xtables_error (PARAMETER_PROBLEM , +"Unknown hashmode \"%s\"" , cb->arg);break ;case O_CLUSTERMAC :if (!(cipinfo->clustermac[0 ] &0x01 )) -xtables_error (PARAMETER_PROBLEM ,"MAC has to be a multicast ethernet address\n" ); +xtables_error (PARAMETER_PROBLEM , +"MAC has to be a multicast ethernet address" );break ;case O_LOCAL_NODE : cipinfo->num_local_nodes =1 ;
@@ -107,7 +108,8 @@ static void CLUSTERIP_check(struct xt_fcheck_call *cb)if ((cb->xflags &F_FULL ) ==F_FULL )return ; -xtables_error (PARAMETER_PROBLEM ,"CLUSTERIP target: Invalid parameter combination\n" ); +xtables_error (PARAMETER_PROBLEM , +"CLUSTERIP target: Invalid parameter combination" ); }static const char *hashmode2str (enum clusterip_hashmode mode)
extensions/libipt_icmp.c +3 -3
@@ -128,13 +128,13 @@ parse_icmp(const char *icmptype, uint8_t *type, uint8_t code[])if (!xtables_strtoui (buffer,NULL , &number,0 ,UINT8_MAX ))xtables_error (PARAMETER_PROBLEM , -"Invalid ICMP type `%s'\n" , buffer); +"Invalid ICMP type `%s'" , buffer); *type = number;if (slash) {if (!xtables_strtoui (slash+1 ,NULL , &number,0 ,UINT8_MAX ))xtables_error (PARAMETER_PROBLEM , -"Invalid ICMP code `%s'\n" , - slash+1 ); +"Invalid ICMP code `%s'" , + slash +1 ); code[0 ] = code[1 ] = number; }else { code[0 ] =0 ;
extensions/libxt_CONNSECMARK.c +2 -1
@@ -66,7 +66,8 @@ static void print_connsecmark(const struct xt_connsecmark_target_info *info)break ;default : -xtables_error (OTHER_PROBLEM ,PFX "invalid mode %hhu\n" , info->mode); +xtables_error (OTHER_PROBLEM , +PFX "invalid mode %hhu" , info->mode); } }
extensions/libxt_CT.c +1 -1
@@ -117,7 +117,7 @@ static void ct_parse_zone_id(const char *opt, unsigned int opt_id,if (!xtables_strtoul (opt,NULL , &val,0 ,UINT16_MAX ))xtables_error (PARAMETER_PROBLEM , -"Cannot parse %s as a zone ID\n" , opt); +"Cannot parse %s as a zone ID" , opt); *zone_id = (uint16_t )val; }
extensions/libxt_SECMARK.c +1 -1
@@ -60,7 +60,7 @@ static void print_secmark(__u8 mode, const char *secctx)break ;default : -xtables_error (OTHER_PROBLEM ,PFX "invalid mode %hhu\n" , mode); +xtables_error (OTHER_PROBLEM ,PFX "invalid mode %hhu" , mode); } }
extensions/libxt_bpf.c +1 -2
@@ -83,8 +83,7 @@ static int bpf_obj_get_readonly(const char *filepath) attr.file_flags =0 ;return syscall (__NR_bpf,BPF_OBJ_GET , &attr,sizeof (attr));#else -xtables_error (OTHER_PROBLEM , -"No bpf header, kernel headers too old?\n" ); +xtables_error (OTHER_PROBLEM ,"No bpf header, kernel headers too old?" );return -EINVAL ;#endif }
extensions/libxt_hashlimit.c +4 -4
@@ -356,12 +356,12 @@ static bool parse_bytes(const char *rate, void *val, struct hashlimit_mt_udata * tmp = (uint64_t ) r * factor;if (tmp > max)xtables_error (PARAMETER_PROBLEM , -"Rate value too large \"%" PRIu64"\" (max %" PRIu64")\n" , - tmp, max); +"Rate value too large \"%" PRIu64"\" (max %" PRIu64")" , + tmp, max); tmp =bytes_to_cost (tmp);if (tmp ==0 ) -xtables_error (PARAMETER_PROBLEM ,"Rate too high \"%s\"\n" , rate); +xtables_error (PARAMETER_PROBLEM ,"Rate too high \"%s\"" , rate); ud->mult =XT_HASHLIMIT_BYTE_EXPIRE ;
@@ -407,7 +407,7 @@ int parse_rate(const char *rate, void *val, struct hashlimit_mt_udata *ud, int r* The rate maps to infinity. (1/day is the minimum they can * specify, so we are ok at that end). */ -xtables_error (PARAMETER_PROBLEM ,"Rate too fast \"%s\"\n" , rate); +xtables_error (PARAMETER_PROBLEM ,"Rate too fast \"%s\"" , rate);if (revision ==1 ) *((uint32_t *)val) = tmp;
extensions/libxt_limit.c +2 -2
@@ -77,7 +77,7 @@ int parse_rate(const char *rate, uint32_t *val)* The rate maps to infinity. (1/day is the minimum they can * specify, so we are ok at that end). */ -xtables_error (PARAMETER_PROBLEM ,"Rate too fast \"%s\"\n" , rate); +xtables_error (PARAMETER_PROBLEM ,"Rate too fast \"%s\"" , rate);return 1 ; }
@@ -93,7 +93,7 @@ static void limit_init(struct xt_entry_match *m)/* FIXME: handle overflow: if (r->avg*r->burst/r->burst != r->avg) xtables_error(PARAMETER_PROBLEM, -"Sorry: burst too large for that avg rate.\n"); +"Sorry: burst too large for that avg rate."); */ static void limit_parse (struct xt_option_call *cb)
extensions/libxt_sctp.c +4 -5
@@ -144,10 +144,8 @@ save_chunk_flag_info(struct xt_sctp_flag_info *flag_info, }if (*flag_count ==XT_NUM_SCTP_FLAGS ) { -xtables_error (PARAMETER_PROBLEM , -"Number of chunk types with flags exceeds currently allowed limit." -"Increasing this limit involves changing IPT_NUM_SCTP_FLAGS and" -"recompiling both the kernel space and user space modules\n" ); +xtables_error (PARAMETER_PROBLEM , +"Number of chunk types with flags exceeds currently allowed limit. Increasing this limit involves changing IPT_NUM_SCTP_FLAGS and recompiling both the kernel space and user space modules" ); } flag_info[*flag_count].chunktype = chunktype;
@@ -219,7 +217,8 @@ parse_sctp_chunk(struct xt_sctp_info *einfo, isupper(chunk_flags[j])); }else {xtables_error (PARAMETER_PROBLEM , -"Invalid flags for chunk type %d\n" , i); +"Invalid flags for chunk type %d" , + i); } } }
extensions/libxt_set.c +23 -36
165 lines not on this page · raw message
iptables/ip6tables.c +2 -2
@@ -800,8 +800,8 @@ int do_command6(int argc, char *argv[], char **table,#ifdef IP6T_F_GOTO if (cs.fw6.ipv6.flags &IP6T_F_GOTO )xtables_error (PARAMETER_PROBLEM , -"goto '%s' is not a chain\n" , - cs.jumpto); +"goto '%s' is not a chain" , + cs.jumpto);#endif xtables_find_target (cs.jumpto,XTF_LOAD_MUST_SUCCEED ); }else {
iptables/iptables-restore.c +18 -20
@@ -78,8 +78,9 @@ create_handle(const struct iptables_restore_cb *cb, const char *tablename) }if (!handle) -xtables_error (PARAMETER_PROBLEM ,"%s: unable to initialize " -"table '%s'\n" , xt_params->program_name, tablename); +xtables_error (PARAMETER_PROBLEM , +"%s: unable to initialize table '%s'" , + xt_params->program_name, tablename);return handle; }
@@ -209,8 +210,8 @@ ip46tables_restore_main(const struct iptables_restore_cb *cb,DEBUGP ("line %u, table '%s'\n" , line, table);if (!table)xtables_error (PARAMETER_PROBLEM , -"%s: line %u table name invalid\n" , - xt_params->program_name, line); +"%s: line %u table name invalid" , + xt_params->program_name, line);strncpy (curtable, table,XT_TABLE_MAXNAMELEN ); curtable[XT_TABLE_MAXNAMELEN ] ='\0' ;
@@ -249,8 +250,8 @@ ip46tables_restore_main(const struct iptables_restore_cb *cb,DEBUGP ("line %u, chain '%s'\n" , line, chain);if (!chain)xtables_error (PARAMETER_PROBLEM , -"%s: line %u chain name invalid\n" , - xt_params->program_name, line); +"%s: line %u chain name invalid" , + xt_params->program_name, line);if (strlen (chain) >=XT_EXTENSION_MAXNAMELEN ) xtables_error(PARAMETER_PROBLEM,
@@ -263,16 +264,14 @@ ip46tables_restore_main(const struct iptables_restore_cb *cb,DEBUGP ("Flushing existing user defined chain '%s'\n" , chain);if (!cb->ops->flush_entries (chain, handle))xtables_error (PARAMETER_PROBLEM , -"error flushing chain " -"'%s':%s\n" , chain, -strerror (errno)); +"error flushing chain '%s':%s" , + chain,strerror (errno)); }else {DEBUGP ("Creating new chain '%s'\n" , chain);if (!cb->ops->create_chain (chain, handle))xtables_error (PARAMETER_PROBLEM , -"error creating chain " -"'%s':%s\n" , chain, -strerror (errno)); +"error creating chain '%s':%s" , + chain,strerror (errno)); } }
@@ -280,8 +279,8 @@ ip46tables_restore_main(const struct iptables_restore_cb *cb,DEBUGP ("line %u, policy '%s'\n" , line, policy);if (!policy)xtables_error (PARAMETER_PROBLEM , -"%s: line %u policy invalid\n" , - xt_params->program_name, line); +"%s: line %u policy invalid" , + xt_params->program_name, line);if (strcmp (policy,"-" ) !=0 ) {struct xt_counters count = {};
@@ -292,8 +291,8 @@ ip46tables_restore_main(const struct iptables_restore_cb *cb,if (!ctrs || !parse_counters (ctrs, &count))xtables_error (PARAMETER_PROBLEM , -"invalid policy counters " -"for chain '%s'\n" , chain); +"invalid policy counters for chain '%s'" , + chain); } DEBUGP("Setting policy of chain %s to %s\n",
@@ -302,10 +301,9 @@ ip46tables_restore_main(const struct iptables_restore_cb *cb,if (!cb->ops->set_policy (chain, policy, &count, handle))xtables_error (OTHER_PROBLEM , -"Can't set policy `%s'" -" on `%s' line %u: %s\n" , - policy, chain, line, - cb->ops->strerror (errno)); +"Can't set policy `%s' on `%s' line %u: %s" , + policy, chain, line, + cb->ops->strerror (errno)); }xtables_announce_chain (chain);
iptables/iptables-save.c +2 -3
@@ -61,8 +61,7 @@ for_each_table(int (*func)(struct iptables_save_cb *cb, const char *tablename),while (fgets (tablename,sizeof (tablename), procfile)) {if (tablename[strlen (tablename) -1 ] !='\n' )xtables_error (OTHER_PROBLEM , -"Badly formed tablename `%s'\n" , - tablename); +"Badly formed tablename `%s'" , tablename); tablename[strlen (tablename) -1 ] ='\0' ; ret &=func (cb, tablename); }
@@ -85,7 +84,7 @@ static int do_output(struct iptables_save_cb *cb, const char *tablename) h = cb->ops->init (tablename); }if (!h) -xtables_error (OTHER_PROBLEM ,"Cannot initialize: %s\n" , +xtables_error (OTHER_PROBLEM ,"Cannot initialize: %s" , cb->ops->strerror (errno));time_t now =time (NULL );
iptables/iptables-xml.c +8 -8
@@ -210,8 +210,8 @@ saveChain(char *chain, char *policy, struct xt_counters *ctr) {if (nextChain >= maxChains)xtables_error (PARAMETER_PROBLEM , -"%s: line %u chain name invalid\n" , - prog_name, line); +"%s: line %u chain name invalid" , + prog_name, line); chains[nextChain].chain =xtables_strdup (chain); chains[nextChain].policy =xtables_strdup (policy);
@@ -610,8 +610,8 @@ iptables_xml_main(int argc, char *argv[])DEBUGP ("line %u, table '%s'\n" , line, table);if (!table)xtables_error (PARAMETER_PROBLEM , -"%s: line %u table name invalid\n" , - prog_name, line); +"%s: line %u table name invalid" , + prog_name, line);openTable (table);
@@ -626,8 +626,8 @@ iptables_xml_main(int argc, char *argv[])DEBUGP ("line %u, chain '%s'\n" , line, chain);if (!chain)xtables_error (PARAMETER_PROBLEM , -"%s: line %u chain name invalid\n" , - prog_name, line); +"%s: line %u chain name invalid" , + prog_name, line);DEBUGP ("Creating new chain '%s'\n" , chain);
@@ -635,8 +635,8 @@ iptables_xml_main(int argc, char *argv[])DEBUGP ("line %u, policy '%s'\n" , line, policy);if (!policy)xtables_error (PARAMETER_PROBLEM , -"%s: line %u policy invalid\n" , - prog_name, line); +"%s: line %u policy invalid" , + prog_name, line); ctrs =strtok (NULL ," \t\n" );parse_counters (ctrs, &count);
iptables/iptables.c +2 -2
@@ -795,8 +795,8 @@ int do_command4(int argc, char *argv[], char **table,#ifdef IPT_F_GOTO if (cs.fw.ip.flags &IPT_F_GOTO )xtables_error (PARAMETER_PROBLEM , -"goto '%s' is not a chain\n" , - cs.jumpto); +"goto '%s' is not a chain" , + cs.jumpto);#endif xtables_find_target (cs.jumpto,XTF_LOAD_MUST_SUCCEED ); }else {
iptables/nft-cache.c +2 -1
@@ -105,7 +105,8 @@ static void mnl_genid_get(struct nft_handle *h, uint32_t *genid)return ;xtables_error (RESOURCE_PROBLEM , -"Could not fetch rule set generation id: %s\n" ,nft_strerror (errno)); +"Could not fetch rule set generation id: %s" , +nft_strerror (errno)); }static int nftnl_table_list_cb (const struct nlmsghdr *nlh,void *data)
iptables/nft.c +1 -1
@@ -3857,6 +3857,6 @@ void nft_assert_table_compatible(struct nft_handle *h, chain ="" ; }xtables_error (OTHER_PROBLEM , -"%s%s%stable `%s' is incompatible, use 'nft' tool.\n" , +"%s%s%stable `%s' is incompatible, use 'nft' tool." , pfx, chain, sfx, table); }
iptables/xshared.c +14 -16
@@ -400,15 +400,15 @@ bool tokenize_rule_counters(char **bufferp, char **pcntp, char **bcntp, int line ptr =strchr (buffer,']' );if (!ptr) -xtables_error (PARAMETER_PROBLEM ,"Bad line %u: need ]\n" , line); +xtables_error (PARAMETER_PROBLEM ,"Bad line %u: need ]" , line); pcnt =strtok (buffer+1 ,":" );if (!pcnt) -xtables_error (PARAMETER_PROBLEM ,"Bad line %u: need :\n" , line); +xtables_error (PARAMETER_PROBLEM ,"Bad line %u: need :" , line); bcnt =strtok (NULL ,"]" );if (!bcnt) -xtables_error (PARAMETER_PROBLEM ,"Bad line %u: need ]\n" , line); +xtables_error (PARAMETER_PROBLEM ,"Bad line %u: need ]" , line); *pcntp = pcnt; *bcntp = bcnt;
@@ -433,10 +433,10 @@ void add_argv(struct argv_store *store, const char *what, int quoted)if (store->argc +1 >=MAX_ARGC )xtables_error (PARAMETER_PROBLEM , -"Parser cannot handle more arguments\n" ); +"Parser cannot handle more arguments" );if (!what)xtables_error (PARAMETER_PROBLEM , -"Trying to store NULL argument\n" ); +"Trying to store NULL argument" ); store->argv[store->argc] =xtables_strdup (what); store->argvattr[store->argc] = quoted;
@@ -900,8 +900,7 @@ static char cmd2char(int option) ;if (i >=ARRAY_SIZE (cmdflags))xtables_error (OTHER_PROBLEM , -"cmd2char(): Invalid command number %u.\n" , -1 << i); +"cmd2char(): Invalid command number %u." ,1 << i);return cmdflags[i]; }
@@ -911,8 +910,8 @@ static void add_command(unsigned int *cmd, const int newcmd,if (invert)xtables_error (PARAMETER_PROBLEM ,"unexpected '!' flag" );if (*cmd & (~othercmds)) -xtables_error (PARAMETER_PROBLEM ,"Cannot use -%c with -%c\n" , -cmd2char (newcmd),cmd2char (*cmd & (~othercmds))); +xtables_error (PARAMETER_PROBLEM ,"Cannot use -%c with -%c" , +cmd2char (newcmd),cmd2char (*cmd & (~othercmds))); *cmd |= newcmd; }
@@ -979,9 +978,8 @@ static void generic_opt_check(int command, int options)if (!(options & (1 <<i))) {if (commands_v_options[j][i] =='+' )xtables_error (PARAMETER_PROBLEM , -"You need to supply the `-%c' " -"option for this command\n" , - optflags[i]); +"You need to supply the `-%c' option for this command" , + optflags[i]); }else {if (commands_v_options[j][i] !='x' ) legal =1 ;
@@ -991,8 +989,8 @@ static void generic_opt_check(int command, int options) }if (legal ==-1 )xtables_error (PARAMETER_PROBLEM , -"Illegal option `-%c' with this command\n" , - optflags[i]); +"Illegal option `-%c' with this command" , + optflags[i]); } }
@@ -1060,12 +1058,12 @@ void assert_valid_chain_name(const char *chainname)if (*chainname =='-' || *chainname =='!' )xtables_error (PARAMETER_PROBLEM , -"chain name not allowed to start with `%c'\n" , +"chain name not allowed to start with `%c'" , *chainname);if (xtables_find_target (chainname,XTF_TRY_LOAD ))xtables_error (PARAMETER_PROBLEM , -"chain name may not clash with target name\n" ); +"chain name may not clash with target name" );for (ptr = chainname; *ptr; ptr++)if (isspace (*ptr))
iptables/xtables-eb-translate.c +1 -1
@@ -294,7 +294,7 @@ static int do_commandeb_xlate(struct nft_handle *h, int argc, char *argv[], char "Multiple commands are not allowed");if (exec_style ==EXEC_STYLE_DAEMON )xtables_error (PARAMETER_PROBLEM , -"%s %s\n" , prog_name, prog_vers); +"%s %s" , prog_name, prog_vers);printf ("%s %s\n" , prog_name, prog_vers);exit (0 );case 'h' :
iptables/xtables-eb.c +1 -1
@@ -883,7 +883,7 @@ int do_commandeb(struct nft_handle *h, int argc, char *argv[], char **table,case 't' :/* Table */ if (restore && table_set)xtables_error (PARAMETER_PROBLEM , -"The -t option cannot be used in %s.\n" , +"The -t option cannot be used in %s." , xt_params->program_name);else if (table_set) xtables_error(PARAMETER_PROBLEM,
iptables/xtables-restore.c +13 -13
@@ -115,14 +115,14 @@ static void xtables_restore_parse_line(struct nft_handle *h,DEBUGP ("line %u, table '%s'\n" , line, table);if (!table)xtables_error (PARAMETER_PROBLEM , -"%s: line %u table name invalid\n" , - xt_params->program_name, line); +"%s: line %u table name invalid" , + xt_params->program_name, line); state->curtable =nft_table_builtin_find (h, table);if (!state->curtable)xtables_error (PARAMETER_PROBLEM , -"%s: line %u table name '%s' invalid\n" , - xt_params->program_name, line, table); +"%s: line %u table name '%s' invalid" , + xt_params->program_name, line, table);if (p->tablename && (strcmp (p->tablename, table) !=0 ))return ;
@@ -152,8 +152,8 @@ static void xtables_restore_parse_line(struct nft_handle *h,DEBUGP ("line %u, chain '%s'\n" , line, chain);if (!chain)xtables_error (PARAMETER_PROBLEM , -"%s: line %u chain name invalid\n" , - xt_params->program_name, line); +"%s: line %u chain name invalid" , + xt_params->program_name, line);xtables_announce_chain (chain);assert_valid_chain_name (chain);
@@ -162,8 +162,8 @@ static void xtables_restore_parse_line(struct nft_handle *h,DEBUGP ("line %u, policy '%s'\n" , line, policy);if (!policy)xtables_error (PARAMETER_PROBLEM , -"%s: line %u policy invalid\n" , - xt_params->program_name, line); +"%s: line %u policy invalid" , + xt_params->program_name, line);if (nft_chain_builtin_find (state->curtable, chain)) {if (counters) {
@@ -172,15 +172,15 @@ static void xtables_restore_parse_line(struct nft_handle *h,if (!ctrs || !parse_counters (ctrs, &count))xtables_error (PARAMETER_PROBLEM , -"invalid policy counters for chain '%s'\n" , - chain); +"invalid policy counters for chain '%s'" , + chain); }if (cb->chain_set && cb->chain_set (h, state->curtable->name, chain, policy, &count) <0 ) {xtables_error (OTHER_PROBLEM , -"Can't set policy `%s' on `%s' line %u: %s\n" , +"Can't set policy `%s' on `%s' line %u: %s" , policy, chain, line,strerror (errno)); }
@@ -189,13 +189,13 @@ static void xtables_restore_parse_line(struct nft_handle *h, }else if (cb->chain_restore (h, chain, state->curtable->name) <0 && errno !=EEXIST ) {xtables_error (PARAMETER_PROBLEM , -"cannot create chain '%s' (%s)\n" , +"cannot create chain '%s' (%s)" , chain,strerror (errno)); }else if (h->family ==NFPROTO_BRIDGE && !ebt_cmd_user_chain_policy (h, state->curtable->name, chain, policy)) {xtables_error (OTHER_PROBLEM , -"Can't set policy `%s' on `%s' line %u: %s\n" , +"Can't set policy `%s' on `%s' line %u: %s" , policy, chain, line,strerror (errno)); }
libxtables/xtoptions.c +2 -2
@@ -924,7 +924,7 @@ void xtables_option_tpcall(unsigned int c, char **argv, bool invert, cb.entry =xtables_option_lookup (t->x6_options, c);if (cb.entry ==NULL )xtables_error (OTHER_PROBLEM , -"Extension does not know id %u\n" , c); +"Extension does not know id %u" , c); cb.arg = optarg; cb.invert = invert; cb.ext_name = t->name;
@@ -960,7 +960,7 @@ void xtables_option_mpcall(unsigned int c, char **argv, bool invert, cb.entry =xtables_option_lookup (m->x6_options, c);if (cb.entry ==NULL )xtables_error (OTHER_PROBLEM , -"Extension does not know id %u\n" , c); +"Extension does not know id %u" , c); cb.arg = optarg; cb.invert = invert; cb.ext_name = m->name;
Signature · 1 line
2.38.0
Phil Sutter
reviewerQuoted 7 lines · Phil Sutter
Since
basic_exit_err()appends a newline to the message itself, drop explicit ones.While being at it, fix indentation and join texts split over multiple lines.
Signed-off-by Phil Sutter <[email protected]>
Applied after dropping changes to libipt_icmp.c and libip6t_icmp6.c since the relevant code was removed by commit be8c605604084 ("extensions: Unify ICMP parser into libxt_icmp.h").