git: fcb8e9255852 - stable/13 - ipfilter userland: Style(9) requires a space after return
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 07 Feb 2022 13:52:07 UTC
The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=fcb8e9255852969312f38d074669c66b13d99bd4 commit fcb8e9255852969312f38d074669c66b13d99bd4 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2022-01-04 02:49:18 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2022-02-07 13:51:17 +0000 ipfilter userland: Style(9) requires a space after return Reported by: jrtc27 Fixes: 2582ae5740181e0d2bab10003d66ae91c9b56329 (cherry picked from commit 44bc30192139b0b3c95510ab3b35802bcc6d63e4) --- sbin/ipf/common/genmask.c | 14 +++---- sbin/ipf/common/lexer.c | 34 +++++++-------- sbin/ipf/ipf/bpf_filter.c | 76 +++++++++++++++++----------------- sbin/ipf/ipf/ipf.c | 20 ++++----- sbin/ipf/ipf/ipfcomp.c | 24 +++++------ sbin/ipf/ipfs/ipfs.c | 80 ++++++++++++++++++------------------ sbin/ipf/ipfstat/ipfstat.c | 84 +++++++++++++++++++------------------- sbin/ipf/ipftest/ip_fil.c | 82 ++++++++++++++++++------------------- sbin/ipf/ipftest/ipftest.c | 40 +++++++++--------- sbin/ipf/ipmon/ipmon.c | 54 ++++++++++++------------ sbin/ipf/ipnat/ipnat.c | 6 +-- sbin/ipf/ippool/ippool.c | 64 ++++++++++++++--------------- sbin/ipf/ipsend/44arp.c | 14 +++---- sbin/ipf/ipsend/arp.c | 18 ++++---- sbin/ipf/ipsend/dlcommon.c | 24 +++++------ sbin/ipf/ipsend/ip.c | 20 ++++----- sbin/ipf/ipsend/ipresend.c | 2 +- sbin/ipf/ipsend/ipsend.c | 10 ++--- sbin/ipf/ipsend/ipsopt.c | 12 +++--- sbin/ipf/ipsend/iptest.c | 2 +- sbin/ipf/ipsend/resend.c | 8 ++-- sbin/ipf/ipsend/sbpf.c | 14 +++---- sbin/ipf/ipsend/sdlpi.c | 8 ++-- sbin/ipf/ipsend/snit.c | 10 ++--- sbin/ipf/ipsend/sock.c | 38 ++++++++--------- sbin/ipf/ipsend/sockraw.c | 10 ++--- sbin/ipf/libipf/addipopt.c | 4 +- sbin/ipf/libipf/alist_new.c | 8 ++-- sbin/ipf/libipf/allocmbt.c | 4 +- sbin/ipf/libipf/bcopywrap.c | 2 +- sbin/ipf/libipf/buildopts.c | 4 +- sbin/ipf/libipf/checkrev.c | 8 ++-- sbin/ipf/libipf/connecttcp.c | 10 ++--- sbin/ipf/libipf/count4bits.c | 4 +- sbin/ipf/libipf/count6bits.c | 2 +- sbin/ipf/libipf/dupmbt.c | 4 +- sbin/ipf/libipf/facpri.c | 20 ++++----- sbin/ipf/libipf/familyname.c | 6 +-- sbin/ipf/libipf/findword.c | 4 +- sbin/ipf/libipf/ftov.c | 8 ++-- sbin/ipf/libipf/gethost.c | 10 ++--- sbin/ipf/libipf/geticmptype.c | 8 ++-- sbin/ipf/libipf/getifname.c | 18 ++++---- sbin/ipf/libipf/getnattype.c | 4 +- sbin/ipf/libipf/getport.c | 24 +++++------ sbin/ipf/libipf/getportproto.c | 10 ++--- sbin/ipf/libipf/getproto.c | 8 ++-- sbin/ipf/libipf/getsumd.c | 2 +- sbin/ipf/libipf/hostname.c | 12 +++--- sbin/ipf/libipf/icmptypename.c | 8 ++-- sbin/ipf/libipf/inet_addr.c | 20 ++++----- sbin/ipf/libipf/interror.c | 12 +++--- sbin/ipf/libipf/ipf_perror.c | 2 +- sbin/ipf/libipf/ipft_hx.c | 14 +++---- sbin/ipf/libipf/ipft_pc.c | 34 +++++++-------- sbin/ipf/libipf/ipft_tx.c | 68 +++++++++++++++--------------- sbin/ipf/libipf/ipoptsec.c | 10 ++--- sbin/ipf/libipf/kmem.c | 20 ++++----- sbin/ipf/libipf/kmemcpywrap.c | 2 +- sbin/ipf/libipf/kvatoname.c | 4 +- sbin/ipf/libipf/load_dstlist.c | 10 ++--- sbin/ipf/libipf/load_dstlistnode.c | 8 ++-- sbin/ipf/libipf/load_file.c | 6 +-- sbin/ipf/libipf/load_hash.c | 10 ++--- sbin/ipf/libipf/load_hashnode.c | 6 +-- sbin/ipf/libipf/load_http.c | 8 ++-- sbin/ipf/libipf/load_pool.c | 8 ++-- sbin/ipf/libipf/load_poolnode.c | 6 +-- sbin/ipf/libipf/load_url.c | 2 +- sbin/ipf/libipf/msgdsize.c | 2 +- sbin/ipf/libipf/nametokva.c | 4 +- sbin/ipf/libipf/ntomask.c | 10 ++--- sbin/ipf/libipf/optname.c | 8 ++-- sbin/ipf/libipf/optvalue.c | 8 ++-- sbin/ipf/libipf/parsefields.c | 2 +- sbin/ipf/libipf/parseipfexpr.c | 4 +- sbin/ipf/libipf/parsewhoisline.c | 34 +++++++-------- sbin/ipf/libipf/poolio.c | 8 ++-- sbin/ipf/libipf/portname.c | 6 +-- sbin/ipf/libipf/prependmbt.c | 2 +- sbin/ipf/libipf/printdstl_live.c | 8 ++-- sbin/ipf/libipf/printdstlist.c | 8 ++-- sbin/ipf/libipf/printdstlistnode.c | 8 ++-- sbin/ipf/libipf/printhash.c | 8 ++-- sbin/ipf/libipf/printhash_live.c | 4 +- sbin/ipf/libipf/printhashnode.c | 4 +- sbin/ipf/libipf/printpool.c | 6 +-- sbin/ipf/libipf/printpool_live.c | 4 +- sbin/ipf/libipf/printpoolnode.c | 2 +- sbin/ipf/libipf/printstate.c | 4 +- sbin/ipf/libipf/remove_hash.c | 6 +-- sbin/ipf/libipf/remove_hashnode.c | 6 +-- sbin/ipf/libipf/remove_pool.c | 6 +-- sbin/ipf/libipf/remove_poolnode.c | 6 +-- sbin/ipf/libipf/save_execute.c | 6 +-- sbin/ipf/libipf/save_file.c | 14 +++---- sbin/ipf/libipf/save_nothing.c | 4 +- sbin/ipf/libipf/save_syslog.c | 10 ++--- sbin/ipf/libipf/save_v1trap.c | 52 +++++++++++------------ sbin/ipf/libipf/save_v2trap.c | 48 +++++++++++----------- sbin/ipf/libipf/tcp_flags.c | 2 +- sbin/ipf/libipf/tcpflags.c | 4 +- sbin/ipf/libipf/v6optvalue.c | 8 ++-- sbin/ipf/libipf/var.c | 22 +++++----- sbin/ipf/libipf/vtof.c | 8 ++-- 105 files changed, 778 insertions(+), 778 deletions(-) diff --git a/sbin/ipf/common/genmask.c b/sbin/ipf/common/genmask.c index 581573463c4c..5b715cf4c901 100644 --- a/sbin/ipf/common/genmask.c +++ b/sbin/ipf/common/genmask.c @@ -26,15 +26,15 @@ int genmask(family, msk, mskp) #ifdef USE_INET6 case AF_INET6 : if (inet_pton(AF_INET6, msk, &mskp->in4) != 1) - return(-1); + return (-1); break; #endif case AF_INET : if (inet_aton(msk, &mskp->in4) == 0) - return(-1); + return (-1); break; default : - return(-1); + return (-1); /*NOTREACHED*/ } } else { @@ -47,12 +47,12 @@ int genmask(family, msk, mskp) { case AF_INET6 : if ((*endptr != '\0') || (bits < 0) || (bits > 128)) - return(-1); + return (-1); fill6bits(bits, mskp->i6); break; case AF_INET : if (*endptr != '\0' || bits > 32 || bits < 0) - return(-1); + return (-1); if (bits == 0) addr = 0; else @@ -60,9 +60,9 @@ int genmask(family, msk, mskp) mskp->in4.s_addr = addr; break; default : - return(-1); + return (-1); /*NOTREACHED*/ } } - return(0); + return (0); } diff --git a/sbin/ipf/common/lexer.c b/sbin/ipf/common/lexer.c index e84181356da4..16fbb2272034 100644 --- a/sbin/ipf/common/lexer.c +++ b/sbin/ipf/common/lexer.c @@ -69,11 +69,11 @@ yygetc(int docont) c = yytext[yypos++]; if (c == '\n') yylineNum++; - return(c); + return (c); } if (yypos == YYBUFSIZ) - return(TOOLONG); + return (TOOLONG); if (pos >= string_start && pos <= string_end) { c = string_val[pos - string_start]; @@ -94,7 +94,7 @@ yygetc(int docont) yylast = yypos; yytext[yypos] = '\0'; - return(c); + return (c); } @@ -118,8 +118,8 @@ yyswallow(int last) if (c != EOF) yyunputc(c); if (c == last) - return(0); - return(-1); + return (0); + return (-1); } @@ -131,7 +131,7 @@ yytexttochar(void) for (i = 0; i < yypos; i++) yychars[i] = (char)(yytext[i] & 0xff); yychars[i] = '\0'; - return(yychars); + return (yychars); } @@ -171,7 +171,7 @@ yytexttostr(int offset, int max) str[i - offset] = (char)(yytext[i] & 0xff); str[i - offset] = '\0'; } - return(str); + return (str); } @@ -242,7 +242,7 @@ nextchar: lnext = 0; if ((isbuilding == 0) && !ISALNUM(c)) { prior = c; - return(c); + return (c); } goto nextchar; } @@ -333,7 +333,7 @@ nextchar: if (yydebug) fprintf(stderr, "reset at EOF\n"); prior = 0; - return(0); + return (0); } if (strchr("=,/;{}()@", c) != NULL) { @@ -599,7 +599,7 @@ done: if (rval == YY_NUMBER) priornum = yylval.num; prior = rval; - return(rval); + return (rval); } @@ -609,12 +609,12 @@ static wordtab_t *yyfindkey(key) wordtab_t *w; if (yywordtab == NULL) - return(NULL); + return (NULL); for (w = yywordtab; w->w_word != 0; w++) if (strcasecmp(key, w->w_word) == 0) - return(w); - return(NULL); + return (w); + return (NULL); } @@ -624,12 +624,12 @@ yykeytostr(int num) wordtab_t *w; if (yywordtab == NULL) - return("<unknown>"); + return ("<unknown>"); for (w = yywordtab; w->w_word; w++) if (w->w_value == num) - return(w->w_word); - return("<unknown>"); + return (w->w_word); + return ("<unknown>"); } @@ -640,7 +640,7 @@ yysettab(wordtab_t *words) save = yywordtab; yywordtab = words; - return(save); + return (save); } diff --git a/sbin/ipf/ipf/bpf_filter.c b/sbin/ipf/ipf/bpf_filter.c index 32d144b492ce..fbb0138f51d8 100644 --- a/sbin/ipf/ipf/bpf_filter.c +++ b/sbin/ipf/ipf/bpf_filter.c @@ -111,7 +111,7 @@ static int m_xhalf(mb_t *, int, int *); (_k) -= len; \ (_m) = (_m)->m_next; \ if ((_m) == 0) \ - return(0); \ + return (0); \ len = M_LEN(m); \ } \ } @@ -129,7 +129,7 @@ m_xword(m, k, err) cp = MTOD(m, u_char *) + k; if (len - k >= 4) { *err = 0; - return(EXTRACT_LONG(cp)); + return (EXTRACT_LONG(cp)); } m0 = m->m_next; if (m0 == NULL || M_LEN(m0) + len - k < 4) @@ -139,17 +139,17 @@ m_xword(m, k, err) switch (len - k) { case 1: - return(cp[0] << 24) | (np[0] << 16) | (np[1] << 8) | np[2]; + return (cp[0] << 24) | (np[0] << 16) | (np[1] << 8) | np[2]; case 2: - return(cp[0] << 24) | (cp[1] << 16) | (np[0] << 8) | np[1]; + return (cp[0] << 24) | (cp[1] << 16) | (np[0] << 8) | np[1]; default: - return(cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | np[0]; + return (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | np[0]; } bad: *err = 1; - return(0); + return (0); } static int @@ -165,16 +165,16 @@ m_xhalf(m, k, err) cp = MTOD(m, u_char *) + k; if (len - k >= 2) { *err = 0; - return(EXTRACT_SHORT(cp)); + return (EXTRACT_SHORT(cp)); } m0 = m->m_next; if (m0 == NULL) goto bad; *err = 0; - return(cp[0] << 8) | MTOD(m0, u_char *)[0]; + return (cp[0] << 8) | MTOD(m0, u_char *)[0]; bad: *err = 1; - return(0); + return (0); } /* @@ -209,7 +209,7 @@ bpf_filter(pc, p, wirelen, buflen) /* * No filter means accept all. */ - return(u_int)-1; + return (u_int)-1; A = 0; X = 0; --pc; @@ -218,21 +218,21 @@ bpf_filter(pc, p, wirelen, buflen) switch (pc->code) { default: - return(0); + return (0); case BPF_RET|BPF_K: - return(u_int)pc->k; + return (u_int)pc->k; case BPF_RET|BPF_A: - return(u_int)A; + return (u_int)A; case BPF_LD|BPF_W|BPF_ABS: k = pc->k; if (k + sizeof(int32) > buflen) { if (m == NULL) - return(0); + return (0); A = m_xword(m, k, &merr); if (merr != 0) - return(0); + return (0); continue; } A = EXTRACT_LONG(&p[k]); @@ -242,10 +242,10 @@ bpf_filter(pc, p, wirelen, buflen) k = pc->k; if (k + sizeof(short) > buflen) { if (m == NULL) - return(0); + return (0); A = m_xhalf(m, k, &merr); if (merr != 0) - return(0); + return (0); continue; } A = EXTRACT_SHORT(&p[k]); @@ -255,7 +255,7 @@ bpf_filter(pc, p, wirelen, buflen) k = pc->k; if (k >= buflen) { if (m == NULL) - return(0); + return (0); n = m; MINDEX(len, n, k); A = MTOD(n, u_char *)[k]; @@ -276,10 +276,10 @@ bpf_filter(pc, p, wirelen, buflen) k = X + pc->k; if (k + sizeof(int32) > buflen) { if (m == NULL) - return(0); + return (0); A = m_xword(m, k, &merr); if (merr != 0) - return(0); + return (0); continue; } A = EXTRACT_LONG(&p[k]); @@ -289,10 +289,10 @@ bpf_filter(pc, p, wirelen, buflen) k = X + pc->k; if (k + sizeof(short) > buflen) { if (m == NULL) - return(0); + return (0); A = m_xhalf(m, k, &merr); if (merr != 0) - return(0); + return (0); continue; } A = EXTRACT_SHORT(&p[k]); @@ -302,7 +302,7 @@ bpf_filter(pc, p, wirelen, buflen) k = X + pc->k; if (k >= buflen) { if (m == NULL) - return(0); + return (0); n = m; MINDEX(len, n, k); A = MTOD(n, u_char *)[k]; @@ -315,7 +315,7 @@ bpf_filter(pc, p, wirelen, buflen) k = pc->k; if (k >= buflen) { if (m == NULL) - return(0); + return (0); n = m; MINDEX(len, n, k); X = (MTOD(n, char *)[k] & 0xf) << 2; @@ -398,7 +398,7 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_ALU|BPF_DIV|BPF_X: if (X == 0) - return(0); + return (0); A /= X; continue; @@ -486,10 +486,10 @@ bpf_validate(f, len) const struct bpf_insn *p; if (len == 0) - return(1); + return (1); if (len < 1 || len > BPF_MAXINSNS) - return(0); + return (0); for (i = 0; i < len; ++i) { p = &f[i]; @@ -511,23 +511,23 @@ bpf_validate(f, len) */ #if 0 if (p->k >= bpf_maxbufsize) - return(0); + return (0); #endif break; case BPF_MEM: if (p->k >= BPF_MEMWORDS) - return(0); + return (0); break; case BPF_LEN: break; default: - return(0); + return (0); } break; case BPF_ST: case BPF_STX: if (p->k >= BPF_MEMWORDS) - return(0); + return (0); break; case BPF_ALU: switch (BPF_OP(p->code)) { @@ -544,9 +544,9 @@ bpf_validate(f, len) * Check for constant division by 0. */ if (BPF_RVAL(p->code) == BPF_K && p->k == 0) - return(0); + return (0); default: - return(0); + return (0); } break; case BPF_JMP: @@ -570,17 +570,17 @@ bpf_validate(f, len) switch (BPF_OP(p->code)) { case BPF_JA: if (from + p->k < from || from + p->k >= len) - return(0); + return (0); break; case BPF_JEQ: case BPF_JGT: case BPF_JGE: case BPF_JSET: if (from + p->jt >= len || from + p->jf >= len) - return(0); + return (0); break; default: - return(0); + return (0); } break; case BPF_RET: @@ -588,8 +588,8 @@ bpf_validate(f, len) case BPF_MISC: break; default: - return(0); + return (0); } } - return(BPF_CLASS(f[len - 1].code) == BPF_RET); + return (BPF_CLASS(f[len - 1].code) == BPF_RET); } diff --git a/sbin/ipf/ipf/ipf.c b/sbin/ipf/ipf/ipf.c index 0cd393f37d5e..de5121d94767 100644 --- a/sbin/ipf/ipf/ipf.c +++ b/sbin/ipf/ipf/ipf.c @@ -165,7 +165,7 @@ main(int argc, char *argv[]) if (fd != -1) (void) close(fd); - return(exitstatus); + return (exitstatus); /* NOTREACHED */ } @@ -174,11 +174,11 @@ static int opendevice(char *ipfdev, int check) { if (opts & OPT_DONOTHING) - return(-2); + return (-2); if (check && checkrev(ipfname) == -1) { fprintf(stderr, "User/kernel version check failed\n"); - return(-2); + return (-2); } if (!ipfdev) @@ -188,7 +188,7 @@ opendevice(char *ipfdev, int check) if ((fd = open(ipfdev, O_RDWR)) == -1) if ((fd = open(ipfdev, O_RDONLY)) == -1) ipferror(fd, "open device"); - return(fd); + return (fd); } @@ -208,9 +208,9 @@ get_flags(void) if ((opendevice(ipfname, 1) != -2) && (ioctl(fd, SIOCGETFF, &i) == -1)) { ipferror(fd, "SIOCGETFF"); - return(0); + return (0); } - return(i); + return (i); } @@ -256,7 +256,7 @@ ipf_interceptadd(int fd, ioctlfunc_t ioctlfunc, void *ptr) if (ipf_addrule(fd, ioctlfunc, ptr) != 0) exitstatus = 1; - return(0); + return (0); } @@ -527,13 +527,13 @@ showversion(void) if ((vfd = open(ipfname, O_RDONLY)) == -1) { perror("open device"); - return(1); + return (1); } if (ioctl(vfd, SIOCGETFS, &ipfo)) { ipferror(vfd, "ioctl(SIOCGETFS)"); close(vfd); - return(1); + return (1); } close(vfd); flags = get_flags(); @@ -574,5 +574,5 @@ showversion(void) printf("Active list: %d\n", fio.f_active); printf("Feature mask: %#x\n", fio.f_features); - return(0); + return (0); } diff --git a/sbin/ipf/ipf/ipfcomp.c b/sbin/ipf/ipf/ipfcomp.c index 19a61c8bb0e0..fc16f4adea2c 100644 --- a/sbin/ipf/ipf/ipfcomp.c +++ b/sbin/ipf/ipf/ipfcomp.c @@ -249,9 +249,9 @@ int intcmp(c1, c2) const mc_t *i1 = (const mc_t *)c1, *i2 = (const mc_t *)c2; if (i1->n == i2->n) { - return(i1->c - i2->c); + return (i1->c - i2->c); } - return(i2->n - i1->n); + return (i2->n - i1->n); } @@ -414,10 +414,10 @@ int ipfrule_add()\n\ fprintf(cfile, "\ err = ipfrule_add_%s_%s();\n\ if (err != 0)\n\ - return(err);\n", + return (err);\n", (g->fg_flags & FR_INQUE) ? "in" : "out", g->fg_name); fprintf(cfile, "\ - return(0);\n"); + return (0);\n"); fprintf(cfile, "}\n\ \n"); @@ -430,10 +430,10 @@ int ipfrule_remove()\n\ fprintf(cfile, "\ err = ipfrule_remove_%s_%s();\n\ if (err != 0)\n\ - return(err);\n", + return (err);\n", (g->fg_flags & FR_INQUE) ? "in" : "out", g->fg_name); fprintf(cfile, "\ - return(0);\n"); + return (0);\n"); fprintf(cfile, "}\n"); } @@ -467,7 +467,7 @@ static void emitGroup(num, dir, v, fr, group, incount, outcount) fprintf(fp, "}\n"); } if (openfunc == 1) { - fprintf(fp, "\treturn(fr);\n}\n"); + fprintf(fp, "\treturn (fr);\n}\n"); openfunc = 0; if (n != NULL) { free(n); @@ -488,7 +488,7 @@ static void emitGroup(num, dir, v, fr, group, incount, outcount) fprintf(fp, "}\n"); } if (openfunc == 1) { - fprintf(fp, "\treturn(fr);\n}\n"); + fprintf(fp, "\treturn (fr);\n}\n"); openfunc = 0; } } @@ -941,7 +941,7 @@ static void emitGroup(num, dir, v, fr, group, incount, outcount) indent(fp, in); if (fr->fr_flags & FR_QUICK) { - fprintf(fp, "return((frentry_t *)&%s_rule_%s_%d);\n", + fprintf(fp, "return ((frentry_t *)&%s_rule_%s_%d);\n", fr->fr_flags & FR_INQUE ? "in" : "out", FR_NAME(fr, fr_group), num); } else { @@ -1328,7 +1328,7 @@ int ipfrule_add_%s_%s()\n", instr, group); err = frrequest(&ipfmain, IPL_LOGIPF, SIOCADDFR, (caddr_t)fp,\n\ ipfmain.ipf_active, 0);\n", instr, group); - fprintf(fp, "\treturn(err);\n}\n"); + fprintf(fp, "\treturn (err);\n}\n"); fprintf(fp, "\n\n\ int ipfrule_remove_%s_%s()\n", instr, group); @@ -1365,8 +1365,8 @@ int ipfrule_remove_%s_%s()\n", instr, group); instr, group, instr, group, instr, group); fprintf(fp, "\ if (err)\n\ - return(err);\n\ + return (err);\n\ \n\n"); - fprintf(fp, "\treturn(err);\n}\n"); + fprintf(fp, "\treturn (err);\n}\n"); } diff --git a/sbin/ipf/ipfs/ipfs.c b/sbin/ipf/ipfs/ipfs.c index e7e569153556..3f1202894fad 100644 --- a/sbin/ipf/ipfs/ipfs.c +++ b/sbin/ipf/ipfs/ipfs.c @@ -142,7 +142,7 @@ int changestateif(char *ifs, char *fname) } close(fd); - return(0); + return (0); } @@ -198,7 +198,7 @@ int changenatif(char *ifs, char *fname) } close(fd); - return(0); + return (0); } @@ -286,9 +286,9 @@ int main(int argc, char *argv[]) if (!filename || ns < 0) usage(); if (ns == 0) - return(changenatif(ifs, filename)); + return (changenatif(ifs, filename)); else - return(changestateif(ifs, filename)); + return (changestateif(ifs, filename)); } if ((ns >= 0) || (lock >= 0)) { @@ -327,7 +327,7 @@ int main(int argc, char *argv[]) } } } - return(err); + return (err); } @@ -336,7 +336,7 @@ int opendevice(char *ipfdev) int fd = -1; if (opts & OPT_DONOTHING) - return(-2); + return (-2); if (!ipfdev) ipfdev = IPL_NAME; @@ -344,7 +344,7 @@ int opendevice(char *ipfdev) if ((fd = open(ipfdev, O_RDWR)) == -1) if ((fd = open(ipfdev, O_RDONLY)) == -1) perror("open device"); - return(fd); + return (fd); } @@ -361,12 +361,12 @@ int setlock(int fd, int lock) if (!(opts & OPT_DONOTHING)) { if (ioctl(fd, SIOCSTLCK, &lock) == -1) { perror("SIOCSTLCK"); - return(1); + return (1); } if (opts & OPT_VERBOSE) printf("Lock now %s\n", lock ? "on" : "off"); } - return(0); + return (0); } @@ -383,7 +383,7 @@ int writestate(int fd, char *file) if (wfd == -1) { fprintf(stderr, "%s ", file); perror("state:open"); - return(1); + return (1); } ipsp = &ips; @@ -404,19 +404,19 @@ int writestate(int fd, char *file) break; perror("state:SIOCSTGET"); close(wfd); - return(1); + return (1); } if (opts & OPT_VERBOSE) printf("Got state next %p\n", ips.ips_next); if (write(wfd, ipsp, sizeof(ips)) != sizeof(ips)) { perror("state:write"); close(wfd); - return(1); + return (1); } } while (ips.ips_next != NULL); close(wfd); - return(0); + return (0); } @@ -433,7 +433,7 @@ int readstate(int fd, char *file) if (sfd == -1) { fprintf(stderr, "%s ", file); perror("open"); - return(1); + return (1); } bzero((char *)&ips, sizeof(ips)); @@ -522,7 +522,7 @@ int readstate(int fd, char *file) free(is); } - return(0); + return (0); freeipshead: while ((is = ipshead) != NULL) { @@ -531,7 +531,7 @@ freeipshead: } if (sfd != -1) close(sfd); - return(1); + return (1); } @@ -556,7 +556,7 @@ int readnat(int fd, char *file) if (nfd == -1) { fprintf(stderr, "%s ", file); perror("nat:open"); - return(1); + return (1); } bzero((char *)&ipn, sizeof(ipn)); @@ -652,7 +652,7 @@ int readnat(int fd, char *file) if (ioctl(fd, SIOCSTPUT, &obj)) { fprintf(stderr, "in=%p:", in); perror("SIOCSTPUT"); - return(1); + return (1); } if (nat->nat_flags & SI_NEWFR) { @@ -667,7 +667,7 @@ int readnat(int fd, char *file) free(in); } - return(0); + return (0); freenathead: while ((in = ipnhead) != NULL) { @@ -676,7 +676,7 @@ freenathead: } if (nfd != -1) close(nfd); - return(1); + return (1); } @@ -694,7 +694,7 @@ int writenat(int fd, char *file) if (nfd == -1) { fprintf(stderr, "%s ", file); perror("nat:open"); - return(1); + return (1); } obj.ipfo_rev = IPFILTER_VERSION; @@ -710,7 +710,7 @@ int writenat(int fd, char *file) close(nfd); if (ipnp != NULL) free(ipnp); - return(1); + return (1); } if (opts & OPT_VERBOSE) @@ -740,7 +740,7 @@ int writenat(int fd, char *file) perror("nat:SIOCSTGET"); close(nfd); free(ipnp); - return(1); + return (1); } if (opts & OPT_VERBOSE) @@ -750,7 +750,7 @@ int writenat(int fd, char *file) perror("nat:write"); close(nfd); free(ipnp); - return(1); + return (1); } next = ipnp->ipn_next; } while (ipnp && next); @@ -758,7 +758,7 @@ int writenat(int fd, char *file) free(ipnp); close(nfd); - return(0); + return (0); } @@ -772,15 +772,15 @@ int writeall(char *dirname) if (chdir(dirname)) { fprintf(stderr, "IPF_SAVEDIR=%s: ", dirname); perror("chdir(IPF_SAVEDIR)"); - return(1); + return (1); } fd = opendevice(NULL); if (fd == -1) - return(1); + return (1); if (setlock(fd, 1)) { close(fd); - return(1); + return (1); } devfd = opendevice(IPSTATE_NAME); @@ -799,16 +799,16 @@ int writeall(char *dirname) if (setlock(fd, 0)) { close(fd); - return(1); + return (1); } close(fd); - return(0); + return (0); bad: setlock(fd, 0); close(fd); - return(1); + return (1); } @@ -821,35 +821,35 @@ int readall(char *dirname) if (chdir(dirname)) { perror("chdir(IPF_SAVEDIR)"); - return(1); *** 4979 LINES SKIPPED ***