diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 3b135ebf1d3d..9db403709b00 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -624,12 +624,12 @@ ipf_pr_ipv6exthdr(fr_info_t *fin, int multiple, int proto) if ((fin->fin_dlen - 8) < 0) { fin->fin_flx |= FI_SHORT; LBUMPD(ipf_stats[fin->fin_out], fr_v6_ext_short); - return(NULL); + return (NULL); } if (ipf_pr_pullup(fin, 8) == -1) { LBUMPD(ipf_stats[fin->fin_out], fr_v6_ext_pullup); - return(NULL); + return (NULL); } hdr = fin->fin_dp; @@ -647,7 +647,7 @@ ipf_pr_ipv6exthdr(fr_info_t *fin, int multiple, int proto) fin->fin_flx |= FI_BAD; DT3(ipf_fi_bad_pr_ipv6exthdr_len, fr_info_t *, fin, u_short, shift, u_short, fin->fin_dlen); LBUMPD(ipf_stats[fin->fin_out], fr_v6_ext_hlen); - return(NULL); + return (NULL); } fin->fin_dp = (char *)fin->fin_dp + shift; @@ -659,7 +659,7 @@ ipf_pr_ipv6exthdr(fr_info_t *fin, int multiple, int proto) * end result until after it has been defragmented. */ if (fin->fin_flx & FI_FRAG) - return(hdr); + return (hdr); for (i = 0; ip6exthdr[i].ol_bit != 0; i++) if (ip6exthdr[i].ol_val == proto) { @@ -675,7 +675,7 @@ ipf_pr_ipv6exthdr(fr_info_t *fin, int multiple, int proto) break; } - return(hdr); + return (hdr); } @@ -694,8 +694,8 @@ ipf_pr_hopopts6(fr_info_t *fin) hdr = ipf_pr_ipv6exthdr(fin, 0, IPPROTO_HOPOPTS); if (hdr == NULL) - return(IPPROTO_NONE); - return(hdr->ip6e_nxt); + return (IPPROTO_NONE); + return (hdr->ip6e_nxt); } @@ -714,8 +714,8 @@ ipf_pr_mobility6(fr_info_t *fin) hdr = ipf_pr_ipv6exthdr(fin, 0, IPPROTO_MOBILITY); if (hdr == NULL) - return(IPPROTO_NONE); - return(hdr->ip6e_nxt); + return (IPPROTO_NONE); + return (hdr->ip6e_nxt); } @@ -734,7 +734,7 @@ ipf_pr_routing6(fr_info_t *fin) hdr = (struct ip6_routing *)ipf_pr_ipv6exthdr(fin, 0, IPPROTO_ROUTING); if (hdr == NULL) - return(IPPROTO_NONE); + return (IPPROTO_NONE); switch (hdr->ip6r_type) { @@ -749,7 +749,7 @@ ipf_pr_routing6(fr_info_t *fin) fin->fin_flx |= FI_BAD; DT1(ipf_fi_bad_routing6, fr_info_t *, fin); LBUMPD(ipf_stats[fin->fin_out], fr_v6_rh_bad); - return(IPPROTO_NONE); + return (IPPROTO_NONE); } break; @@ -757,7 +757,7 @@ ipf_pr_routing6(fr_info_t *fin) break; } - return(hdr->ip6r_nxt); + return (hdr->ip6r_nxt); } @@ -801,7 +801,7 @@ ipf_pr_fragment6(fr_info_t *fin) frag = (struct ip6_frag *)ipf_pr_ipv6exthdr(fin, 0, IPPROTO_FRAGMENT); if (frag == NULL) { LBUMPD(ipf_stats[fin->fin_out], fr_v6_frag_bad); - return(IPPROTO_NONE); + return (IPPROTO_NONE); } if ((frag->ip6f_offlg & IP6F_MORE_FRAG) != 0) { @@ -836,7 +836,7 @@ ipf_pr_fragment6(fr_info_t *fin) * this effectively disables the fragment cache for > 1 protocol at a * time. */ - return(frag->ip6f_nxt); + return (frag->ip6f_nxt); } @@ -857,9 +857,9 @@ ipf_pr_dstopts6(fr_info_t *fin) hdr = ipf_pr_ipv6exthdr(fin, 0, IPPROTO_DSTOPTS); if (hdr == NULL) { LBUMPD(ipf_stats[fin->fin_out], fr_v6_dst_bad); - return(IPPROTO_NONE); + return (IPPROTO_NONE); } - return(hdr->ip6e_nxt); + return (hdr->ip6e_nxt); } @@ -1043,7 +1043,7 @@ ipf_pr_ah6(fr_info_t *fin) ipf_main_softc_t *softc = fin->fin_main_soft; LBUMPD(ipf_stats[fin->fin_out], fr_v6_ah_bad); - return(IPPROTO_NONE); + return (IPPROTO_NONE); } ipf_pr_short6(fin, sizeof(*ah)); @@ -1052,7 +1052,7 @@ ipf_pr_ah6(fr_info_t *fin) * No need for another pullup, ipf_pr_ipv6exthdr() will pullup * enough data to satisfy ah_next (the very first one.) */ - return(ah->ah_next); + return (ah->ah_next); } @@ -1115,7 +1115,7 @@ ipf_pr_pullup(fr_info_t *fin, int plen) if (ipf_pullup(fin->fin_m, fin, plen) == NULL) { DT(ipf_pullup_fail); LBUMP(ipf_stats[fin->fin_out].fr_pull[1]); - return(-1); + return (-1); } LBUMP(ipf_stats[fin->fin_out].fr_pull[0]); #else @@ -1127,11 +1127,11 @@ ipf_pr_pullup(fr_info_t *fin, int plen) *fin->fin_mp = NULL; fin->fin_m = NULL; fin->fin_ip = NULL; - return(-1); + return (-1); #endif } } - return(0); + return (0); } @@ -1302,12 +1302,12 @@ ipf_pr_tcpcommon(fr_info_t *fin) fin->fin_flx |= FI_TCPUDP; if (fin->fin_off != 0) { LBUMPD(ipf_stats[fin->fin_out], fr_tcp_frag); - return(0); + return (0); } if (ipf_pr_pullup(fin, sizeof(*tcp)) == -1) { LBUMPD(ipf_stats[fin->fin_out], fr_tcp_pullup); - return(-1); + return (-1); } tcp = fin->fin_dp; @@ -1318,7 +1318,7 @@ ipf_pr_tcpcommon(fr_info_t *fin) if ((fin->fin_flx & FI_SHORT) != 0) { LBUMPD(ipf_stats[fin->fin_out], fr_tcp_short); - return(1); + return (1); } /* @@ -1330,7 +1330,7 @@ ipf_pr_tcpcommon(fr_info_t *fin) LBUMPD(ipf_stats[fin->fin_out], fr_tcp_small); fin->fin_flx |= FI_BAD; DT3(ipf_fi_bad_tlen, fr_info_t, fin, u_int, tlen, u_int, sizeof(tcphdr_t)); - return(1); + return (1); } flags = tcp->th_flags; @@ -1396,7 +1396,7 @@ ipf_pr_tcpcommon(fr_info_t *fin) } if (fin->fin_flx & FI_BAD) { LBUMPD(ipf_stats[fin->fin_out], fr_tcp_bad_flags); - return(1); + return (1); } /* @@ -1408,12 +1408,12 @@ ipf_pr_tcpcommon(fr_info_t *fin) * then that might add some weight to adding this... */ if (tlen == sizeof(tcphdr_t)) { - return(0); + return (0); } if (ipf_pr_pullup(fin, tlen) == -1) { LBUMPD(ipf_stats[fin->fin_out], fr_tcp_pullup); - return(-1); + return (-1); } #if 0 @@ -1455,7 +1455,7 @@ ipf_pr_tcpcommon(fr_info_t *fin) } #endif /* 0 */ - return(0); + return (0); } @@ -1481,7 +1481,7 @@ ipf_pr_udpcommon(fr_info_t *fin) fin->fin_flx |= FI_SHORT; LBUMPD(ipf_stats[fin->fin_out], fr_udp_pullup); - return(1); + return (1); } udp = fin->fin_dp; @@ -1490,7 +1490,7 @@ ipf_pr_udpcommon(fr_info_t *fin) fin->fin_dport = ntohs(udp->uh_dport); } - return(0); + return (0); } @@ -1579,13 +1579,13 @@ ipf_pr_ah(fr_info_t *fin) if (((fin->fin_flx & FI_SHORT) != 0) || (fin->fin_off != 0)) { LBUMPD(ipf_stats[fin->fin_out], fr_v4_ah_bad); - return(IPPROTO_NONE); + return (IPPROTO_NONE); } if (ipf_pr_pullup(fin, sizeof(*ah)) == -1) { DT(fr_v4_ah_pullup_1); LBUMP(ipf_stats[fin->fin_out].fr_v4_ah_pullup); - return(IPPROTO_NONE); + return (IPPROTO_NONE); } ah = (authhdr_t *)fin->fin_dp; @@ -1595,7 +1595,7 @@ ipf_pr_ah(fr_info_t *fin) if (ipf_pr_pullup(fin, len) == -1) { DT(fr_v4_ah_pullup_2); LBUMP(ipf_stats[fin->fin_out].fr_v4_ah_pullup); - return(IPPROTO_NONE); + return (IPPROTO_NONE); } /* @@ -1604,7 +1604,7 @@ ipf_pr_ah(fr_info_t *fin) */ fin->fin_dp = (char *)fin->fin_dp + len; fin->fin_dlen -= len; - return(ah->ah_next); + return (ah->ah_next); } @@ -1879,7 +1879,7 @@ ipf_checkripso(u_char *s) m--; } - return(secmsk << 16) | auth; + return (secmsk << 16) | auth; } @@ -1911,7 +1911,7 @@ ipf_checkcipso(fr_info_t *fin, u_char *s, int ol) LBUMPD(ipf_stats[fin->fin_out], fr_v4_cipso_bad); fin->fin_flx |= FI_BAD; DT2(ipf_fi_bad_checkcipso_ol, fr_info_t *, fin, u_int, ol); - return(0); + return (0); } fi = &fin->fin_fi; @@ -1929,7 +1929,7 @@ ipf_checkcipso(fr_info_t *fin, u_char *s, int ol) LBUMPD(ipf_stats[fin->fin_out], fr_v4_cipso_tlen); fin->fin_flx |= FI_BAD; DT2(ipf_fi_bad_checkcipso_tlen, fr_info_t *, fin, u_int, tlen); - return(0); + return (0); } sensitivity = 0; @@ -1981,7 +1981,7 @@ ipf_checkcipso(fr_info_t *fin, u_char *s, int ol) fi->fi_sensitivity = sensitivity; } - return(doi); + return (doi); } @@ -2027,9 +2027,9 @@ ipf_makefrip(int hlen, ip_t *ip, fr_info_t *fin) } if (fin->fin_ip == NULL) { LBUMP(ipf_stats[fin->fin_out].fr_ip_freed); - return(-1); + return (-1); } - return(0); + return (0); } @@ -2094,7 +2094,7 @@ ipf_portcheck(frpcmp_t *frp, u_32_t pop) default : break; } - return(err); + return (err); } @@ -2135,7 +2135,7 @@ ipf_tcpudpchk(fr_ip_t *fi, frtuc_t *ft) */ if (err && (fi->fi_p == IPPROTO_TCP)) { if (fi->fi_flx & FI_SHORT) - return(!(ft->ftu_tcpf | ft->ftu_tcpfm)); + return (!(ft->ftu_tcpf | ft->ftu_tcpfm)); /* * Match the flags ? If not, abort this match. */ @@ -2146,7 +2146,7 @@ ipf_tcpudpchk(fr_ip_t *fi, frtuc_t *ft) err = 0; } } - return(err); + return (err); } @@ -2184,7 +2184,7 @@ ipf_check_ipf(fr_info_t *fin, frentry_t *fr, int portcmp) FR_DEBUG(("0. %#08x & %#08x != %#08x\n", ntohl(*lip), ntohl(*lm), ntohl(*ld))); if (i) - return(1); + return (1); /* * Next 32 bits is a constructed bitmask indicating which IP options @@ -2195,7 +2195,7 @@ ipf_check_ipf(fr_info_t *fin, frentry_t *fr, int portcmp) FR_DEBUG(("1. %#08x & %#08x != %#08x\n", ntohl(*lip), ntohl(*lm), ntohl(*ld))); if (i != 0) - return(1); + return (1); lip++, lm++, ld++; /* @@ -2208,7 +2208,7 @@ ipf_check_ipf(fr_info_t *fin, frentry_t *fr, int portcmp) i = (*fr->fr_srcfunc)(fin->fin_main_soft, fr->fr_srcptr, fi->fi_v, lip, fin->fin_plen); if (i == -1) - return(1); + return (1); lip += 3; lm += 3; ld += 3; @@ -2237,7 +2237,7 @@ ipf_check_ipf(fr_info_t *fin, frentry_t *fr, int portcmp) } i ^= (fr->fr_flags & FR_NOTSRCIP) >> 6; if (i != 0) - return(1); + return (1); /* * Check the destination address. @@ -2247,7 +2247,7 @@ ipf_check_ipf(fr_info_t *fin, frentry_t *fr, int portcmp) i = (*fr->fr_dstfunc)(fin->fin_main_soft, fr->fr_dstptr, fi->fi_v, lip, fin->fin_plen); if (i == -1) - return(1); + return (1); lip += 3; lm += 3; ld += 3; @@ -2276,7 +2276,7 @@ ipf_check_ipf(fr_info_t *fin, frentry_t *fr, int portcmp) } i ^= (fr->fr_flags & FR_NOTDSTIP) >> 7; if (i != 0) - return(1); + return (1); /* * IP addresses matched. The next 32bits contains: * mast of old IP header security & authentication bits. @@ -2319,7 +2319,7 @@ ipf_check_ipf(fr_info_t *fin, frentry_t *fr, int portcmp) } } } - return(i); + return (i); } @@ -2351,7 +2351,7 @@ ipf_scanlist(fr_info_t *fin, u_32_t pass) * Do not allow nesting deeper than 16 levels. */ if (fin->fin_depth >= 16) - return(pass); + return (pass); fr = fin->fin_fr; @@ -2359,7 +2359,7 @@ ipf_scanlist(fr_info_t *fin, u_32_t pass) * If there are no rules in this list, return now. */ if (fr == NULL) - return(pass); + return (pass); skip = 0; portcmp = 0; @@ -2576,7 +2576,7 @@ ipf_scanlist(fr_info_t *fin, u_32_t pass) } } fin->fin_depth--; - return(pass); + return (pass); } @@ -2616,7 +2616,7 @@ ipf_acctpkt(fr_info_t *fin, u_32_t *passp) bcopy(group, fin->fin_group, FR_GROUPLEN); fin->fin_rule = rulen; } - return(NULL); + return (NULL); } @@ -2719,7 +2719,7 @@ ipf_firewall(fr_info_t *fin, u_32_t *passp) fr = fin->fin_fr; *passp = pass; - return(fr); + return (fr); } @@ -2786,14 +2786,14 @@ ipf_check(void *ctx, ip_t *ip, int hlen, struct ifnet *ifp, int out # ifdef __sparc if ((u_int)ip & 0x3) - return(2); + return (2); # endif # else SPL_INT(s); # endif if (softc->ipf_running <= 0) { - return(0); + return (0); } bzero((char *)fin, sizeof(*fin)); @@ -3182,9 +3182,9 @@ ipf_check(void *ctx, ip_t *ip, int hlen, struct ifnet *ifp, int out #ifdef _KERNEL if (FR_ISPASS(pass)) - return(0); + return (0); LBUMP(ipf_stats[out].fr_blocked[fin->fin_reason]); - return(fin->fin_error); + return (fin->fin_error); #else /* _KERNEL */ if (*mp != NULL) (*mp)->mb_ifp = fin->fin_ifp; @@ -3192,33 +3192,33 @@ ipf_check(void *ctx, ip_t *ip, int hlen, struct ifnet *ifp, int out FR_VERBOSE(("fin_flx %#x pass %#x ", fin->fin_flx, pass)); /*if ((pass & FR_CMDMASK) == (softc->ipf_pass & FR_CMDMASK))*/ if ((pass & FR_NOMATCH) != 0) - return(1); + return (1); if ((pass & FR_RETMASK) != 0) switch (pass & FR_RETMASK) { case FR_RETRST : - return(3); + return (3); case FR_RETICMP : - return(4); + return (4); case FR_FAKEICMP : - return(5); + return (5); } switch (pass & FR_CMDMASK) { case FR_PASS : - return(0); + return (0); case FR_BLOCK : - return(-1); + return (-1); case FR_AUTH : - return(-2); + return (-2); case FR_ACCOUNT : - return(-3); + return (-3); case FR_PREAUTH : - return(-4); + return (-4); } - return(2); + return (2); #endif /* _KERNEL */ } @@ -3277,7 +3277,7 @@ ipf_dolog(fr_info_t *fin, u_32_t *passp) *passp = pass; } - return(fin->fin_fr); + return (fin->fin_fr); } #endif /* IPFILTER_LOG */ @@ -3309,7 +3309,7 @@ ipf_cksum(u_short *addr, int len) */ sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ sum += (sum >> 16); /* add carry */ - return(u_short)(~sum); + return (u_short)(~sum); } @@ -3372,9 +3372,9 @@ fr_cksum(fr_info_t *fin, ip_t *ip, int l4proto, void *l4hdr) ip6 = (ip6_t *)ip; off = ((caddr_t)ip6 - m->m_data) + sizeof(struct ip6_hdr); int len = ntohs(ip6->ip6_plen) - (off - sizeof(*ip6)); - return(ipf_pcksum6(m, ip6, off, len)); + return (ipf_pcksum6(m, ip6, off, len)); } else { - return(0xffff); + return (0xffff); } #endif @@ -3408,7 +3408,7 @@ fr_cksum(fr_info_t *fin, ip_t *ip, int l4proto, void *l4hdr) sum2 = ipf_pcksum(fin, off, sum); if (csump != NULL) *csump = sumsave; - return(sum2); + return (sum2); } @@ -3445,7 +3445,7 @@ ipf_findgroup(ipf_main_softc_t *softc, char *group, minor_t unit, int set, } if (fgpp != NULL) *fgpp = fgp; - return(fg); + return (fg); } @@ -3472,10 +3472,10 @@ ipf_group_add(ipf_main_softc_t *softc, char *group, void *head, u_32_t flags, u_32_t gflags; if (group == NULL) - return(NULL); + return (NULL); if (unit == IPL_LOGIPF && *group == '\0') - return(NULL); + return (NULL); fgp = NULL; gflags = flags & FR_INOUT; @@ -3487,9 +3487,9 @@ ipf_group_add(ipf_main_softc_t *softc, char *group, void *head, u_32_t flags, if (fg->fg_flags == 0) fg->fg_flags = gflags; else if (gflags != fg->fg_flags) - return(NULL); + return (NULL); fg->fg_ref++; - return(fg); + return (fg); } KMALLOC(fg, frgroup_t *); @@ -3503,7 +3503,7 @@ ipf_group_add(ipf_main_softc_t *softc, char *group, void *head, u_32_t flags, fg->fg_set = &softc->ipf_groups[unit][set]; *fgp = fg; } - return(fg); + return (fg); } @@ -3570,7 +3570,7 @@ ipf_group_flush(ipf_main_softc_t *softc, frgroup_t *group) (void) ipf_flushlist(softc, &gone, &group->fg_start); - return(gone); + return (gone); } @@ -3594,12 +3594,12 @@ ipf_getrulen(ipf_main_softc_t *softc, int unit, char *group, u_32_t n) fg = ipf_findgroup(softc, group, unit, softc->ipf_active, NULL); if (fg == NULL) - return(NULL); + return (NULL); for (fr = fg->fg_start; fr && n; fr = fr->fr_next, n--) ; if (n != 0) - return(NULL); - return(fr); + return (NULL); + return (fr); } @@ -3657,7 +3657,7 @@ ipf_flushlist(ipf_main_softc_t *softc, int *nfreedp, frentry_t **listp) freed++; } *nfreedp += freed; - return(freed); + return (freed); } @@ -3703,7 +3703,7 @@ ipf_flush(ipf_main_softc_t *softc, minor_t unit, int flags) if (tmp >= 0) flushed += tmp; } - return(flushed); + return (flushed); } @@ -3753,7 +3753,7 @@ ipf_flush_groups(ipf_main_softc_t *softc, frgroup_t **grhead, int flags) if (removed == 0) fgp = &fg->fg_next; } - return(flushed); + return (flushed); } @@ -3781,7 +3781,7 @@ memstr(const char *src, char *dst, size_t slen, size_t dlen) dst++; dlen--; } - return(s); + return (s); } /* ------------------------------------------------------------------------ */ /* Function: ipf_fixskip */ @@ -3844,8 +3844,8 @@ count4bits(u_32_t ip) ipn++; } if (ipn == ip) - return(cnt); - return(-1); + return (cnt); + return (-1); } @@ -3872,7 +3872,7 @@ count6bits(u_32_t *msk) if (j & 0x80000000) i++; } - return(i); + return (i); } # endif #endif /* _KERNEL */ @@ -3981,7 +3981,7 @@ ipf_synclist(ipf_main_softc_t *softc, frentry_t *fr, void *ifp) &fr->fr_dstfunc); } } - return(0); + return (0); unwind: for (frt = start; frt != fr; fr = fr->fr_next) { @@ -3994,7 +3994,7 @@ ipf_synclist(ipf_main_softc_t *softc, frentry_t *fr, void *ifp) ipf_lookup_deref(softc, frt->fr_dsttype, frt->fr_dstptr); } - return(error); + return (error); } @@ -4035,7 +4035,7 @@ ipf_sync(ipf_main_softc_t *softc, void *ifp) } RWLOCK_EXIT(&softc->ipf_mutex); - return(0); + return (0); } @@ -4064,7 +4064,7 @@ copyinptr(ipf_main_softc_t *softc, void *src, void *dst, size_t size) #if SOLARIS error = COPYIN(src, &ca, sizeof(ca)); if (error != 0) - return(error); + return (error); #else bcopy(src, (caddr_t)&ca, sizeof(ca)); #endif @@ -4073,7 +4073,7 @@ copyinptr(ipf_main_softc_t *softc, void *src, void *dst, size_t size) IPFERROR(3); error = EFAULT; } - return(error); + return (error); } @@ -4100,7 +4100,7 @@ copyoutptr(ipf_main_softc_t *softc, void *src, void *dst, size_t size) IPFERROR(4); error = EFAULT; } - return(error); + return (error); } @@ -4120,12 +4120,12 @@ ipf_lock(caddr_t data, int *lockp) err = BCOPYIN(data, &arg, sizeof(arg)); if (err != 0) - return(EFAULT); + return (EFAULT); err = BCOPYOUT(lockp, data, sizeof(*lockp)); if (err != 0) - return(EFAULT); + return (EFAULT); *lockp = arg; - return(0); + return (0); } @@ -4275,9 +4275,9 @@ ipf_matchicmpqueryreply(int v, icmpinfo_t *ic, icmphdr_t *icmp, int rev) if ((!rev && (icmp->icmp_type == ictype)) || (rev && (icmpreplytype4[ictype] == icmp->icmp_type))) { if (icmp->icmp_type != ICMP_ECHOREPLY) - return(1); + return (1); if (icmp->icmp_id == ic->ici_id) - return(1); + return (1); } } #ifdef USE_INET6 @@ -4285,13 +4285,13 @@ ipf_matchicmpqueryreply(int v, icmpinfo_t *ic, icmphdr_t *icmp, int rev) if ((!rev && (icmp->icmp_type == ictype)) || (rev && (icmpreplytype6[ictype] == icmp->icmp_type))) { if (icmp->icmp_type != ICMP6_ECHO_REPLY) - return(1); + return (1); if (icmp->icmp_id == ic->ici_id) - return(1); + return (1); } } #endif - return(0); + return (0); } @@ -4332,14 +4332,14 @@ ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) int i; if (fr1->fr_cksum != fr2->fr_cksum) - return(1); + return (1); if (fr1->fr_size != fr2->fr_size) - return(2); + return (2); if (fr1->fr_dsize != fr2->fr_dsize) - return(3); + return (3); if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, FR_CMPSIZ) != 0) - return(4); + return (4); /* * XXX: There is still a bug here as different rules with the * the same interfaces but in a different order will compare @@ -4357,22 +4357,22 @@ ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) * referenced by the same rule doesn't work anyway. */ if (IPF_IFNAMES_DIFFERENT(fr_ifnames[i])) - return(5); + return (5); } if (IPF_FRDEST_DIFFERENT(fr_tif)) - return(6); + return (6); if (IPF_FRDEST_DIFFERENT(fr_rif)) - return(7); + return (7); if (IPF_FRDEST_DIFFERENT(fr_dif)) - return(8); + return (8); if (!fr1->fr_data && !fr2->fr_data) - return(0); /* move along, nothing to see here */ + return (0); /* move along, nothing to see here */ if (fr1->fr_data && fr2->fr_data) { if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize) == 0) - return(0); /* same */ + return (0); /* same */ } - return(9); + return (9); } @@ -4416,23 +4416,23 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, bzero(fp, sizeof(frd)); error = ipf_inobj(softc, data, NULL, fp, IPFOBJ_FRENTRY); if (error) { - return(error); + return (error); } if ((fp->fr_type & FR_T_BUILTIN) != 0) { IPFERROR(6); - return(EINVAL); + return (EINVAL); } KMALLOCS(f, frentry_t *, fp->fr_size); if (f == NULL) { IPFERROR(131); - return(ENOMEM); + return (ENOMEM); } bzero(f, fp->fr_size); error = ipf_inobjsz(softc, data, f, IPFOBJ_FRENTRY, fp->fr_size); if (error) { KFREES(f, fp->fr_size); - return(error); + return (error); } fp = f; @@ -4452,7 +4452,7 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, fp = (frentry_t *)data; if ((fp->fr_type & FR_T_BUILTIN) == 0) { IPFERROR(7); - return(EINVAL); + return (EINVAL); } fp->fr_flags &= ~FR_COPIED; } @@ -4918,7 +4918,7 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, KFREES(fp, fp->fr_size); } RWLOCK_EXIT(&softc->ipf_mutex); - return(error); + return (error); } if (f == NULL) { @@ -5073,7 +5073,7 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, } KFREES(fp, fp->fr_size); } - return(error); + return (error); } @@ -5208,7 +5208,7 @@ ipf_findlookup(ipf_main_softc_t *softc, int unit, frentry_t *fr, break; } - return(ptr); + return (ptr); } @@ -5237,7 +5237,7 @@ ipf_funcinit(ipf_main_softc_t *softc, frentry_t *fr) err = (*ft->ipfu_init)(softc, fr); break; } - return(err); + return (err); } @@ -5279,8 +5279,8 @@ ipf_findfunc(ipfunc_t funcptr) for (ft = ipf_availfuncs; ft->ipfu_addr != NULL; ft++) if (ft->ipfu_addr == funcptr) - return(funcptr); - return(NULL); + return (funcptr); + return (NULL); } @@ -5303,7 +5303,7 @@ ipf_resolvefunc(ipf_main_softc_t *softc, void *data) error = BCOPYIN(data, &res, sizeof(res)); if (error != 0) { IPFERROR(123); - return(EFAULT); + return (EFAULT); } if (res.ipfu_addr == NULL && res.ipfu_name[0] != '\0') { @@ -5314,9 +5314,9 @@ ipf_resolvefunc(ipf_main_softc_t *softc, void *data) res.ipfu_init = ft->ipfu_init; if (COPYOUT(&res, data, sizeof(res)) != 0) { IPFERROR(35); - return(EFAULT); + return (EFAULT); } - return(0); + return (0); } } if (res.ipfu_addr != NULL && res.ipfu_name[0] == '\0') { @@ -5327,13 +5327,13 @@ ipf_resolvefunc(ipf_main_softc_t *softc, void *data) res.ipfu_init = ft->ipfu_init; if (COPYOUT(&res, data, sizeof(res)) != 0) { IPFERROR(36); - return(EFAULT); + return (EFAULT); } - return(0); + return (0); } } IPFERROR(37); - return(ESRCH); + return (ESRCH); } @@ -5379,7 +5379,7 @@ ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps) rv = 0; *curpps = *curpps + 1; - return(rv); + return (rv); } #endif @@ -5442,13 +5442,13 @@ ipf_derefrule(ipf_main_softc_t *softc, frentry_t **frp) KFREES(fr->fr_data, fr->fr_dsize); } KFREES(fr, fr->fr_size); - return(0); + return (0); } - return(1); + return (1); } else { MUTEX_EXIT(&fr->fr_lock); } - return(-1); + return (-1); } @@ -5470,15 +5470,15 @@ ipf_grpmapinit(ipf_main_softc_t *softc, frentry_t *fr) iph = ipf_lookup_find_htable(softc, IPL_LOGIPF, name); if (iph == NULL) { IPFERROR(38); - return(ESRCH); + return (ESRCH); } if ((iph->iph_flags & FR_INOUT) != (fr->fr_flags & FR_INOUT)) { IPFERROR(39); - return(ESRCH); + return (ESRCH); } iph->iph_ref++; fr->fr_ptr = iph; - return(0); + return (0); } @@ -5498,7 +5498,7 @@ ipf_grpmapfini(ipf_main_softc_t *softc, frentry_t *fr) iph = fr->fr_ptr; if (iph != NULL) ipf_lookup_deref(softc, IPLT_HASH, iph); - return(0); + return (0); } @@ -5521,12 +5521,12 @@ ipf_srcgrpmap(fr_info_t *fin, u_32_t *passp) rval = ipf_iphmfindgroup(fin->fin_main_soft, fin->fin_fr->fr_ptr, &fin->fin_src); if (rval == NULL) - return(NULL); + return (NULL); fg = rval; fin->fin_fr = fg->fg_start; (void) ipf_scanlist(fin, *passp); - return(fin->fin_fr); + return (fin->fin_fr); } @@ -5549,12 +5549,12 @@ ipf_dstgrpmap(fr_info_t *fin, u_32_t *passp) rval = ipf_iphmfindgroup(fin->fin_main_soft, fin->fin_fr->fr_ptr, &fin->fin_dst); if (rval == NULL) - return(NULL); + return (NULL); fg = rval; fin->fin_fr = fg->fg_start; (void) ipf_scanlist(fin, *passp); - return(fin->fin_fr); + return (fin->fin_fr); } /* @@ -5607,7 +5607,7 @@ ipf_addtimeoutqueue(ipf_main_softc_t *softc, ipftq_t **parent, u_int seconds) MUTEX_EXIT(&ifq->ifq_lock); MUTEX_EXIT(&softc->ipf_timeoutlock); - return(ifq); + return (ifq); } } @@ -5623,7 +5623,7 @@ ipf_addtimeoutqueue(ipf_main_softc_t *softc, ipftq_t **parent, u_int seconds) softc->ipf_userifqs++; } MUTEX_EXIT(&softc->ipf_timeoutlock); - return(ifq); + return (ifq); } @@ -5651,7 +5651,7 @@ ipf_deletetimeoutqueue(ipftq_t *ifq) ifq->ifq_flags |= IFQF_DELETE; } - return(ifq->ifq_ref); + return (ifq->ifq_ref); } @@ -5942,7 +5942,7 @@ ipf_updateipid(fr_info_t *fin) if (fin->fin_off != 0) { sum = ipf_frag_ipidknown(fin); if (sum == 0xffffffff) - return(-1); + return (-1); sum &= 0xffff; id = (u_short)sum; ip->ip_id = htons(id); @@ -5954,7 +5954,7 @@ ipf_updateipid(fr_info_t *fin) } if (id == ido) - return(0); + return (0); CALC_SUMD(ido, id, sumd); /* DESTRUCTIVE MACRO! id,ido change */ sum = (~ntohs(ip->ip_sum)) & 0xffff; sum += sumd; @@ -5962,7 +5962,7 @@ ipf_updateipid(fr_info_t *fin) sum = (sum >> 16) + (sum & 0xffff); sums = ~(u_short)sum; ip->ip_sum = htons(sums); - return(0); + return (0); } @@ -6001,7 +6001,7 @@ ipf_getifname(struct ifnet *ifp, char *buffer) (void) strncpy(s, temp, space); } # endif - return(buffer); + return (buffer); } #endif @@ -6039,7 +6039,7 @@ ipf_ioctlswitch(ipf_main_softc_t *softc, int unit, void *data, ioctlcmd_t cmd, IPFERROR(40); error = EFAULT; } - return(error); + return (error); default : break; } @@ -6112,7 +6112,7 @@ ipf_ioctlswitch(ipf_main_softc_t *softc, int unit, void *data, ioctlcmd_t cmd, break; } - return(error); + return (error); } @@ -6177,7 +6177,7 @@ ipf_inobj(ipf_main_softc_t *softc, void *data, ipfobj_t *objp, void *ptr, if ((type < 0) || (type >= IPFOBJ_COUNT)) { IPFERROR(49); - return(EINVAL); + return (EINVAL); } if (objp == NULL) @@ -6185,26 +6185,26 @@ ipf_inobj(ipf_main_softc_t *softc, void *data, ipfobj_t *objp, void *ptr, error = BCOPYIN(data, objp, sizeof(*objp)); if (error != 0) { IPFERROR(124); - return(EFAULT); + return (EFAULT); } if (objp->ipfo_type != type) { IPFERROR(50); - return(EINVAL); + return (EINVAL); } if (objp->ipfo_rev >= ipf_objbytes[type][2]) { if ((ipf_objbytes[type][0] & 1) != 0) { if (objp->ipfo_size < ipf_objbytes[type][1]) { IPFERROR(51); - return(EINVAL); + return (EINVAL); } size = ipf_objbytes[type][1]; } else if (objp->ipfo_size == ipf_objbytes[type][1]) { size = objp->ipfo_size; } else { IPFERROR(52); - return(EINVAL); + return (EINVAL); } error = COPYIN(objp->ipfo_ptr, ptr, size); if (error != 0) { @@ -6219,7 +6219,7 @@ ipf_inobj(ipf_main_softc_t *softc, void *data, ipfobj_t *objp, void *ptr, error = EINVAL; #endif } - return(error); + return (error); } @@ -6246,25 +6246,25 @@ ipf_inobjsz(ipf_main_softc_t *softc, void *data, void *ptr, int type, int sz) if ((type < 0) || (type >= IPFOBJ_COUNT)) { IPFERROR(56); - return(EINVAL); + return (EINVAL); } error = BCOPYIN(data, &obj, sizeof(obj)); if (error != 0) { IPFERROR(125); - return(EFAULT); + return (EFAULT); } if (obj.ipfo_type != type) { IPFERROR(58); - return(EINVAL); + return (EINVAL); } if (obj.ipfo_rev >= ipf_objbytes[type][2]) { if (((ipf_objbytes[type][0] & 1) == 0) || (sz < ipf_objbytes[type][1])) { IPFERROR(57); - return(EINVAL); + return (EINVAL); } error = COPYIN(obj.ipfo_ptr, ptr, sz); if (error != 0) { @@ -6279,7 +6279,7 @@ ipf_inobjsz(ipf_main_softc_t *softc, void *data, void *ptr, int type, int sz) error = EINVAL; #endif } - return(error); + return (error); } @@ -6305,25 +6305,25 @@ ipf_outobjsz(ipf_main_softc_t *softc, void *data, void *ptr, int type, int sz) if ((type < 0) || (type >= IPFOBJ_COUNT)) { IPFERROR(62); - return(EINVAL); + return (EINVAL); } error = BCOPYIN(data, &obj, sizeof(obj)); if (error != 0) { IPFERROR(127); - return(EFAULT); + return (EFAULT); } if (obj.ipfo_type != type) { IPFERROR(63); - return(EINVAL); + return (EINVAL); } if (obj.ipfo_rev >= ipf_objbytes[type][2]) { if (((ipf_objbytes[type][0] & 1) == 0) || (sz < ipf_objbytes[type][1])) { IPFERROR(146); - return(EINVAL); + return (EINVAL); } error = COPYOUT(ptr, obj.ipfo_ptr, sz); if (error != 0) { @@ -6338,7 +6338,7 @@ ipf_outobjsz(ipf_main_softc_t *softc, void *data, void *ptr, int type, int sz) error = EINVAL; #endif } - return(error); + return (error); } @@ -6361,29 +6361,29 @@ ipf_outobj(ipf_main_softc_t *softc, void *data, void *ptr, int type) if ((type < 0) || (type >= IPFOBJ_COUNT)) { IPFERROR(67); - return(EINVAL); + return (EINVAL); } error = BCOPYIN(data, &obj, sizeof(obj)); if (error != 0) { IPFERROR(126); - return(EFAULT); + return (EFAULT); } if (obj.ipfo_type != type) { IPFERROR(68); - return(EINVAL); + return (EINVAL); } if (obj.ipfo_rev >= ipf_objbytes[type][2]) { if ((ipf_objbytes[type][0] & 1) != 0) { if (obj.ipfo_size < ipf_objbytes[type][1]) { IPFERROR(69); - return(EINVAL); + return (EINVAL); } } else if (obj.ipfo_size != ipf_objbytes[type][1]) { IPFERROR(70); - return(EINVAL); + return (EINVAL); } error = COPYOUT(ptr, obj.ipfo_ptr, obj.ipfo_size); @@ -6399,7 +6399,7 @@ ipf_outobj(ipf_main_softc_t *softc, void *data, void *ptr, int type) error = EINVAL; #endif } - return(error); + return (error); } @@ -6424,19 +6424,19 @@ ipf_outobjk(ipf_main_softc_t *softc, ipfobj_t *obj, void *ptr) if ((type < 0) || (type >= IPFOBJ_COUNT)) { IPFERROR(147); - return(EINVAL); + return (EINVAL); } if (obj->ipfo_rev >= ipf_objbytes[type][2]) { if ((ipf_objbytes[type][0] & 1) != 0) { if (obj->ipfo_size < ipf_objbytes[type][1]) { IPFERROR(148); - return(EINVAL); + return (EINVAL); } } else if (obj->ipfo_size != ipf_objbytes[type][1]) { IPFERROR(149); - return(EINVAL); + return (EINVAL); } error = COPYOUT(ptr, obj->ipfo_ptr, obj->ipfo_size); @@ -6452,7 +6452,7 @@ ipf_outobjk(ipf_main_softc_t *softc, ipfobj_t *obj, void *ptr) error = EINVAL; #endif } - return(error); + return (error); } @@ -6479,12 +6479,12 @@ ipf_checkl4sum(fr_info_t *fin) * this check fails then considered the packet to be "bad". */ if ((fin->fin_flx & (FI_FRAG|FI_SHORT|FI_BAD)) != 0) - return(1); + return (1); DT2(l4sumo, int, fin->fin_out, int, (int)fin->fin_p); if (fin->fin_out == 1) { fin->fin_cksum = FI_CK_SUMOK; - return(0); + return (0); } csump = NULL; @@ -6520,7 +6520,7 @@ ipf_checkl4sum(fr_info_t *fin) break; default : - return(1); + return (1); /*NOTREACHED*/ } @@ -6547,10 +6547,10 @@ ipf_checkl4sum(fr_info_t *fin) if (hdrsum == sum) { #endif fin->fin_cksum = FI_CK_SUMOK; - return(0); + return (0); } fin->fin_cksum = FI_CK_BAD; - return(-1); + return (-1); } @@ -6580,14 +6580,14 @@ ipf_ifpfillv4addr(int atype, struct sockaddr_in *sin, struct sockaddr_in *mask, if (atype == FRI_NETWORK || atype == FRI_NETMASKED) { if (atype == FRI_NETMASKED) { if (inpmask == NULL) - return(-1); + return (-1); inpmask->s_addr = mask->sin_addr.s_addr; } inp->s_addr = sin->sin_addr.s_addr & mask->sin_addr.s_addr; } else { inp->s_addr = sin->sin_addr.s_addr; } - return(0); + return (0); } @@ -6627,7 +6627,7 @@ ipf_ifpfillv6addr(int atype, struct sockaddr_in6 *sin, if (atype == FRI_NETWORK || atype == FRI_NETMASKED) { if (atype == FRI_NETMASKED) { if (inpmask == NULL) - return(-1); + return (-1); inpmask->i6[0] = and->i6[0]; inpmask->i6[1] = and->i6[1]; inpmask->i6[2] = and->i6[2]; @@ -6644,7 +6644,7 @@ ipf_ifpfillv6addr(int atype, struct sockaddr_in6 *sin, inp->i6[2] = src->i6[2]; inp->i6[3] = src->i6[3]; } - return(0); + return (0); } #endif @@ -6666,17 +6666,17 @@ int ipf_matchtag(ipftag_t *tag1, ipftag_t *tag2) { if (tag1 == tag2) - return(1); + return (1); if ((tag1->ipt_num[0] == 0) && (tag2->ipt_num[0] == 0)) - return(1); + return (1); if ((tag1->ipt_num[0] == tag2->ipt_num[0]) && (tag1->ipt_num[1] == tag2->ipt_num[1]) && (tag1->ipt_num[2] == tag2->ipt_num[2]) && (tag1->ipt_num[3] == tag2->ipt_num[3])) - return(1); - return(0); + return (1); + return (0); } @@ -6693,14 +6693,14 @@ ipf_coalesce(fr_info_t *fin) { if ((fin->fin_flx & FI_COALESCE) != 0) - return(1); + return (1); /* * If the mbuf pointers indicate that there is no mbuf to work with, * return but do not indicate success or failure. */ if (fin->fin_m == NULL || fin->fin_mp == NULL) - return(0); + return (0); #if defined(_KERNEL) if (ipf_pullup(fin->fin_m, fin, fin->fin_plen) == NULL) { @@ -6714,12 +6714,12 @@ ipf_coalesce(fr_info_t *fin) fin->fin_reason = FRB_COALESCE; *fin->fin_mp = NULL; fin->fin_m = NULL; - return(-1); + return (-1); } #else fin = fin; /* LINT */ #endif - return(1); + return (1); } @@ -6771,19 +6771,19 @@ ipf_tune_findbycookie(ipftuneable_t **ptop, void *cookie, void **next) else *next = ptop; } - return(ta); + return (ta); } for (tap = ptop; (ta = *tap) != NULL; tap = &ta->ipft_next) if (tap == cookie) { if (next != NULL) *next = &ta->ipft_next; - return(ta); + return (ta); } if (next != NULL) *next = NULL; - return(NULL); + return (NULL); } @@ -6803,10 +6803,10 @@ ipf_tune_findbyname(ipftuneable_t *top, const char *name) for (ta = top; ta != NULL; ta = ta->ipft_next) if (!strcmp(ta->ipft_name, name)) { - return(ta); + return (ta); } - return(NULL); + return (NULL); } @@ -6837,7 +6837,7 @@ ipf_tune_add_array(ipf_main_softc_t *softc, ipftuneable_t *newtune) } } - return(error); + return (error); } @@ -6862,7 +6862,7 @@ ipf_tune_array_link(ipf_main_softc_t *softc, ipftuneable_t *array) t = array; if (t->ipft_name == NULL) - return(-1); + return (-1); for (; t[1].ipft_name != NULL; t++) t[0].ipft_next = &t[1]; @@ -6877,7 +6877,7 @@ ipf_tune_array_link(ipf_main_softc_t *softc, ipftuneable_t *array) break; *p = array; - return(0); + return (0); } @@ -6897,14 +6897,14 @@ ipf_tune_array_unlink(ipf_main_softc_t *softc, ipftuneable_t *array) if (t == array) break; if (t == NULL) - return(-1); + return (-1); for (; t[1].ipft_name != NULL; t++) ; *p = t->ipft_next; - return(0); + return (0); } @@ -6935,7 +6935,7 @@ ipf_tune_array_copy(void *base, size_t size, ipftuneable_t *template) KMALLOCS(copy, ipftuneable_t *, size); if (copy == NULL) { - return(NULL); + return (NULL); } bcopy(template, copy, size); @@ -6944,7 +6944,7 @@ ipf_tune_array_copy(void *base, size_t size, ipftuneable_t *template) copy[i].ipft_next = copy + i + 1; } - return(copy); + return (copy); } @@ -6965,7 +6965,7 @@ ipf_tune_add(ipf_main_softc_t *softc, ipftuneable_t *newtune) ta = ipf_tune_findbyname(softc->ipf_tuners, newtune->ipft_name); if (ta != NULL) { IPFERROR(74); - return(EEXIST); + return (EEXIST); } for (tap = &softc->ipf_tuners; *tap != NULL; tap = &(*tap)->ipft_next) @@ -6973,7 +6973,7 @@ ipf_tune_add(ipf_main_softc_t *softc, ipftuneable_t *newtune) newtune->ipft_next = NULL; *tap = newtune; - return(0); + return (0); } @@ -7006,7 +7006,7 @@ ipf_tune_del(ipf_main_softc_t *softc, ipftuneable_t *oldtune) error = ESRCH; IPFERROR(75); } - return(error); + return (error); } @@ -7033,7 +7033,7 @@ ipf_tune_del_array(ipf_main_softc_t *softc, ipftuneable_t *oldtune) break; } - return(error); + return (error); } @@ -7061,7 +7061,7 @@ ipf_ipftune(ipf_main_softc_t *softc, ioctlcmd_t cmd, void *data) error = ipf_inobj(softc, data, NULL, &tu, IPFOBJ_TUNEABLE); if (error != 0) - return(error); + return (error); tu.ipft_name[sizeof(tu.ipft_name) - 1] = '\0'; cookie = tu.ipft_cookie; @@ -7093,7 +7093,7 @@ ipf_ipftune(ipf_main_softc_t *softc, ioctlcmd_t cmd, void *data) */ if (ta->ipft_sz > sizeof(tu.ipft_un)) { IPFERROR(76); - return(EINVAL); + return (EINVAL); } tu.ipft_vlong = 0; @@ -7215,7 +7215,7 @@ ipf_ipftune(ipf_main_softc_t *softc, ioctlcmd_t cmd, void *data) break; } - return(error); + return (error); } @@ -7237,17 +7237,17 @@ ipf_zerostats(ipf_main_softc_t *softc, caddr_t data) error = ipf_inobj(softc, data, &obj, &fio, IPFOBJ_IPFSTAT); if (error != 0) - return(error); + return (error); ipf_getstat(softc, &fio, obj.ipfo_rev); error = ipf_outobj(softc, data, &fio, IPFOBJ_IPFSTAT); if (error != 0) - return(error); + return (error); WRITE_ENTER(&softc->ipf_mutex); bzero(&softc->ipf_stats, sizeof(softc->ipf_stats)); RWLOCK_EXIT(&softc->ipf_mutex); - return(0); + return (0); } @@ -7291,7 +7291,7 @@ ipf_resolvedest(ipf_main_softc_t *softc, char *base, frdest_t *fdp, int v) } fdp->fd_ptr = ifp; - return(errval); + return (errval); } @@ -7315,16 +7315,16 @@ ipf_resolvenic(ipf_main_softc_t *softc, char *name, int v) softc = softc; /* gcc -Wextra */ if (name[0] == '\0') - return(NULL); + return (NULL); if ((name[1] == '\0') && ((name[0] == '-') || (name[0] == '*'))) { - return(NULL); + return (NULL); } nic = GETIFP(name, v); if (nic == NULL) nic = (void *)-1; - return(nic); + return (nic); } @@ -7413,7 +7413,7 @@ ipf_token_del(ipf_main_softc_t *softc, int type, int uid, void *ptr) } RWLOCK_EXIT(&softc->ipf_tokens); - return(error); + return (error); } @@ -7466,7 +7466,7 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) new = NULL; if (it == NULL) { RWLOCK_EXIT(&softc->ipf_tokens); - return(NULL); + return (NULL); } it->ipt_ctx = ptr; it->ipt_uid = uid; @@ -7496,7 +7496,7 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) RWLOCK_EXIT(&softc->ipf_tokens); - return(it); + return (it); } @@ -7545,7 +7545,7 @@ ipf_token_deref(ipf_main_softc_t *softc, ipftoken_t *token) ASSERT(token->ipt_ref > 0); token->ipt_ref--; if (token->ipt_ref > 0) - return(token->ipt_ref); + return (token->ipt_ref); data = token->ipt_data; datap = &data; @@ -7586,7 +7586,7 @@ ipf_token_deref(ipf_main_softc_t *softc, ipftoken_t *token) ipf_token_unlink(softc, token); KFREE(token); - return(0); + return (0); } @@ -7623,9 +7623,9 @@ ipf_nextrule(ipf_main_softc_t *softc, int active, int unit, frentry_t *fr, while (next != NULL) { if (out) { if (next->fr_flags & FR_OUTQUE) - return(next); + return (next); } else if (next->fr_flags & FR_INQUE) { - return(next); + return (next); } next = next->fr_next; } @@ -7633,7 +7633,7 @@ ipf_nextrule(ipf_main_softc_t *softc, int active, int unit, frentry_t *fr, fg = fg->fg_next; } - return(NULL); + return (NULL); } /* ------------------------------------------------------------------------ */ @@ -7665,28 +7665,28 @@ ipf_getnextrule(ipf_main_softc_t *softc, ipftoken_t *t, void *ptr) if (t == NULL || ptr == NULL) { IPFERROR(84); - return(EFAULT); + return (EFAULT); } error = ipf_inobj(softc, ptr, &obj, &it, IPFOBJ_IPFITER); if (error != 0) - return(error); + return (error); if ((it.iri_inout < 0) || (it.iri_inout > 3)) { IPFERROR(85); - return(EINVAL); + return (EINVAL); } if ((it.iri_active != 0) && (it.iri_active != 1)) { IPFERROR(86); - return(EINVAL); + return (EINVAL); } if (it.iri_nrules == 0) { IPFERROR(87); - return(ENOSPC); + return (ENOSPC); } if (it.iri_rule == NULL) { IPFERROR(88); - return(EFAULT); + return (EFAULT); } fg = NULL; @@ -7778,7 +7778,7 @@ ipf_getnextrule(ipf_main_softc_t *softc, ipftoken_t *t, void *ptr) if ((fr != NULL) && (next == &zero)) (void) ipf_derefrule(softc, &fr); - return(error); + return (error); } @@ -7811,12 +7811,12 @@ ipf_frruleiter(ipf_main_softc_t *softc, void *data, int uid, void *ctx) } else { error = ipf_inobj(softc, data, &obj, &it, IPFOBJ_IPFITER); if (error != 0) - return(error); + return (error); it.iri_rule = NULL; error = ipf_outobj(softc, data, &it, IPFOBJ_IPFITER); } - return(error); + return (error); } @@ -7846,7 +7846,7 @@ ipf_geniter(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp) break; } - return(error); + return (error); } @@ -7869,7 +7869,7 @@ ipf_genericiter(ipf_main_softc_t *softc, void *data, int uid, void *ctx) error = ipf_inobj(softc, data, NULL, &iter, IPFOBJ_GENITER); if (error != 0) - return(error); + return (error); token = ipf_token_find(softc, iter.igi_type, uid, ctx); if (token != NULL) { @@ -7883,7 +7883,7 @@ ipf_genericiter(ipf_main_softc_t *softc, void *data, int uid, void *ctx) error = 0; } - return(error); + return (error); } @@ -8177,7 +8177,7 @@ ipf_ipf_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, int mode, break; } - return(error); + return (error); } @@ -8347,7 +8347,7 @@ ipf_decaps(fr_info_t *fin, u_32_t pass, int l5proto) pass &= ~FR_CMDMASK; pass |= FR_BLOCK|FR_QUICK; fin->fin_reason = FRB_DECAPFRIP; - return(-1); + return (-1); } pass = ipf_scanlist(fin, pass); @@ -8375,7 +8375,7 @@ ipf_decaps(fr_info_t *fin, u_32_t pass, int l5proto) m->m_len += elen; #endif } - return(pass); + return (pass); } @@ -8406,42 +8406,42 @@ ipf_matcharray_load(ipf_main_softc_t *softc, caddr_t data, ipfobj_t *objp, error = BCOPYIN(data, objp, sizeof(*objp)); if (error != 0) { IPFERROR(116); - return(EFAULT); + return (EFAULT); } if (objp->ipfo_type != IPFOBJ_IPFEXPR) { IPFERROR(117); - return(EINVAL); + return (EINVAL); } if (((objp->ipfo_size & 3) != 0) || (objp->ipfo_size == 0) || (objp->ipfo_size > 1024)) { IPFERROR(118); - return(EINVAL); + return (EINVAL); } arraysize = objp->ipfo_size * sizeof(*array); KMALLOCS(array, int *, arraysize); if (array == NULL) { IPFERROR(119); - return(ENOMEM); + return (ENOMEM); } error = COPYIN(objp->ipfo_ptr, array, arraysize); if (error != 0) { KFREES(array, arraysize); IPFERROR(120); - return(EFAULT); + return (EFAULT); } if (ipf_matcharray_verify(array, arraysize) != 0) { KFREES(array, arraysize); IPFERROR(121); - return(EINVAL); + return (EINVAL); } *arrayptr = array; - return(0); + return (0); } @@ -8469,7 +8469,7 @@ ipf_matcharray_verify(int *array, int arraysize) * (minimum 4 in length) and a trailer, for a total of 6. */ if ((array[0] < 6) || (arraysize < 24) || (arraysize > 4096)) { - return(-1); + return (-1); } /* @@ -8477,7 +8477,7 @@ ipf_matcharray_verify(int *array, int arraysize) * the array claims to be itself. */ if (array[0] * sizeof(*array) != arraysize) { - return(-1); + return (-1); } maxidx = nelem - 1; @@ -8485,7 +8485,7 @@ ipf_matcharray_verify(int *array, int arraysize) * The last opcode in this array should be an IPF_EXP_END. */ if (array[maxidx] != IPF_EXP_END) { - return(-1); + return (-1); } for (i = 1; i < maxidx; ) { @@ -8498,11 +8498,11 @@ ipf_matcharray_verify(int *array, int arraysize) */ if ((e->ipfe_size < 1 ) || (e->ipfe_size + i > maxidx)) { - return(-1); + return (-1); } i += e->ipfe_size; } - return(0); + return (0); } @@ -8654,7 +8654,7 @@ ipf_fr_matcharray(fr_info_t *fin, int *array) break; } - return(rv); + return (rv); } @@ -8733,7 +8733,7 @@ ipf_queueflush(ipf_main_softc_t *softc, ipftq_delete_fn_t deletefn, } if ((*activep * 100 / size) <= low) { - return(removed); + return (removed); } /* @@ -8751,7 +8751,7 @@ ipf_queueflush(ipf_main_softc_t *softc, ipftq_delete_fn_t deletefn, istart = IPF_TTLVAL(1800); interval = IPF_TTLVAL(30); } else { - return(0); + return (0); } if (istart > softc->ipf_ticks) { if (softc->ipf_ticks - interval < interval) @@ -8805,7 +8805,7 @@ ipf_queueflush(ipf_main_softc_t *softc, ipftq_delete_fn_t deletefn, istart -= interval; } - return(removed); + return (removed); } @@ -8842,7 +8842,7 @@ ipf_deliverlocal(ipf_main_softc_t *softc, int ipversion, void *ifp, #endif } - return(islocal); + return (islocal); } @@ -8867,10 +8867,10 @@ ipf_settimeout(struct ipf_main_softc_s *softc, ipftuneable_t *t, * by this function - it's just a middle man. */ if (ipf_state_settimeout(softc, t, p) == -1) - return(-1); + return (-1); if (ipf_nat_settimeout(softc, t, p) == -1) - return(-1); - return(0); + return (-1); + return (0); } @@ -8956,9 +8956,9 @@ ipf_settimeout_tcp(ipftuneable_t *t, ipftuneval_t *p, ipftq_t *tab) * ipf_interror isn't set here because it should be set * by whatever called this function. */ - return(-1); + return (-1); } - return(0); + return (0); } @@ -8985,7 +8985,7 @@ ipf_main_soft_create(void *arg) if (arg == NULL) { KMALLOC(softc, ipf_main_softc_t *); if (softc == NULL) - return(NULL); + return (NULL); } else { softc = arg; } @@ -9003,7 +9003,7 @@ ipf_main_soft_create(void *arg) ipf_main_tuneables); if (softc->ipf_tuners == NULL) { ipf_main_soft_destroy(softc); - return(NULL); + return (NULL); } MUTEX_INIT(&softc->ipf_rw, "ipf rw mutex"); @@ -9048,7 +9048,7 @@ ipf_main_soft_create(void *arg) #endif ipf_fbsd_kenv_get(softc); - return(softc); + return (softc); } /* ------------------------------------------------------------------------ */ @@ -9063,7 +9063,7 @@ ipf_main_soft_create(void *arg) int ipf_main_soft_init(ipf_main_softc_t *softc) { - return(0); + return (0); } @@ -9118,7 +9118,7 @@ ipf_main_soft_fini(ipf_main_softc_t *softc) (void) ipf_flush(softc, IPL_LOGCOUNT, FR_INQUE|FR_OUTQUE|FR_INACTIVE); (void) ipf_flush(softc, IPL_LOGCOUNT, FR_INQUE|FR_OUTQUE); - return(0); + return (0); } @@ -9155,7 +9155,7 @@ ipf_main_load(void) icmpreplytype6[ND_NEIGHBOR_SOLICIT] = ND_NEIGHBOR_ADVERT; #endif - return(0); + return (0); } @@ -9170,7 +9170,7 @@ ipf_main_load(void) int ipf_main_unload(void) { - return(0); + return (0); } @@ -9186,24 +9186,24 @@ int ipf_load_all(void) { if (ipf_main_load() == -1) - return(-1); + return (-1); if (ipf_state_main_load() == -1) - return(-1); + return (-1); if (ipf_nat_main_load() == -1) - return(-1); + return (-1); if (ipf_frag_main_load() == -1) - return(-1); + return (-1); if (ipf_auth_main_load() == -1) - return(-1); + return (-1); if (ipf_proxy_main_load() == -1) - return(-1); + return (-1); - return(0); + return (0); } @@ -9219,24 +9219,24 @@ int ipf_unload_all(void) { if (ipf_proxy_main_unload() == -1) - return(-1); + return (-1); if (ipf_auth_main_unload() == -1) - return(-1); + return (-1); if (ipf_frag_main_unload() == -1) - return(-1); + return (-1); if (ipf_nat_main_unload() == -1) - return(-1); + return (-1); if (ipf_state_main_unload() == -1) - return(-1); + return (-1); if (ipf_main_unload() == -1) - return(-1); + return (-1); - return(0); + return (0); } @@ -9255,59 +9255,59 @@ ipf_create_all(void *arg) softc = ipf_main_soft_create(arg); if (softc == NULL) - return(NULL); + return (NULL); #ifdef IPFILTER_LOG softc->ipf_log_soft = ipf_log_soft_create(softc); if (softc->ipf_log_soft == NULL) { ipf_destroy_all(softc); - return(NULL); + return (NULL); } #endif softc->ipf_lookup_soft = ipf_lookup_soft_create(softc); if (softc->ipf_lookup_soft == NULL) { ipf_destroy_all(softc); - return(NULL); + return (NULL); } softc->ipf_sync_soft = ipf_sync_soft_create(softc); if (softc->ipf_sync_soft == NULL) { ipf_destroy_all(softc); - return(NULL); + return (NULL); } softc->ipf_state_soft = ipf_state_soft_create(softc); if (softc->ipf_state_soft == NULL) { ipf_destroy_all(softc); - return(NULL); + return (NULL); } softc->ipf_nat_soft = ipf_nat_soft_create(softc); if (softc->ipf_nat_soft == NULL) { ipf_destroy_all(softc); - return(NULL); + return (NULL); } softc->ipf_frag_soft = ipf_frag_soft_create(softc); if (softc->ipf_frag_soft == NULL) { ipf_destroy_all(softc); - return(NULL); + return (NULL); } softc->ipf_auth_soft = ipf_auth_soft_create(softc); if (softc->ipf_auth_soft == NULL) { ipf_destroy_all(softc); - return(NULL); + return (NULL); } softc->ipf_proxy_soft = ipf_proxy_soft_create(softc); if (softc->ipf_proxy_soft == NULL) { ipf_destroy_all(softc); - return(NULL); + return (NULL); } - return(softc); + return (softc); } @@ -9385,35 +9385,35 @@ ipf_init_all(ipf_main_softc_t *softc) { if (ipf_main_soft_init(softc) == -1) - return(-1); + return (-1); #ifdef IPFILTER_LOG if (ipf_log_soft_init(softc, softc->ipf_log_soft) == -1) - return(-1); + return (-1); #endif if (ipf_lookup_soft_init(softc, softc->ipf_lookup_soft) == -1) - return(-1); + return (-1); if (ipf_sync_soft_init(softc, softc->ipf_sync_soft) == -1) - return(-1); + return (-1); if (ipf_state_soft_init(softc, softc->ipf_state_soft) == -1) - return(-1); + return (-1); if (ipf_nat_soft_init(softc, softc->ipf_nat_soft) == -1) - return(-1); + return (-1); if (ipf_frag_soft_init(softc, softc->ipf_frag_soft) == -1) - return(-1); + return (-1); if (ipf_auth_soft_init(softc, softc->ipf_auth_soft) == -1) - return(-1); + return (-1); if (ipf_proxy_soft_init(softc, softc->ipf_proxy_soft) == -1) - return(-1); + return (-1); - return(0); + return (0); } @@ -9432,35 +9432,35 @@ ipf_fini_all(ipf_main_softc_t *softc) ipf_token_flush(softc); if (ipf_proxy_soft_fini(softc, softc->ipf_proxy_soft) == -1) - return(-1); + return (-1); if (ipf_auth_soft_fini(softc, softc->ipf_auth_soft) == -1) - return(-1); + return (-1); if (ipf_frag_soft_fini(softc, softc->ipf_frag_soft) == -1) - return(-1); + return (-1); if (ipf_nat_soft_fini(softc, softc->ipf_nat_soft) == -1) - return(-1); + return (-1); if (ipf_state_soft_fini(softc, softc->ipf_state_soft) == -1) - return(-1); + return (-1); if (ipf_sync_soft_fini(softc, softc->ipf_sync_soft) == -1) - return(-1); + return (-1); if (ipf_lookup_soft_fini(softc, softc->ipf_lookup_soft) == -1) - return(-1); + return (-1); #ifdef IPFILTER_LOG if (ipf_log_soft_fini(softc, softc->ipf_log_soft) == -1) - return(-1); + return (-1); #endif if (ipf_main_soft_fini(softc) == -1) - return(-1); + return (-1); - return(0); + return (0); } @@ -9542,23 +9542,23 @@ ipf_ht_node_cmp(struct host_node_s *k1, struct host_node_s *k2) i = (k2->hn_addr.adf_family - k1->hn_addr.adf_family); if (i != 0) - return(i); + return (i); if (k1->hn_addr.adf_family == AF_INET) - return(k2->hn_addr.adf_addr.in4.s_addr - + return (k2->hn_addr.adf_addr.in4.s_addr - k1->hn_addr.adf_addr.in4.s_addr); i = k2->hn_addr.adf_addr.i6[3] - k1->hn_addr.adf_addr.i6[3]; if (i != 0) - return(i); + return (i); i = k2->hn_addr.adf_addr.i6[2] - k1->hn_addr.adf_addr.i6[2]; if (i != 0) - return(i); + return (i); i = k2->hn_addr.adf_addr.i6[1] - k1->hn_addr.adf_addr.i6[1]; if (i != 0) - return(i); + return (i); i = k2->hn_addr.adf_addr.i6[0] - k1->hn_addr.adf_addr.i6[0]; - return(i); + return (i); } @@ -9658,12 +9658,12 @@ ipf_ht_node_add(ipf_main_softc_t *softc, host_track_t *htp, int family, h = RBI_SEARCH(ipf_rb, &htp->ht_root, &k); if (h == NULL) { if (htp->ht_cur_nodes >= htp->ht_max_nodes) - return(-1); + return (-1); KMALLOC(h, host_node_t *); if (h == NULL) { DT(ipf_rb_no_mem); LBUMP(ipf_rb_no_mem); - return(-1); + return (-1); } /* @@ -9680,13 +9680,13 @@ ipf_ht_node_add(ipf_main_softc_t *softc, host_track_t *htp, int family, (h->hn_active >= htp->ht_max_per_node)) { DT(ipf_rb_node_max); LBUMP(ipf_rb_node_max); - return(-1); + return (-1); } } h->hn_active++; - return(0); + return (0); } @@ -9714,7 +9714,7 @@ ipf_ht_node_del(host_track_t *htp, int family, i6addr_t *addr) h = RBI_SEARCH(ipf_rb, &htp->ht_root, &k); if (h == NULL) { - return(-1); + return (-1); } else { h->hn_active--; if (h->hn_active == 0) { @@ -9724,7 +9724,7 @@ ipf_ht_node_del(host_track_t *htp, int family, i6addr_t *addr) } } - return(0); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/ip_auth.c b/sys/netpfil/ipfilter/netinet/ip_auth.c index 326348f54646..ab6b08048833 100644 --- a/sys/netpfil/ipfilter/netinet/ip_auth.c +++ b/sys/netpfil/ipfilter/netinet/ip_auth.c @@ -135,7 +135,7 @@ static int ipf_auth_flush(void *); int ipf_auth_main_load(void) { - return(0); + return (0); } @@ -150,7 +150,7 @@ ipf_auth_main_load(void) int ipf_auth_main_unload(void) { - return(0); + return (0); } @@ -169,7 +169,7 @@ ipf_auth_soft_create(ipf_main_softc_t *softc) KMALLOC(softa, ipf_auth_softc_t *); if (softa == NULL) - return(NULL); + return (NULL); bzero((char *)softa, sizeof(*softa)); @@ -182,7 +182,7 @@ ipf_auth_soft_create(ipf_main_softc_t *softc) cv_init(&softa->ipf_auth_wait, "ipf auth condvar", CV_DRIVER, NULL); #endif - return(softa); + return (softa); } /* ------------------------------------------------------------------------ */ @@ -202,19 +202,19 @@ ipf_auth_soft_init(ipf_main_softc_t *softc, void *arg) KMALLOCS(softa->ipf_auth, frauth_t *, softa->ipf_auth_size * sizeof(*softa->ipf_auth)); if (softa->ipf_auth == NULL) - return(-1); + return (-1); bzero((char *)softa->ipf_auth, softa->ipf_auth_size * sizeof(*softa->ipf_auth)); KMALLOCS(softa->ipf_auth_pkts, mb_t **, softa->ipf_auth_size * sizeof(*softa->ipf_auth_pkts)); if (softa->ipf_auth_pkts == NULL) - return(-2); + return (-2); bzero((char *)softa->ipf_auth_pkts, softa->ipf_auth_size * sizeof(*softa->ipf_auth_pkts)); - return(0); + return (0); } @@ -274,7 +274,7 @@ ipf_auth_soft_fini(ipf_main_softc_t *softc, void *arg) } } - return(0); + return (0); } @@ -340,7 +340,7 @@ ipf_auth_check(fr_info_t *fin, u_32_t *passp) int i; if (softa->ipf_auth_lock || !softa->ipf_auth_used) - return(NULL); + return (NULL); ip = fin->fin_ip; id = ip->ip_id; @@ -426,7 +426,7 @@ ipf_auth_check(fr_info_t *fin, u_32_t *passp) if (passp != NULL) *passp = pass; softa->ipf_auth_stats.fas_hits++; - return(fr); + return (fr); } i++; if (i == softa->ipf_auth_size) @@ -434,7 +434,7 @@ ipf_auth_check(fr_info_t *fin, u_32_t *passp) } RWLOCK_EXIT(&softa->ipf_authlk); softa->ipf_auth_stats.fas_miss++; - return(NULL); + return (NULL); } @@ -463,14 +463,14 @@ ipf_auth_new(mb_t *m, fr_info_t *fin) int i; if (softa->ipf_auth_lock) - return(0); + return (0); WRITE_ENTER(&softa->ipf_authlk); if (((softa->ipf_auth_end + 1) % softa->ipf_auth_size) == softa->ipf_auth_start) { softa->ipf_auth_stats.fas_nospace++; RWLOCK_EXIT(&softa->ipf_authlk); - return(0); + return (0); } softa->ipf_auth_stats.fas_added++; @@ -522,7 +522,7 @@ ipf_auth_new(mb_t *m, fr_info_t *fin) RWLOCK_EXIT(&softa->ipf_authlk); WAKEUP(&softa->ipf_auth_next, 0); #endif - return(1); + return (1); } @@ -625,7 +625,7 @@ ipf_auth_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, error = EINVAL; break; } - return(error); + return (error); } @@ -717,7 +717,7 @@ ipf_auth_precmd(ipf_main_softc_t *softc, ioctlcmd_t cmd, frentry_t *fr, if ((cmd != SIOCADAFR) && (cmd != SIOCRMAFR)) { IPFERROR(10006); - return(EIO); + return (EIO); } for (faep = &softa->ipf_auth_entries; ((fae = *faep) != NULL); ) { @@ -773,7 +773,7 @@ ipf_auth_precmd(ipf_main_softc_t *softc, ioctlcmd_t cmd, frentry_t *fr, IPFERROR(10010); error = EINVAL; } - return(error); + return (error); } @@ -797,7 +797,7 @@ ipf_auth_flush(void *arg) mb_t *m; if (softa->ipf_auth_lock) - return(-1); + return (-1); num_flushed = 0; @@ -822,7 +822,7 @@ ipf_auth_flush(void *arg) softa->ipf_auth_used = 0; softa->ipf_auth_replies = 0; - return(num_flushed); + return (num_flushed); } @@ -839,7 +839,7 @@ ipf_auth_waiting(ipf_main_softc_t *softc) { ipf_auth_softc_t *softa = softc->ipf_auth_soft; - return(softa->ipf_auth_used != 0); + return (softa->ipf_auth_used != 0); } @@ -864,12 +864,12 @@ ipf_auth_geniter(ipf_main_softc_t *softc, ipftoken_t *token, if (itp->igi_data == NULL) { IPFERROR(10011); - return(EFAULT); + return (EFAULT); } if (itp->igi_type != IPFGENITER_AUTH) { IPFERROR(10012); - return(EINVAL); + return (EINVAL); } objp->ipfo_type = IPFOBJ_FRAUTH; @@ -906,7 +906,7 @@ ipf_auth_geniter(ipf_main_softc_t *softc, ipftoken_t *token, if (next->fae_next == NULL) ipf_token_mark_complete(token); - return(error); + return (error); } @@ -975,7 +975,7 @@ ipf_auth_wait(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) ipf_auth_ioctlloop: error = ipf_inobj(softc, data, NULL, au, IPFOBJ_FRAUTH); if (error != 0) - return(error); + return (error); /* * XXX Locks are held below over calls to copyout...a better @@ -1004,7 +1004,7 @@ ipf_auth_wait(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) if (error != 0) { RWLOCK_EXIT(&softa->ipf_authlk); SPL_X(s); - return(error); + return (error); } if (auth.fra_len != 0 && auth.fra_buf != NULL) { @@ -1027,7 +1027,7 @@ ipf_auth_wait(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) if (error != 0) { RWLOCK_EXIT(&softa->ipf_authlk); SPL_X(s); - return(error); + return (error); } m = m->m_next; } @@ -1042,7 +1042,7 @@ ipf_auth_wait(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) RWLOCK_EXIT(&softa->ipf_authlk); SPL_X(s); - return(0); + return (0); } RWLOCK_EXIT(&softa->ipf_authlk); SPL_X(s); @@ -1062,7 +1062,7 @@ ipf_auth_wait(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) MUTEX_EXIT(&softa->ipf_auth_mx); if (error == 0) goto ipf_auth_ioctlloop; - return(error); + return (error); } @@ -1087,7 +1087,7 @@ ipf_auth_reply(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) error = ipf_inobj(softc, data, NULL, &auth, IPFOBJ_FRAUTH); if (error != 0) - return(error); + return (error); SPL_NET(s); WRITE_ENTER(&softa->ipf_authlk); @@ -1105,13 +1105,13 @@ ipf_auth_reply(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) RWLOCK_EXIT(&softa->ipf_authlk); SPL_X(s); IPFERROR(10015); - return(ESRCH); + return (ESRCH); } if (fra->fra_info.fin_id != au->fra_info.fin_id) { RWLOCK_EXIT(&softa->ipf_authlk); SPL_X(s); IPFERROR(10019); - return(ESRCH); + return (ESRCH); } m = softa->ipf_auth_pkts[i]; @@ -1183,7 +1183,7 @@ ipf_auth_reply(ipf_main_softc_t *softc, ipf_auth_softc_t *softa, char *data) #endif /* _KERNEL */ SPL_X(s); - return(0); + return (0); } @@ -1193,9 +1193,9 @@ ipf_auth_pre_scanlist(ipf_main_softc_t *softc, fr_info_t *fin, u_32_t pass) ipf_auth_softc_t *softa = softc->ipf_auth_soft; if (softa->ipf_auth_ip != NULL) - return(ipf_scanlist(fin, softc->ipf_pass)); + return (ipf_scanlist(fin, softc->ipf_pass)); - return(pass); + return (pass); } @@ -1204,5 +1204,5 @@ ipf_auth_rulehead(ipf_main_softc_t *softc) { ipf_auth_softc_t *softa = softc->ipf_auth_soft; - return(&softa->ipf_auth_ip); + return (&softa->ipf_auth_ip); } diff --git a/sys/netpfil/ipfilter/netinet/ip_dns_pxy.c b/sys/netpfil/ipfilter/netinet/ip_dns_pxy.c index 722915bf4d9c..1a2f086d48ca 100644 --- a/sys/netpfil/ipfilter/netinet/ip_dns_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_dns_pxy.c @@ -64,12 +64,12 @@ ipf_p_dns_soft_create(ipf_main_softc_t *softc) KMALLOC(softd, ipf_dns_softc_t *); if (softd == NULL) - return(NULL); + return (NULL); bzero((char *)softd, sizeof(*softd)); RWLOCK_INIT(&softd->ipf_p_dns_rwlock, "ipf dns rwlock"); - return(softd); + return (softd); } @@ -162,7 +162,7 @@ ipf_p_dns_ctl(ipf_main_softc_t *softc, void *arg, ap_ctl_t *ctl) tmp = NULL; } - return(error); + return (error); } @@ -174,21 +174,21 @@ ipf_p_dns_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int dlen; if (fin->fin_v != 4) - return(-1); + return (-1); dlen = fin->fin_dlen - sizeof(udphdr_t); if (dlen < sizeof(ipf_dns_hdr_t)) { /* * No real DNS packet is smaller than that. */ - return(-1); + return (-1); } aps->aps_psiz = sizeof(dnsinfo_t); KMALLOCS(di, dnsinfo_t *, sizeof(dnsinfo_t)); if (di == NULL) { printf("ipf_dns_new:KMALLOCS(%d) failed\n", sizeof(*di)); - return(-1); + return (-1); } MUTEX_INIT(&di->dnsi_lock, "dns lock"); @@ -199,7 +199,7 @@ ipf_p_dns_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) COPYDATA(fin->fin_m, fin->fin_hlen + sizeof(udphdr_t), MIN(dlen, sizeof(di->dnsi_buffer)), di->dnsi_buffer); di->dnsi_id = (di->dnsi_buffer[0] << 8) | di->dnsi_buffer[1]; - return(0); + return (0); } @@ -231,10 +231,10 @@ ipf_p_dns_match_names(ipf_dns_filter_t *idns, char *query, int qlen) base = idns->idns_name; if (blen > qlen) - return(1); + return (1); if (blen == qlen) - return(strncasecmp(base, query, qlen)); + return (strncasecmp(base, query, qlen)); /* * If the base string string is shorter than the query, allow the @@ -248,9 +248,9 @@ ipf_p_dns_match_names(ipf_dns_filter_t *idns, char *query, int qlen) base++; blen--; } else if (*base != '.') - return(1); + return (1); - return(strncasecmp(base, query + qlen - blen, blen)); + return (strncasecmp(base, query + qlen - blen, blen)); } @@ -270,15 +270,15 @@ ipf_p_dns_get_name(ipf_dns_softc_t *softd, char *start, int len, clen = *s; if ((clen & 0xc0) == 0xc0) { /* Doesn't do compression */ softd->ipf_p_dns_compress++; - return(0); + return (0); } if (clen > slen) { softd->ipf_p_dns_toolong++; - return(0); /* Does the name run off the end? */ + return (0); /* Does the name run off the end? */ } if ((clen + 1) > blen) { softd->ipf_p_dns_nospace++; - return(0); /* Enough room for name+.? */ + return (0); /* Enough room for name+.? */ } s++; bcopy(s, t, clen); @@ -290,7 +290,7 @@ ipf_p_dns_get_name(ipf_dns_softc_t *softd, char *start, int len, } *(t - 1) = '\0'; - return(s - start); + return (s - start); } @@ -304,8 +304,8 @@ ipf_p_dns_allow_query(ipf_dns_softc_t *softd, dnsinfo_t *dnsi) for (idns = softd->ipf_p_dns_list; idns != NULL; idns = idns->idns_next) if (ipf_p_dns_match_names(idns, dnsi->dnsi_buffer, len) == 0) - return(idns->idns_pass); - return(0); + return (idns->idns_pass); + return (0); } @@ -320,7 +320,7 @@ ipf_p_dns_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int dlen, q, rc = 0; if (fin->fin_dlen < sizeof(*dns)) - return(APR_ERR(1)); + return (APR_ERR(1)); dns = (ipf_dns_hdr_t *)((char *)fin->fin_dp + sizeof(udphdr_t)); @@ -352,7 +352,7 @@ ipf_p_dns_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) MUTEX_EXIT(&di->dnsi_lock); RWLOCK_EXIT(&softd->ipf_p_dns_rwlock); - return(APR_ERR(rc)); + return (APR_ERR(rc)); } @@ -364,10 +364,10 @@ ipf_p_dns_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat) ipf_dns_hdr_t *dnh; if ((fin->fin_dlen < sizeof(u_short)) || (fin->fin_flx & FI_FRAG)) -( return(-1); +( return (-1); dnh = (ipf_dns_hdr_t *)((char *)fin->fin_dp + sizeof(udphdr_t)); if (((dnh->dns_id[0] << 8) | dnh->dns_id[1]) != di->dnsi_id) - return(-1); - return(0); + return (-1); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/ip_dstlist.c b/sys/netpfil/ipfilter/netinet/ip_dstlist.c index c928749a206f..9c7cc098a52f 100644 --- a/sys/netpfil/ipfilter/netinet/ip_dstlist.c +++ b/sys/netpfil/ipfilter/netinet/ip_dstlist.c @@ -150,14 +150,14 @@ ipf_dstlist_soft_create(ipf_main_softc_t *softc) KMALLOC(softd, ipf_dstl_softc_t *); if (softd == NULL) { IPFERROR(120028); - return(NULL); + return (NULL); } bzero((char *)softd, sizeof(*softd)); for (i = 0; i <= IPL_LOGMAX; i++) softd->tails[i] = &softd->dstlist[i]; - return(softd); + return (softd); } @@ -190,7 +190,7 @@ ipf_dstlist_soft_destroy(ipf_main_softc_t *softc, void *arg) static int ipf_dstlist_soft_init(ipf_main_softc_t *softc, void *arg) { - return(0); + return (0); } @@ -239,7 +239,7 @@ static int ipf_dstlist_addr_find(ipf_main_softc_t *softc, void *arg1, int arg2, void *arg3, u_int arg4) { - return(-1); + return (-1); } @@ -276,7 +276,7 @@ ipf_dstlist_flush(ipf_main_softc_t *softc, void *arg, iplookupflush_t *fop) n++; } } - return(n); + return (n); } @@ -299,12 +299,12 @@ ipf_dstlist_iter_deref(ipf_main_softc_t *softc, void *arg, int otype, { if (data == NULL) { IPFERROR(120001); - return(EINVAL); + return (EINVAL); } if (unit < -1 || unit > IPL_LOGMAX) { IPFERROR(120002); - return(EINVAL); + return (EINVAL); } switch (otype) @@ -318,7 +318,7 @@ ipf_dstlist_iter_deref(ipf_main_softc_t *softc, void *arg, int otype, break; } - return(0); + return (0); } @@ -406,7 +406,7 @@ ipf_dstlist_iter_next(ipf_main_softc_t *softc, void *arg, } if (err != 0) - return(err); + return (err); switch (iter->ili_otype) { @@ -434,7 +434,7 @@ ipf_dstlist_iter_next(ipf_main_softc_t *softc, void *arg, if (hint == NULL) ipf_token_mark_complete(token); - return(err); + return (err); } @@ -469,19 +469,19 @@ ipf_dstlist_node_add(ipf_main_softc_t *softc, void *arg, if (op->iplo_size < sizeof(frdest_t)) { IPFERROR(120007); - return(EINVAL); + return (EINVAL); } err = COPYIN(op->iplo_struct, &dest, sizeof(dest)); if (err != 0) { IPFERROR(120009); - return(EFAULT); + return (EFAULT); } d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); if (d == NULL) { IPFERROR(120010); - return(ESRCH); + return (ESRCH); } switch (dest.fd_addr.adf_family) @@ -491,19 +491,19 @@ ipf_dstlist_node_add(ipf_main_softc_t *softc, void *arg, break; default : IPFERROR(120019); - return(EINVAL); + return (EINVAL); } if (dest.fd_name < -1 || dest.fd_name > 128) { IPFERROR(120018); - return(EINVAL); + return (EINVAL); } KMALLOCS(node, ipf_dstnode_t *, sizeof(*node) + dest.fd_name); if (node == NULL) { softd->stats.ipls_nomem++; IPFERROR(120008); - return(ENOMEM); + return (ENOMEM); } bzero((char *)node, sizeof(*node) + dest.fd_name); @@ -521,7 +521,7 @@ ipf_dstlist_node_add(ipf_main_softc_t *softc, void *arg, if (err != 0) { IPFERROR(120017); KFREES(node, node->ipfd_size); - return(EFAULT); + return (EFAULT); } node->ipfd_dest.fd_name = 0; } else { @@ -535,7 +535,7 @@ ipf_dstlist_node_add(ipf_main_softc_t *softc, void *arg, softd->stats.ipls_nomem++; IPFERROR(120022); KFREES(node, node->ipfd_size); - return(ENOMEM); + return (ENOMEM); } if (d->ipld_dests != NULL) { bcopy(d->ipld_dests, nodes, @@ -571,7 +571,7 @@ ipf_dstlist_node_add(ipf_main_softc_t *softc, void *arg, softd->stats.ipls_numnodes++; - return(0); + return (0); } @@ -597,7 +597,7 @@ ipf_dstlist_node_deref(void *arg, ipf_dstnode_t *node) MUTEX_EXIT(&node->ipfd_lock); if (ref > 0) - return(0); + return (0); if ((node->ipfd_flags & IPDST_DELETE) != 0) softd->stats.ipls_numderefnodes--; @@ -605,7 +605,7 @@ ipf_dstlist_node_deref(void *arg, ipf_dstnode_t *node) KFREES(node, node->ipfd_size); softd->stats.ipls_numnodes--; - return(0); + return (0); } @@ -635,13 +635,13 @@ ipf_dstlist_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); if (d == NULL) { IPFERROR(120012); - return(ESRCH); + return (ESRCH); } err = COPYIN(op->iplo_struct, &frd, sizeof(frd)); if (err != 0) { IPFERROR(120011); - return(EFAULT); + return (EFAULT); } size = sizeof(*temp) + frd.fd_name; @@ -649,14 +649,14 @@ ipf_dstlist_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, if (temp == NULL) { softd->stats.ipls_nomem++; IPFERROR(120026); - return(ENOMEM); + return (ENOMEM); } err = COPYIN(op->iplo_struct, temp, size); if (err != 0) { IPFERROR(120027); KFREES(temp, size); - return(EFAULT); + return (EFAULT); } MUTEX_ENTER(&d->ipld_lock); @@ -670,13 +670,13 @@ ipf_dstlist_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, ipf_dstlist_node_free(softd, d, node); MUTEX_EXIT(&d->ipld_lock); KFREES(temp, size); - return(0); + return (0); } } MUTEX_EXIT(&d->ipld_lock); KFREES(temp, size); - return(ESRCH); + return (ESRCH); } @@ -748,7 +748,7 @@ ipf_dstlist_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) if (op->iplo_size != sizeof(ipf_dstl_stat_t)) { IPFERROR(120023); - return(EINVAL); + return (EINVAL); } stats = softd->stats; @@ -774,10 +774,10 @@ ipf_dstlist_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) err = COPYOUT(&stats, op->iplo_struct, sizeof(stats)); if (err != 0) { IPFERROR(120025); - return(EFAULT); + return (EFAULT); } } - return(0); + return (0); } @@ -802,20 +802,20 @@ ipf_dstlist_table_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); if (d != NULL) { IPFERROR(120013); - return(EEXIST); + return (EEXIST); } err = COPYIN(op->iplo_struct, &user, sizeof(user)); if (err != 0) { IPFERROR(120021); - return(EFAULT); + return (EFAULT); } KMALLOC(new, ippool_dst_t *); if (new == NULL) { softd->stats.ipls_nomem++; IPFERROR(120014); - return(ENOMEM); + return (ENOMEM); } bzero((char *)new, sizeof(*new)); @@ -833,7 +833,7 @@ ipf_dstlist_table_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) softd->tails[unit + 1] = &new->ipld_next; softd->stats.ipls_numlists++; - return(0); + return (0); } @@ -855,17 +855,17 @@ ipf_dstlist_table_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); if (d == NULL) { IPFERROR(120015); - return(ESRCH); + return (ESRCH); } if (d->ipld_dests != NULL) { IPFERROR(120016); - return(EBUSY); + return (EBUSY); } ipf_dstlist_table_remove(softc, arg, d); - return(0); + return (0); } @@ -953,11 +953,11 @@ ipf_dstlist_table_deref(ipf_main_softc_t *softc, void *arg, void *table) d->ipld_ref--; if (d->ipld_ref > 0) - return(d->ipld_ref); + return (d->ipld_ref); ipf_dstlist_table_free(arg, d); - return(0); + return (0); } @@ -1002,11 +1002,11 @@ ipf_dstlist_table_find(void *arg, int unit, char *name) for (d = softd->dstlist[unit + 1]; d != NULL; d = d->ipld_next) { if ((d->ipld_unit == unit) && !strncmp(d->ipld_name, name, FR_GROUPLEN)) { - return(d); + return (d); } } - return(NULL); + return (NULL); } @@ -1032,7 +1032,7 @@ ipf_dstlist_select_ref(void *arg, int unit, char *name) d->ipld_ref++; MUTEX_EXIT(&d->ipld_lock); } - return(d); + return (d); } @@ -1073,7 +1073,7 @@ ipf_dstlist_select(fr_info_t *fin, ippool_dst_t *d) int x; if (d == NULL || d->ipld_dests == NULL || *d->ipld_dests == NULL) - return(NULL); + return (NULL); family = fin->fin_family; @@ -1166,7 +1166,7 @@ ipf_dstlist_select(fr_info_t *fin, ippool_dst_t *d) MUTEX_EXIT(&d->ipld_lock); - return(sel); + return (sel); } @@ -1199,7 +1199,7 @@ ipf_dstlist_select_node(fr_info_t *fin, void *group, u_32_t *addr, node = ipf_dstlist_select(fin, d); if (node == NULL) { RWLOCK_EXIT(&softc->ipf_poolrw); - return(-1); + return (-1); } if (pfdp != NULL) { @@ -1225,7 +1225,7 @@ ipf_dstlist_select_node(fr_info_t *fin, void *group, u_32_t *addr, RWLOCK_EXIT(&softc->ipf_poolrw); - return(0); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index ffd573e8417e..986cca30c94d 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -137,7 +137,7 @@ ipf_check_wrapper(struct mbuf **mp, struct ifnet *ifp, int flags, rv = ipf_check(&V_ipfmain, ip, ip->ip_hl << 2, ifp, !!(flags & PFIL_OUT), mp); CURVNET_RESTORE(); - return(rv == 0 ? PFIL_PASS : PFIL_DROPPED); + return (rv == 0 ? PFIL_PASS : PFIL_DROPPED); } #ifdef USE_INET6 @@ -152,15 +152,15 @@ ipf_check_wrapper6(struct mbuf **mp, struct ifnet *ifp, int flags, sizeof(struct ip6_hdr), ifp, !!(flags & PFIL_OUT), mp); CURVNET_RESTORE(); - return(rv == 0 ? PFIL_PASS : PFIL_DROPPED); + return (rv == 0 ? PFIL_PASS : PFIL_DROPPED); } # endif #if defined(IPFILTER_LKM) int ipf_identify(char *s) { if (strcmp(s, "ipl") == 0) - return(1); - return(0); + return (1); + return (0); } #endif /* IPFILTER_LKM */ @@ -201,12 +201,12 @@ ipfattach(ipf_main_softc_t *softc) SPL_NET(s); if (softc->ipf_running > 0) { SPL_X(s); - return(EBUSY); + return (EBUSY); } if (ipf_init_all(softc) < 0) { SPL_X(s); - return(EIO); + return (EIO); } @@ -224,7 +224,7 @@ ipfattach(ipf_main_softc_t *softc) callout_init(&softc->ipf_slow_ch, 1); callout_reset(&softc->ipf_slow_ch, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT, ipf_timer_func, softc); - return(0); + return (0); } @@ -257,7 +257,7 @@ ipfdetach(ipf_main_softc_t *softc) SPL_X(s); - return(0); + return (0); } @@ -278,21 +278,21 @@ ipfioctl(struct cdev *dev, ioctlcmd_t cmd, caddr_t data, { V_ipfmain.ipf_interror = 130001; CURVNET_RESTORE(); - return(EPERM); + return (EPERM); } unit = GET_MINOR(dev); if ((IPL_LOGMAX < unit) || (unit < 0)) { V_ipfmain.ipf_interror = 130002; CURVNET_RESTORE(); - return(ENXIO); + return (ENXIO); } if (V_ipfmain.ipf_running <= 0) { if (unit != IPL_LOGIPF && cmd != SIOCIPFINTERROR) { V_ipfmain.ipf_interror = 130003; CURVNET_RESTORE(); - return(EIO); + return (EIO); } if (cmd != SIOCIPFGETNEXT && cmd != SIOCIPFGET && cmd != SIOCIPFSET && cmd != SIOCFRENB && @@ -300,7 +300,7 @@ ipfioctl(struct cdev *dev, ioctlcmd_t cmd, caddr_t data, cmd != SIOCIPFINTERROR) { V_ipfmain.ipf_interror = 130004; CURVNET_RESTORE(); - return(EIO); + return (EIO); } } @@ -310,12 +310,12 @@ ipfioctl(struct cdev *dev, ioctlcmd_t cmd, caddr_t data, CURVNET_RESTORE(); if (error != -1) { SPL_X(s); - return(error); + return (error); } SPL_X(s); - return(error); + return (error); } @@ -336,10 +336,10 @@ ipf_send_reset(fr_info_t *fin) tcp = fin->fin_dp; if (tcp->th_flags & TH_RST) - return(-1); /* feedback loop */ + return (-1); /* feedback loop */ if (ipf_checkl4sum(fin) == -1) - return(-1); + return (-1); tlen = fin->fin_dlen - (TCP_OFF(tcp) << 2) + ((tcp->th_flags & TH_SYN) ? 1 : 0) + @@ -356,11 +356,11 @@ ipf_send_reset(fr_info_t *fin) MGET(m, M_NOWAIT, MT_HEADER); #endif if (m == NULL) - return(-1); + return (-1); if (sizeof(*tcp2) + hlen > MLEN) { if (!(MCLGET(m, M_NOWAIT))) { FREE_MB_T(m); - return(-1); + return (-1); } } @@ -404,7 +404,7 @@ ipf_send_reset(fr_info_t *fin) ip6->ip6_dst = fin->fin_src6.in6; tcp2->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(*ip6), sizeof(*tcp2)); - return(ipf_send_ip(fin, m)); + return (ipf_send_ip(fin, m)); } #endif ip->ip_p = IPPROTO_TCP; @@ -413,7 +413,7 @@ ipf_send_reset(fr_info_t *fin) ip->ip_dst.s_addr = fin->fin_saddr; tcp2->th_sum = in_cksum(m, hlen + sizeof(*tcp2)); ip->ip_len = htons(hlen + sizeof(*tcp2)); - return(ipf_send_ip(fin, m)); + return (ipf_send_ip(fin, m)); } @@ -463,7 +463,7 @@ ipf_send_ip(fr_info_t *fin, mb_t *m) } #endif default : - return(EINVAL); + return (EINVAL); } #ifdef IPSEC_SUPPORT m->m_pkthdr.rcvif = NULL; @@ -478,7 +478,7 @@ ipf_send_ip(fr_info_t *fin, mb_t *m) fnew.fin_dp = (char *)ip + hlen; (void) ipf_makefrip(hlen, ip, &fnew); - return(ipf_fastroute(m, &m, &fnew, NULL)); + return (ipf_fastroute(m, &m, &fnew, NULL)); } @@ -497,24 +497,24 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) ip_t *ip, *ip2; if ((type < 0) || (type >= ICMP_MAXTYPE)) - return(-1); + return (-1); code = fin->fin_icode; #ifdef USE_INET6 /* See NetBSD ip_fil_netbsd.c r1.4: */ if ((code < 0) || (code >= sizeof(icmptoicmp6unreach)/sizeof(int))) - return(-1); + return (-1); #endif if (ipf_checkl4sum(fin) == -1) - return(-1); + return (-1); #ifdef MGETHDR MGETHDR(m, M_NOWAIT, MT_HEADER); #else MGET(m, M_NOWAIT, MT_HEADER); #endif if (m == NULL) - return(-1); + return (-1); avail = MHLEN; xtra = 0; @@ -533,14 +533,14 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) break; default : FREE_MB_T(m); - return(0); + return (0); } if (dst == 0) { if (ipf_ifpaddr(&V_ipfmain, 4, FRI_NORMAL, ifp, &dst6, NULL) == -1) { FREE_MB_T(m); - return(-1); + return (-1); } dst4 = dst6.in4; } else @@ -567,7 +567,7 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) if (iclen + max_linkhdr + fin->fin_plen > avail) { if (!(MCLGET(m, M_NOWAIT))) { FREE_MB_T(m); - return(-1); + return (-1); } avail = MCLBYTES; } @@ -577,7 +577,7 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) if (ipf_ifpaddr(&V_ipfmain, 6, FRI_NORMAL, ifp, &dst6, NULL) == -1) { FREE_MB_T(m); - return(-1); + return (-1); } } else dst6 = fin->fin_dst6; @@ -585,13 +585,13 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) #endif else { FREE_MB_T(m); - return(-1); + return (-1); } avail -= (max_linkhdr + iclen); if (avail < 0) { FREE_MB_T(m); - return(-1); + return (-1); } if (xtra > avail) xtra = avail; @@ -653,7 +653,7 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) ip->ip_p = IPPROTO_ICMP; } err = ipf_send_ip(fin, m); - return(err); + return (err); } @@ -711,7 +711,7 @@ ipf_fastroute(mb_t *m0, mb_t **mpp, fr_info_t *fin, frdest_t *fdp) * currently "to " and "to :ip#" are not supported * for IPv6 */ - return(ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL)); + return (ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL)); } #endif @@ -900,7 +900,7 @@ ipf_fastroute(mb_t *m0, mb_t **mpp, fr_info_t *fin, frdest_t *fdp) else V_ipfmain.ipf_frouteok[1]++; - return(0); + return (0); bad: if (error == EMSGSIZE) { sifp = fin->fin_ifp; @@ -925,8 +925,8 @@ ipf_verifysrc(fin) NET_EPOCH_ASSERT(); nh = fib4_lookup(RT_DEFAULT_FIB, fin->fin_src, 0, NHR_NONE, 0); if (nh == NULL) - return(0); - return(fin->fin_ifp == nh->nh_ifp); + return (0); + return (fin->fin_ifp == nh->nh_ifp); } @@ -946,7 +946,7 @@ ipf_ifpaddr(ipf_main_softc_t *softc, int v, int atype, void *ifptr, struct ifnet *ifp; if ((ifptr == NULL) || (ifptr == (void *)-1)) - return(-1); + return (-1); sin = NULL; ifp = ifptr; @@ -978,7 +978,7 @@ ipf_ifpaddr(ipf_main_softc_t *softc, int v, int atype, void *ifptr, } if (ifa == NULL || sin == NULL) - return(-1); + return (-1); mask = ifa->ifa_netmask; if (atype == FRI_BROADCAST) @@ -987,16 +987,16 @@ ipf_ifpaddr(ipf_main_softc_t *softc, int v, int atype, void *ifptr, sock = ifa->ifa_dstaddr; if (sock == NULL) - return(-1); + return (-1); #ifdef USE_INET6 if (v == 6) { - return(ipf_ifpfillv6addr(atype, (struct sockaddr_in6 *)sock, + return (ipf_ifpfillv6addr(atype, (struct sockaddr_in6 *)sock, (struct sockaddr_in6 *)mask, inp, inpmask)); } #endif - return(ipf_ifpfillv4addr(atype, (struct sockaddr_in *)sock, + return (ipf_ifpfillv4addr(atype, (struct sockaddr_in *)sock, (struct sockaddr_in *)mask, &inp->in4, &inpmask->in4)); } @@ -1008,7 +1008,7 @@ ipf_newisn(fin) { u_32_t newiss; newiss = arc4random(); - return(newiss); + return (newiss); } @@ -1022,13 +1022,13 @@ ipf_checkv4sum(fr_info_t *fin) mb_t *m; if ((fin->fin_flx & FI_NOCKSUM) != 0) - return(0); + return (0); if ((fin->fin_flx & FI_SHORT) != 0) - return(1); + return (1); if (fin->fin_cksum != FI_CK_NEEDED) - return(fin->fin_cksum > FI_CK_NEEDED) ? 0 : -1; + return (fin->fin_cksum > FI_CK_NEEDED) ? 0 : -1; m = fin->fin_m; if (m == NULL) { @@ -1042,7 +1042,7 @@ ipf_checkv4sum(fr_info_t *fin) fin->fin_cksum = FI_CK_BAD; fin->fin_flx |= FI_BAD; DT2(ipf_fi_bad_checkv4sum_csum_ip_checked, fr_info_t *, fin, u_int, m->m_pkthdr.csum_flags & (CSUM_IP_CHECKED|CSUM_IP_VALID)); - return(-1); + return (-1); } if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { /* Depending on the driver, UDP may have zero checksum */ @@ -1057,7 +1057,7 @@ ipf_checkv4sum(fr_info_t *fin) * consistent across all drivers) */ fin->fin_cksum = 1; - return(0); + return (0); } } @@ -1074,19 +1074,19 @@ ipf_checkv4sum(fr_info_t *fin) DT2(ipf_fi_bad_checkv4sum_sum, fr_info_t *, fin, u_int, sum); } else { fin->fin_cksum = FI_CK_SUMOK; - return(0); + return (0); } } else { if (m->m_pkthdr.csum_flags == CSUM_DELAY_DATA) { fin->fin_cksum = FI_CK_L4FULL; - return(0); + return (0); } else if (m->m_pkthdr.csum_flags == CSUM_TCP || m->m_pkthdr.csum_flags == CSUM_UDP) { fin->fin_cksum = FI_CK_L4PART; - return(0); + return (0); } else if (m->m_pkthdr.csum_flags == CSUM_IP) { fin->fin_cksum = FI_CK_L4PART; - return(0); + return (0); } else { manual = 1; } @@ -1096,17 +1096,17 @@ ipf_checkv4sum(fr_info_t *fin) if (ipf_checkl4sum(fin) == -1) { fin->fin_flx |= FI_BAD; DT2(ipf_fi_bad_checkv4sum_manual, fr_info_t *, fin, u_int, manual); - return(-1); + return (-1); } } #else if (ipf_checkl4sum(fin) == -1) { fin->fin_flx |= FI_BAD; DT2(ipf_fi_bad_checkv4sum_checkl4sum, fr_info_t *, fin, u_int, -1); - return(-1); + return (-1); } #endif - return(0); + return (0); } @@ -1116,25 +1116,25 @@ ipf_checkv6sum(fr_info_t *fin) { if ((fin->fin_flx & FI_NOCKSUM) != 0) { DT(ipf_checkv6sum_fi_nocksum); - return(0); + return (0); } if ((fin->fin_flx & FI_SHORT) != 0) { DT(ipf_checkv6sum_fi_short); - return(1); + return (1); } if (fin->fin_cksum != FI_CK_NEEDED) { DT(ipf_checkv6sum_fi_ck_needed); - return(fin->fin_cksum > FI_CK_NEEDED) ? 0 : -1; + return (fin->fin_cksum > FI_CK_NEEDED) ? 0 : -1; } if (ipf_checkl4sum(fin) == -1) { fin->fin_flx |= FI_BAD; DT2(ipf_fi_bad_checkv6sum_checkl4sum, fr_info_t *, fin, u_int, -1); - return(-1); + return (-1); } - return(0); + return (0); } #endif /* USE_INET6 */ @@ -1152,7 +1152,7 @@ mbufchainlen(struct mbuf *m0) for (m = m0, len = 0; m != NULL; m = m->m_next) len += m->m_len; } - return(len); + return (len); } @@ -1181,11 +1181,11 @@ ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) char *ip; if (m == NULL) - return(NULL); + return (NULL); ip = (char *)fin->fin_ip; if ((fin->fin_flx & FI_COALESCE) != 0) - return(ip); + return (ip); ipoff = fin->fin_ipoff; if (fin->fin_dp != NULL) @@ -1244,7 +1244,7 @@ ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) *fin->fin_mp = NULL; fin->fin_m = NULL; - return(NULL); + return (NULL); } if (n == NULL) @@ -1267,7 +1267,7 @@ ipf_pullup(mb_t *xmin, fr_info_t *fin, int len) if (len == fin->fin_plen) fin->fin_flx |= FI_COALESCE; - return(ip); + return (ip); } @@ -1287,7 +1287,7 @@ ipf_inject(fr_info_t *fin, mb_t *m) } NET_EPOCH_EXIT(et); - return(error); + return (error); } VNET_DEFINE_STATIC(pfil_hook_t, ipf_inet_hook); @@ -1303,7 +1303,7 @@ int ipf_pfil_unhook(void) { pfil_remove_hook(V_ipf_inet6_hook); #endif - return(0); + return (0); } int ipf_pfil_hook(void) { @@ -1346,7 +1346,7 @@ int ipf_pfil_hook(void) { else error = 0; - return(error); + return (error); } void @@ -1384,7 +1384,7 @@ ipf_event_dereg(void) u_32_t ipf_random(void) { - return(arc4random()); + return (arc4random()); } @@ -1410,7 +1410,7 @@ ipf_pcksum(fr_info_t *fin, int hlen, u_int sum) while (sum > 0xffff) sum = (sum & 0xffff) + (sum >> 16); sum2 = ~sum & 0xffff; - return(sum2); + return (sum2); } #ifdef USE_INET6 @@ -1421,11 +1421,11 @@ ipf_pcksum6(struct mbuf *m, ip6_t *ip6, u_int32_t off, u_int32_t len) int sum; if (m->m_len < sizeof(struct ip6_hdr)) { - return(0xffff); + return (0xffff); } sum = in6_cksum(m, ip6->ip6_nxt, off, len); - return(sum); + return (sum); #else u_short *sp; u_int sum; @@ -1447,7 +1447,7 @@ ipf_pcksum6(struct mbuf *m, ip6_t *ip6, u_int32_t off, u_int32_t len) sum += *sp++; sum += *sp++; sum += *sp++; - return(ipf_pcksum(fin, off, sum)); + return (ipf_pcksum(fin, off, sum)); #endif } #endif diff --git a/sys/netpfil/ipfilter/netinet/ip_frag.c b/sys/netpfil/ipfilter/netinet/ip_frag.c index 73725d9c64d9..145e451279c6 100644 --- a/sys/netpfil/ipfilter/netinet/ip_frag.c +++ b/sys/netpfil/ipfilter/netinet/ip_frag.c @@ -135,7 +135,7 @@ ipf_frag_main_load(void) ipfr_block.fr_flags = FR_BLOCK|FR_QUICK; ipfr_block.fr_ref = 1; - return(0); + return (0); } @@ -150,7 +150,7 @@ ipf_frag_main_load(void) int ipf_frag_main_unload(void) { - return(0); + return (0); } @@ -169,7 +169,7 @@ ipf_frag_soft_create(ipf_main_softc_t *softc) KMALLOC(softf, ipf_frag_softc_t *); if (softf == NULL) - return(NULL); + return (NULL); bzero((char *)softf, sizeof(*softf)); @@ -182,11 +182,11 @@ ipf_frag_soft_create(ipf_main_softc_t *softc) ipf_frag_tuneables); if (softf->ipf_frag_tune == NULL) { ipf_frag_soft_destroy(softc, softf); - return(NULL); + return (NULL); } if (ipf_tune_array_link(softc, softf->ipf_frag_tune) == -1) { ipf_frag_soft_destroy(softc, softf); - return(NULL); + return (NULL); } softf->ipfr_size = IPFT_SIZE; @@ -196,7 +196,7 @@ ipf_frag_soft_create(ipf_main_softc_t *softc) softf->ipfr_nattail = &softf->ipfr_natlist; softf->ipfr_ipidtail = &softf->ipfr_ipidlist; - return(softf); + return (softf); } @@ -244,21 +244,21 @@ ipf_frag_soft_init(ipf_main_softc_t *softc, void *arg) KMALLOCS(softf->ipfr_heads, ipfr_t **, softf->ipfr_size * sizeof(ipfr_t *)); if (softf->ipfr_heads == NULL) - return(-1); + return (-1); bzero((char *)softf->ipfr_heads, softf->ipfr_size * sizeof(ipfr_t *)); KMALLOCS(softf->ipfr_nattab, ipfr_t **, softf->ipfr_size * sizeof(ipfr_t *)); if (softf->ipfr_nattab == NULL) - return(-2); + return (-2); bzero((char *)softf->ipfr_nattab, softf->ipfr_size * sizeof(ipfr_t *)); KMALLOCS(softf->ipfr_ipidtab, ipfr_t **, softf->ipfr_size * sizeof(ipfr_t *)); if (softf->ipfr_ipidtab == NULL) - return(-3); + return (-3); bzero((char *)softf->ipfr_ipidtab, softf->ipfr_size * sizeof(ipfr_t *)); @@ -266,7 +266,7 @@ ipf_frag_soft_init(ipf_main_softc_t *softc, void *arg) softf->ipfr_lock = 0; softf->ipfr_inited = 1; - return(0); + return (0); } @@ -306,7 +306,7 @@ ipf_frag_soft_fini(ipf_main_softc_t *softc, void *arg) softf->ipfr_size * sizeof(ipfr_t *)); softf->ipfr_ipidtab = NULL; - return(0); + return (0); } @@ -341,7 +341,7 @@ ipf_frag_stats(void *arg) softf->ipfr_stats.ifs_table = softf->ipfr_heads; softf->ipfr_stats.ifs_nattab = softf->ipfr_nattab; - return(&softf->ipfr_stats); + return (&softf->ipfr_stats); } @@ -372,18 +372,18 @@ ipfr_frag_new(ipf_main_softc_t *softc, ipf_frag_softc_t *softf, if (softf->ipfr_stats.ifs_inuse >= softf->ipfr_size) { FBUMPD(ifs_maximum); - return(NULL); + return (NULL); } if ((fin->fin_flx & (FI_FRAG|FI_BAD)) != FI_FRAG) { FBUMPD(ifs_newbad); - return(NULL); + return (NULL); } if (pass & FR_FRSTRICT) { if (fin->fin_off != 0) { FBUMPD(ifs_newrestrictnot0); - return(NULL); + return (NULL); } } @@ -434,7 +434,7 @@ ipfr_frag_new(ipf_main_softc_t *softc, ipf_frag_softc_t *softf, KMALLOC(fran, ipfr_t *); if (fran == NULL) { FBUMPD(ifs_nomem); - return(NULL); + return (NULL); } memset(fran, 0, sizeof(*fran)); @@ -449,7 +449,7 @@ ipfr_frag_new(ipf_main_softc_t *softc, ipf_frag_softc_t *softf, RWLOCK_EXIT(lock); FBUMPD(ifs_exists); KFREE(fran); - return(NULL); + return (NULL); } fra = fran; @@ -490,7 +490,7 @@ ipfr_frag_new(ipf_main_softc_t *softc, ipf_frag_softc_t *softf, fra->ipfr_bytes = fin->fin_plen; FBUMP(ifs_inuse); FBUMP(ifs_new); - return(fra); + return (fra); } @@ -508,7 +508,7 @@ ipf_frag_new(ipf_main_softc_t *softc, fr_info_t *fin, u_32_t pass) ipfr_t *fra; if (softf->ipfr_lock != 0) - return(-1); + return (-1); #ifdef USE_MUTEXES fra = ipfr_frag_new(softc, softf, fin, pass, softf->ipfr_heads, &softc->ipf_frag); @@ -522,7 +522,7 @@ ipf_frag_new(ipf_main_softc_t *softc, fr_info_t *fin, u_32_t pass) fra->ipfr_next = NULL; RWLOCK_EXIT(&softc->ipf_frag); } - return(fra ? 0 : -1); + return (fra ? 0 : -1); } @@ -543,7 +543,7 @@ ipf_frag_natnew(ipf_main_softc_t *softc, fr_info_t *fin, u_32_t pass, ipfr_t *fra; if (softf->ipfr_lock != 0) - return(0); + return (0); #ifdef USE_MUTEXES fra = ipfr_frag_new(softc, softf, fin, pass, softf->ipfr_nattab, @@ -559,9 +559,9 @@ ipf_frag_natnew(ipf_main_softc_t *softc, fr_info_t *fin, u_32_t pass, softf->ipfr_nattail = &fra->ipfr_next; fra->ipfr_next = NULL; RWLOCK_EXIT(&softf->ipfr_natfrag); - return(0); + return (0); } - return(-1); + return (-1); } @@ -582,7 +582,7 @@ ipf_frag_ipidnew(fr_info_t *fin, u_32_t ipid) ipfr_t *fra; if (softf->ipfr_lock) - return(0); + return (0); #ifdef USE_MUTEXES fra = ipfr_frag_new(softc, softf, fin, 0, softf->ipfr_ipidtab, &softf->ipfr_ipidfrag); @@ -597,7 +597,7 @@ ipf_frag_ipidnew(fr_info_t *fin, u_32_t ipid) fra->ipfr_next = NULL; RWLOCK_EXIT(&softf->ipfr_ipidfrag); } - return(fra ? 0 : -1); + return (fra ? 0 : -1); } @@ -635,12 +635,12 @@ ipf_frag_lookup(ipf_main_softc_t *softc, ipf_frag_softc_t *softf, */ if (fin->fin_flx & FI_SHORT) { FBUMPD(ifs_short); - return(NULL); + return (NULL); } if ((fin->fin_flx & FI_BAD) != 0) { FBUMPD(ifs_bad); - return(NULL); + return (NULL); } /* @@ -763,13 +763,13 @@ ipf_frag_lookup(ipf_main_softc_t *softc, ipf_frag_softc_t *softf, f->ipfr_pkts++; f->ipfr_bytes += fin->fin_plen; FBUMP(ifs_hits); - return(f); + return (f); } } RWLOCK_EXIT(lock); FBUMP(ifs_miss); - return(NULL); + return (NULL); } @@ -790,7 +790,7 @@ ipf_frag_natknown(fr_info_t *fin) ipfr_t *ipf; if ((softf->ipfr_lock) || !softf->ipfr_natlist) - return(NULL); + return (NULL); #ifdef USE_MUTEXES ipf = ipf_frag_lookup(softc, softf, fin, softf->ipfr_nattab, &softf->ipfr_natfrag); @@ -809,7 +809,7 @@ ipf_frag_natknown(fr_info_t *fin) RWLOCK_EXIT(&softf->ipfr_natfrag); } else nat = NULL; - return(nat); + return (nat); } @@ -830,7 +830,7 @@ ipf_frag_ipidknown(fr_info_t *fin) u_32_t id; if (softf->ipfr_lock || !softf->ipfr_ipidlist) - return(0xffffffff); + return (0xffffffff); #ifdef USE_MUTEXES ipf = ipf_frag_lookup(softc, softf, fin, softf->ipfr_ipidtab, @@ -843,7 +843,7 @@ ipf_frag_ipidknown(fr_info_t *fin) RWLOCK_EXIT(&softf->ipfr_ipidfrag); } else id = 0xffffffff; - return(id); + return (id); } @@ -868,7 +868,7 @@ ipf_frag_known(fr_info_t *fin, u_32_t *passp) u_32_t pass; if ((softf->ipfr_lock) || (softf->ipfr_list == NULL)) - return(NULL); + return (NULL); #ifdef USE_MUTEXES fra = ipf_frag_lookup(softc, softf, fin, softf->ipfr_heads, @@ -903,7 +903,7 @@ ipf_frag_known(fr_info_t *fin, u_32_t *passp) } RWLOCK_EXIT(&softc->ipf_frag); } - return(fr); + return (fr); } @@ -1112,10 +1112,10 @@ ipf_frag_pkt_next(ipf_main_softc_t *softc, ipftoken_t *token, ipf_frag_softc_t *softf = softc->ipf_frag_soft; #ifdef USE_MUTEXES - return(ipf_frag_next(softc, token, itp, &softf->ipfr_list, + return (ipf_frag_next(softc, token, itp, &softf->ipfr_list, &softf->ipfr_frag)); #else - return(ipf_frag_next(softc, token, itp, &softf->ipfr_list)); + return (ipf_frag_next(softc, token, itp, &softf->ipfr_list)); #endif } @@ -1137,10 +1137,10 @@ ipf_frag_nat_next(ipf_main_softc_t *softc, ipftoken_t *token, ipf_frag_softc_t *softf = softc->ipf_frag_soft; #ifdef USE_MUTEXES - return(ipf_frag_next(softc, token, itp, &softf->ipfr_natlist, + return (ipf_frag_next(softc, token, itp, &softf->ipfr_natlist, &softf->ipfr_natfrag)); #else - return(ipf_frag_next(softc, token, itp, &softf->ipfr_natlist)); + return (ipf_frag_next(softc, token, itp, &softf->ipfr_natlist)); #endif } @@ -1173,12 +1173,12 @@ ipf_frag_next(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp, if (itp->igi_data == NULL) { IPFERROR(20001); - return(EFAULT); + return (EFAULT); } if (itp->igi_nitems != 1) { IPFERROR(20003); - return(EFAULT); + return (EFAULT); } frag = token->ipt_data; @@ -1214,7 +1214,7 @@ ipf_frag_next(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp, ipf_frag_deref(softc, &frag); #endif } - return(error); + return (error); } diff --git a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c index 2efd4257bb2d..b305094e9704 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c @@ -180,7 +180,7 @@ ipf_p_ftp_soft_create(ipf_main_softc_t *softc) KMALLOC(softf, ipf_ftp_softc_t *); if (softf == NULL) - return(NULL); + return (NULL); bzero((char *)softf, sizeof(*softf)); #if defined(_KERNEL) @@ -195,14 +195,14 @@ ipf_p_ftp_soft_create(ipf_main_softc_t *softc) ipf_ftp_tuneables); if (softf->ipf_p_ftp_tune == NULL) { ipf_p_ftp_soft_destroy(softc, softf); - return(NULL); + return (NULL); } if (ipf_tune_array_link(softc, softf->ipf_p_ftp_tune) == -1) { ipf_p_ftp_soft_destroy(softc, softf); - return(NULL); + return (NULL); } - return(softf); + return (softf); } @@ -229,7 +229,7 @@ ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) KMALLOC(ftp, ftpinfo_t *); if (ftp == NULL) - return(-1); + return (-1); nat = nat; /* LINT */ @@ -247,7 +247,7 @@ ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) f->ftps_wptr = f->ftps_buf; ftp->ftp_passok = FTPXY_INIT; ftp->ftp_incok = 0; - return(0); + return (0); } @@ -305,7 +305,7 @@ ipf_p_ftp_port(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_PARSE) printf("ipf_p_ftp_port:dlen(%d) < IPF_MINPORTLEN\n", dlen); - return(0); + return (0); } /* * Skip the PORT command + space @@ -319,14 +319,14 @@ ipf_p_ftp_port(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, DT2(ftp_PORT_error_atoi_1, nat_t *, nat, ftpside_t *, f); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_port:ipf_p_ftp_atoi(%d) failed\n", 1); - return(0); + return (0); } a2 = ipf_p_ftp_atoi(&s); if (s == NULL) { DT2(ftp_PORT_error_atoi_2, nat_t *, nat, ftpside_t *, f); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_port:ipf_p_ftp_atoi(%d) failed\n", 2); - return(0); + return (0); } /* @@ -343,7 +343,7 @@ ipf_p_ftp_port(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, u_int, a1); if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_port:%s != nat->nat_inip\n", "a1"); - return(APR_ERR(1)); + return (APR_ERR(1)); } a5 = ipf_p_ftp_atoi(&s); @@ -351,7 +351,7 @@ ipf_p_ftp_port(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, DT2(ftp_PORT_error_atoi_3, nat_t *, nat, ftpside_t *, f); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_port:ipf_p_ftp_atoi(%d) failed\n", 3); - return(0); + return (0); } if (*s == ')') s++; @@ -365,7 +365,7 @@ ipf_p_ftp_port(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, DT2(ftp_PORT_error_no_crlf, nat_t *, nat, ftpside_t *, f); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_port:missing %s\n", "cr-lf"); - return(0); + return (0); } s += 2; a6 = a5 & 0xff; @@ -402,7 +402,7 @@ ipf_p_ftp_port(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_port:inc(%d) + ip->ip_len > 65535\n", inc); - return(0); + return (0); } #if !defined(_KERNEL) @@ -426,7 +426,7 @@ ipf_p_ftp_port(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, } f->ftps_cmd = FTPXY_C_PORT; - return(ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, sp, inc)); + return (ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, sp, inc)); } @@ -454,7 +454,7 @@ ipf_p_ftp_addport(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_addport:xfer active %p/%p\n", ftp->ftp_pendnat, ftp->ftp_pendstate); - return(0); + return (0); } ipf_p_ftp_setpending(softc, ftp); } @@ -473,7 +473,7 @@ ipf_p_ftp_addport(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, u_int, sp); if (softf->ipf_p_ftp_debug & DEBUG_SECURITY) printf("ipf_p_ftp_addport:sp(%d) < 1024\n", sp); - return(0); + return (0); } /* * The server may not make the connection back from port 20, but @@ -489,7 +489,7 @@ ipf_p_ftp_addport(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, #ifndef USE_INET6 if (nat->nat_v[0] == 6) - return(APR_INC(inc)); + return (APR_INC(inc)); #endif /* @@ -524,14 +524,14 @@ ipf_p_ftp_addport(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, } } if (nat2 != NULL) - return(APR_INC(inc)); + return (APR_INC(inc)); /* * An existing entry doesn't exist. Let's make one. */ ipn = ipf_proxy_rule_rev(nat); if (ipn == NULL) - return(APR_ERR(1)); + return (APR_ERR(1)); ipn->in_use = 0; fi.fin_fr = &ftppxyfr; @@ -572,7 +572,7 @@ ipf_p_ftp_addport(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (nat2 == NULL) { KFREES(ipn, ipn->in_size); - return(APR_ERR(1)); + return (APR_ERR(1)); } (void) ipf_nat_proto(&fi, nat2, IPN_TCP); @@ -586,7 +586,7 @@ ipf_p_ftp_addport(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, SI_W_SPORT) != 0) ipf_nat_setpending(softc, nat2); - return(APR_INC(inc)); + return (APR_INC(inc)); } @@ -665,7 +665,7 @@ ipf_p_ftp_client(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, while ((*rptr++ != '\n') && (rptr < wptr)) ; f->ftps_rptr = rptr; - return(inc); + return (inc); } @@ -686,7 +686,7 @@ ipf_p_ftp_pasv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_pasv:ftps_cmd(%d) != FTPXY_C_PASV\n", ftp->ftp_side[0].ftps_cmd); - return(0); + return (0); } f = &ftp->ftp_side[1]; @@ -701,13 +701,13 @@ ipf_p_ftp_pasv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_pasv:dlen(%d) < IPF_MIN227LEN\n", dlen); - return(0); + return (0); } else if (strncmp(f->ftps_rptr, "227 Entering Passive Mod", PASV_REPLEN)) { DT2(ftp_PASV_error_string, nat_t *, nat, ftpinfo_t *, ftp); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_pasv:%d reply wrong\n", 227); - return(0); + return (0); } brackets[0] = ""; @@ -732,14 +732,14 @@ ipf_p_ftp_pasv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, DT2(ftp_PASV_error_atoi_1, nat_t *, nat, ftpside_t *, f); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_pasv:ipf_p_ftp_atoi(%d) failed\n", 1); - return(0); + return (0); } a2 = ipf_p_ftp_atoi(&s); if (s == NULL) { DT2(ftp_PASV_error_atoi_2, nat_t *, nat, ftpside_t *, f); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_pasv:ipf_p_ftp_atoi(%d) failed\n", 2); - return(0); + return (0); } /* @@ -757,7 +757,7 @@ ipf_p_ftp_pasv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, u_int, a1); if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_pasv:%s != nat->nat_oip\n", "a1"); - return(0); + return (0); } a5 = ipf_p_ftp_atoi(&s); @@ -765,7 +765,7 @@ ipf_p_ftp_pasv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, DT2(ftp_PASV_error_atoi_3, nat_t *, nat, ftpside_t *, f); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_pasv:ipf_p_ftp_atoi(%d) failed\n", 3); - return(0); + return (0); } if (*s == ')') @@ -781,7 +781,7 @@ ipf_p_ftp_pasv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, DT(pasv_missing_crlf); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_pasv:missing %s", "cr-lf\n"); - return(0); + return (0); } s += 2; @@ -804,7 +804,7 @@ ipf_p_ftp_pasv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, (void) snprintf(newbuf, sizeof(newbuf), "%s %s%u,%u,%u,%u,%u,%u%s\r\n", "227 Entering Passive Mode", brackets[0], a1, a2, a3, a4, a5, a6, brackets[1]); - return(ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, (a5 << 8 | a6), + return (ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, (a5 << 8 | a6), newbuf, s)); } @@ -849,12 +849,12 @@ ipf_p_ftp_pasvreply(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_pasv:inc(%d) + ip->ip_len > 65535\n", inc); - return(0); + return (0); } ipn = ipf_proxy_rule_fwd(nat); if (ipn == NULL) - return(APR_ERR(1)); + return (APR_ERR(1)); ipn->in_use = 0; /* @@ -895,7 +895,7 @@ ipf_p_ftp_pasvreply(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, if (nat2 == NULL) { KFREES(ipn, ipn->in_size); - return(APR_ERR(1)); + return (APR_ERR(1)); } (void) ipf_nat_proto(&fi, nat2, IPN_TCP); @@ -942,7 +942,7 @@ ipf_p_ftp_pasvreply(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, ip->ip_len = htons(fin->fin_plen); } - return(APR_INC(inc)); + return (APR_INC(inc)); } @@ -963,7 +963,7 @@ ipf_p_ftp_server(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (*rptr == ' ') goto server_cmd_ok; if (!ISDIGIT(*rptr) || !ISDIGIT(*(rptr + 1)) || !ISDIGIT(*(rptr + 2))) - return(0); + return (0); if (softf->ipf_p_ftp_debug & DEBUG_PARSE) printf("ipf_p_ftp_server_1: cmd[%4.4s] passok %d\n", rptr, ftp->ftp_passok); @@ -1017,7 +1017,7 @@ ipf_p_ftp_server(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, while ((*rptr++ != '\n') && (rptr < wptr)) ; f->ftps_rptr = rptr; - return(inc); + return (inc); } @@ -1041,13 +1041,13 @@ ipf_p_ftp_client_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, s = buf; if (ftps->ftps_junk == FTPXY_JUNK_BAD) - return(FTPXY_JUNK_BAD); + return (FTPXY_JUNK_BAD); if (i < 5) { DT1(client_valid, int, i); if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_client_valid:i(%d) < 5\n", (int)i); - return(2); + return (2); } i--; @@ -1085,7 +1085,7 @@ ipf_p_ftp_client_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, "ipf_p_ftp_client_valid", ftps->ftps_junk, (int)len, (int)i, c, (int)len, (int)len, buf); - return(FTPXY_JUNK_BAD); + return (FTPXY_JUNK_BAD); } for (; i; i--) { @@ -1100,14 +1100,14 @@ ipf_p_ftp_client_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, } else { ftps->ftps_cmd = 0; } - return(0); + return (0); } } #if !defined(_KERNEL) printf("ipf_p_ftp_client_valid:junk after cmd[%*.*s]\n", (int)len, (int)len, buf); #endif - return(FTPXY_JUNK_EOL); + return (FTPXY_JUNK_EOL); } @@ -1123,13 +1123,13 @@ ipf_p_ftp_server_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, cmd = 0; if (ftps->ftps_junk == FTPXY_JUNK_BAD) - return(FTPXY_JUNK_BAD); + return (FTPXY_JUNK_BAD); if (i < 5) { DT1(server_valid, int, i); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_servert_valid:i(%d) < 5\n", (int)i); - return(2); + return (2); } c = *s++; @@ -1154,7 +1154,7 @@ ipf_p_ftp_server_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, if ((c != '-') && (c != ' ')) goto bad_server_command; if (c == '-') - return(FTPXY_JUNK_CONT); + return (FTPXY_JUNK_CONT); } else goto bad_server_command; } else @@ -1168,8 +1168,8 @@ ipf_p_ftp_server_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, ftps->ftps_junk, (int)len, (int)i, c, (int)len, (int)len, buf); if (ftps->ftps_junk == FTPXY_JUNK_CONT) - return(FTPXY_JUNK_CONT); - return(FTPXY_JUNK_BAD); + return (FTPXY_JUNK_CONT); + return (FTPXY_JUNK_BAD); } search_eol: for (; i; i--) { @@ -1178,11 +1178,11 @@ ipf_p_ftp_server_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, if ((pc == '\r') && (c == '\n')) { if (cmd == -1) { if (ftps->ftps_junk == FTPXY_JUNK_CONT) - return(FTPXY_JUNK_CONT); + return (FTPXY_JUNK_CONT); } else { ftps->ftps_cmd = cmd; } - return(FTPXY_JUNK_OK); + return (FTPXY_JUNK_OK); } } @@ -1190,7 +1190,7 @@ ipf_p_ftp_server_valid(ipf_ftp_softc_t *softf, ftpside_t *ftps, char *buf, if (softf->ipf_p_ftp_debug & DEBUG_PARSE_INFO) printf("ipf_p_ftp_server_valid:junk after cmd[%*.*s]\n", (int)len, (int)len, buf); - return(FTPXY_JUNK_EOL); + return (FTPXY_JUNK_EOL); } @@ -1203,9 +1203,9 @@ ipf_p_ftp_valid(ipf_ftp_softc_t *softf, ftpinfo_t *ftp, int side, char *buf, ftps = &ftp->ftp_side[side]; if (side == 0) - return(ipf_p_ftp_client_valid(softf, ftps, buf, len)); + return (ipf_p_ftp_client_valid(softf, ftps, buf, len)); else - return(ipf_p_ftp_server_valid(softf, ftps, buf, len)); + return (ipf_p_ftp_server_valid(softf, ftps, buf, len)); } @@ -1250,9 +1250,9 @@ ipf_p_ftp_process(ipf_ftp_softc_t *softf, fr_info_t *fin, nat_t *nat, if ((mlen == 0) && ((tcp->th_flags & TH_OPENING) == TH_OPENING)) { f->ftps_seq[0] = thseq + 1; t->ftps_seq[0] = thack; - return(0); + return (0); } else if (mlen < 0) { - return(0); + return (0); } aps = nat->nat_aps; @@ -1354,7 +1354,7 @@ ipf_p_ftp_process(ipf_ftp_softc_t *softf, fr_info_t *fin, nat_t *nat, "ipf_p_ftp_process", t->ftps_seq[1], ackoff, thack); } - return(APR_ERR(1)); + return (APR_ERR(1)); } if (softf->ipf_p_ftp_debug & DEBUG_PARSE) { @@ -1372,11 +1372,11 @@ ipf_p_ftp_process(ipf_ftp_softc_t *softf, fr_info_t *fin, nat_t *nat, printf("FIN: thseq %x seqoff %d ftps_seq %x\n", thseq, seqoff, f->ftps_seq[0]); } - return(APR_ERR(1)); + return (APR_ERR(1)); } } f->ftps_len = 0; - return(0); + return (0); } ok = 0; @@ -1403,7 +1403,7 @@ ipf_p_ftp_process(ipf_ftp_softc_t *softf, fr_info_t *fin, nat_t *nat, aps->aps_seqoff[sel]); } - return(APR_ERR(1)); + return (APR_ERR(1)); } inc = 0; @@ -1496,7 +1496,7 @@ ipf_p_ftp_process(ipf_ftp_softc_t *softf, fr_info_t *fin, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("%s:cmds == 0 junk == 1\n", "ipf_p_ftp_process"); - return(APR_ERR(2)); + return (APR_ERR(2)); } retry = 0; @@ -1546,7 +1546,7 @@ ipf_p_ftp_process(ipf_ftp_softc_t *softf, fr_info_t *fin, nat_t *nat, f->ftps_rptr = rptr; f->ftps_wptr = wptr; - return(APR_INC(inc)); + return (APR_INC(inc)); } @@ -1559,13 +1559,13 @@ ipf_p_ftp_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ftp = aps->aps_data; if (ftp == NULL) - return(0); + return (0); rev = (nat->nat_dir == NAT_OUTBOUND) ? 0 : 1; if (ftp->ftp_side[1 - rev].ftps_ifp == NULL) ftp->ftp_side[1 - rev].ftps_ifp = fin->fin_ifp; - return(ipf_p_ftp_process(softf, fin, nat, ftp, rev)); + return (ipf_p_ftp_process(softf, fin, nat, ftp, rev)); } @@ -1578,13 +1578,13 @@ ipf_p_ftp_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ftp = aps->aps_data; if (ftp == NULL) - return(0); + return (0); rev = (nat->nat_dir == NAT_OUTBOUND) ? 0 : 1; if (ftp->ftp_side[rev].ftps_ifp == NULL) ftp->ftp_side[rev].ftps_ifp = fin->fin_ifp; - return(ipf_p_ftp_process(softf, fin, nat, ftp, 1 - rev)); + return (ipf_p_ftp_process(softf, fin, nat, ftp, 1 - rev)); } @@ -1606,7 +1606,7 @@ ipf_p_ftp_atoi(char **ptr) } if (c != ',') { *ptr = NULL; - return(0); + return (0); } while (((c = *s++) != '\0') && ISDIGIT(c)) { j *= 10; @@ -1615,7 +1615,7 @@ ipf_p_ftp_atoi(char **ptr) *ptr = s; i &= 0xff; j &= 0xff; - return(i << 8) | j; + return (i << 8) | j; } @@ -1633,7 +1633,7 @@ ipf_p_ftp_eprt(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_eprt:dlen(%d) < IPF_MINEPRTLEN\n", dlen); - return(0); + return (0); } /* @@ -1643,16 +1643,16 @@ ipf_p_ftp_eprt(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, */ f = &ftp->ftp_side[0]; if (f->ftps_rptr[5] != '|') - return(0); + return (0); if (f->ftps_rptr[5] == f->ftps_rptr[7]) { if (f->ftps_rptr[6] == '1' && nat->nat_v[0] == 4) - return(ipf_p_ftp_eprt4(softf, fin, ip, nat, ftp, dlen)); + return (ipf_p_ftp_eprt4(softf, fin, ip, nat, ftp, dlen)); #ifdef USE_INET6 if (f->ftps_rptr[6] == '2' && nat->nat_v[0] == 6) - return(ipf_p_ftp_eprt6(softf, fin, ip, nat, ftp, dlen)); + return (ipf_p_ftp_eprt6(softf, fin, ip, nat, ftp, dlen)); #endif } - return(0); + return (0); } @@ -1684,9 +1684,9 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, i += c - '0'; } if (i > 255) - return(0); + return (0); if (c != '.') - return(0); + return (0); addr = (i << 24); i = 0; @@ -1695,9 +1695,9 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, i += c - '0'; } if (i > 255) - return(0); + return (0); if (c != '.') - return(0); + return (0); addr |= (addr << 16); i = 0; @@ -1706,9 +1706,9 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, i += c - '0'; } if (i > 255) - return(0); + return (0); if (c != '.') - return(0); + return (0); addr |= (addr << 8); i = 0; @@ -1717,9 +1717,9 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, i += c - '0'; } if (i > 255) - return(0); + return (0); if (c != delim) - return(0); + return (0); addr |= addr; /* @@ -1731,9 +1731,9 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, i += c - '0'; } if (i > 65535) - return(0); + return (0); if (c != delim) - return(0); + return (0); port = i; /* @@ -1743,7 +1743,7 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, DT(eprt4_no_crlf); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_eprt4:missing %s\n", "cr-lf"); - return(0); + return (0); } s += 2; @@ -1776,7 +1776,7 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_eprt4:inc(%d) + ip->ip_len > 65535\n", inc); - return(0); + return (0); } off = (char *)tcp - (char *)ip + (TCP_OFF(tcp) << 2) + fin->fin_ipoff; @@ -1797,7 +1797,7 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, } f->ftps_cmd = FTPXY_C_EPRT; - return(ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, port, inc)); + return (ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, port, inc)); } @@ -1816,7 +1816,7 @@ ipf_p_ftp_epsv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_epsv:ftps_cmd(%d) != FTPXY_C_EPSV\n", ftp->ftp_side[0].ftps_cmd); - return(0); + return (0); } f = &ftp->ftp_side[1]; @@ -1825,10 +1825,10 @@ ipf_p_ftp_epsv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, * Check for EPSV reply message. */ if (dlen < IPF_MIN229LEN) { - return(0); + return (0); } else if (strncmp(f->ftps_rptr, "229 Entering Extended Passive Mode", EPSV_REPLEN)) { - return(0); + return (0); } /* @@ -1857,14 +1857,14 @@ ipf_p_ftp_epsv(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, * check for CR-LF at the end. */ if ((*s != '\r') || (*(s + 1) != '\n')) { - return(0); + return (0); } s += 2; (void) snprintf(newbuf, sizeof(newbuf), "%s (|||%u|)\r\n", "229 Entering Extended Passive Mode", ap); - return(ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, (u_int)ap, + return (ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, (u_int)ap, newbuf, s)); } @@ -1958,7 +1958,7 @@ ipf_p_ftp_eprt6(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, s--; } if (c != ':' && c != delim) - return(0); + return (0); while (*s != '|') s++; @@ -1973,9 +1973,9 @@ ipf_p_ftp_eprt6(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, i += c - '0'; } if (i > 65535) - return(0); + return (0); if (c != delim) - return(0); + return (0); port = (u_short)(i & 0xffff); /* @@ -1985,7 +1985,7 @@ ipf_p_ftp_eprt6(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, DT(eprt6_no_crlf); if (softf->ipf_p_ftp_debug & DEBUG_PARSE_ERR) printf("ipf_p_ftp_eprt6:missing %s\n", "cr-lf"); - return(0); + return (0); } s += 2; @@ -2028,7 +2028,7 @@ ipf_p_ftp_eprt6(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, if (softf->ipf_p_ftp_debug & DEBUG_ERROR) printf("ipf_p_ftp_eprt6:inc(%d) + ip->ip_len > 65535\n", inc); - return(0); + return (0); } off = (char *)tcp - (char *)ip + (TCP_OFF(tcp) << 2) + fin->fin_ipoff; @@ -2049,6 +2049,6 @@ ipf_p_ftp_eprt6(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, } f->ftps_cmd = FTPXY_C_EPRT; - return(ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, port, inc)); + return (ipf_p_ftp_addport(softf, fin, ip, nat, ftp, dlen, port, inc)); } #endif diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index b0c32bd6e930..acdd441e0476 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -141,12 +141,12 @@ ipf_htable_soft_create(ipf_main_softc_t *softc) KMALLOC(softh, ipf_htable_softc_t *); if (softh == NULL) { IPFERROR(30026); - return(NULL); + return (NULL); } bzero((char *)softh, sizeof(*softh)); - return(softh); + return (softh); } @@ -185,7 +185,7 @@ ipf_htable_soft_init(softc, arg) bzero((char *)softh, sizeof(*softh)); - return(0); + return (0); } @@ -233,7 +233,7 @@ ipf_htable_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) if (op->iplo_size != sizeof(stats)) { IPFERROR(30001); - return(EINVAL); + return (EINVAL); } stats.iphs_tables = softh->ipf_htables[op->iplo_unit + 1]; @@ -244,9 +244,9 @@ ipf_htable_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) err = COPYOUT(&stats, op->iplo_struct, sizeof(stats)); if (err != 0) { IPFERROR(30013); - return(EFAULT); + return (EFAULT); } - return(0); + return (0); } @@ -270,22 +270,22 @@ ipf_htable_create(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) if (op->iplo_size != sizeof(htab)) { IPFERROR(30024); - return(EINVAL); + return (EINVAL); } err = COPYIN(op->iplo_struct, &htab, sizeof(htab)); if (err != 0) { IPFERROR(30003); - return(EFAULT); + return (EFAULT); } unit = op->iplo_unit; if (htab.iph_unit != unit) { IPFERROR(30005); - return(EINVAL); + return (EINVAL); } if (htab.iph_size < 1) { IPFERROR(30025); - return(EINVAL); + return (EINVAL); } @@ -294,11 +294,11 @@ ipf_htable_create(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) if (iph != NULL) { if ((iph->iph_flags & IPHASH_DELETE) == 0) { IPFERROR(30004); - return(EEXIST); + return (EEXIST); } iph->iph_flags &= ~IPHASH_DELETE; iph->iph_ref++; - return(0); + return (0); } } @@ -306,7 +306,7 @@ ipf_htable_create(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) if (iph == NULL) { softh->ipht_nomem[op->iplo_unit + 1]++; IPFERROR(30002); - return(ENOMEM); + return (ENOMEM); } *iph = htab; @@ -337,7 +337,7 @@ ipf_htable_create(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) KFREE(iph); softh->ipht_nomem[unit + 1]++; IPFERROR(30006); - return(ENOMEM); + return (ENOMEM); } bzero((char *)iph->iph_table, iph->iph_size * sizeof(*iph->iph_table)); @@ -357,7 +357,7 @@ ipf_htable_create(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) softh->ipf_nhtables[unit + 1]++; - return(0); + return (0); } @@ -372,7 +372,7 @@ ipf_htable_create(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) static int ipf_htable_table_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { - return(ipf_htable_destroy(softc, arg, op->iplo_unit, op->iplo_name)); + return (ipf_htable_destroy(softc, arg, op->iplo_unit, op->iplo_name)); } @@ -396,23 +396,23 @@ ipf_htable_destroy(ipf_main_softc_t *softc, void *arg, int unit, char *name) iph = ipf_htable_find(arg, unit, name); if (iph == NULL) { IPFERROR(30007); - return(ESRCH); + return (ESRCH); } if (iph->iph_unit != unit) { IPFERROR(30008); - return(EINVAL); + return (EINVAL); } if (iph->iph_ref != 0) { ipf_htable_clear(softc, arg, iph); iph->iph_flags |= IPHASH_DELETE; - return(0); + return (0); } ipf_htable_remove(softc, arg, iph); - return(0); + return (0); } @@ -433,8 +433,8 @@ ipf_htable_clear(ipf_main_softc_t *softc, void *arg, iphtable_t *iph) while ((ipe = iph->iph_list) != NULL) if (ipf_htent_remove(softc, arg, iph, ipe) != 0) - return(1); - return(0); + return (1); + return (0); } @@ -479,7 +479,7 @@ ipf_htable_remove(ipf_main_softc_t *softc, void *arg, iphtable_t *iph) { if (ipf_htable_clear(softc, arg, iph) != 0) - return(1); + return (1); if (iph->iph_pnext != NULL) *iph->iph_pnext = iph->iph_next; @@ -488,7 +488,7 @@ ipf_htable_remove(ipf_main_softc_t *softc, void *arg, iphtable_t *iph) iph->iph_pnext = NULL; iph->iph_next = NULL; - return(ipf_htable_deref(softc, arg, iph)); + return (ipf_htable_deref(softc, arg, iph)); } @@ -511,35 +511,35 @@ ipf_htable_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, if (op->iplo_size != sizeof(hte)) { IPFERROR(30014); - return(EINVAL); + return (EINVAL); } err = COPYIN(op->iplo_struct, &hte, sizeof(hte)); if (err != 0) { IPFERROR(30015); - return(EFAULT); + return (EFAULT); } iph = ipf_htable_find(arg, op->iplo_unit, op->iplo_name); if (iph == NULL) { IPFERROR(30016); - return(ESRCH); + return (ESRCH); } ent = ipf_htent_find(iph, &hte); if (ent == NULL) { IPFERROR(30022); - return(ESRCH); + return (ESRCH); } if ((uid != 0) && (ent->ipe_uid != uid)) { IPFERROR(30023); - return(EACCES); + return (EACCES); } err = ipf_htent_remove(softc, arg, iph, ent); - return(err); + return (err); } @@ -563,7 +563,7 @@ ipf_htable_table_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) err = ipf_htable_create(softc, arg, op); } - return(err); + return (err); } @@ -619,7 +619,7 @@ ipf_htent_remove(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, break; } - return(ipf_htent_deref(arg, ipe)); + return (ipf_htent_deref(arg, ipe)); } @@ -645,7 +645,7 @@ ipf_htable_deref(ipf_main_softc_t *softc, void *arg, void *object) ipf_htable_free(softh, iph); } - return(refs); + return (refs); } @@ -665,10 +665,10 @@ ipf_htent_deref(void *arg, iphtent_t *ipe) softh->ipf_nhtnodes[ipe->ipe_unit + 1]--; KFREE(ipe); - return(0); + return (0); } - return(ipe->ipe_ref); + return (ipe->ipe_ref); } @@ -704,7 +704,7 @@ ipf_htable_exists(void *arg, int unit, char *name) break; } } - return(iph); + return (iph); } @@ -725,7 +725,7 @@ ipf_htable_select_add_ref(void *arg, int unit, char *name) if (iph != NULL) { ATOMIC_INC32(iph->iph_ref); } - return(iph); + return (iph); } @@ -745,9 +745,9 @@ ipf_htable_find(void *arg, int unit, char *name) iph = ipf_htable_exists(arg, unit, name); if ((iph != NULL) && (iph->iph_flags & IPHASH_DELETE) == 0) - return(iph); + return (iph); - return(NULL); + return (NULL); } @@ -781,7 +781,7 @@ ipf_htable_flush(ipf_main_softc_t *softc, void *arg, iplookupflush_t *op) } } - return(freed); + return (freed); } @@ -804,30 +804,30 @@ ipf_htable_node_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, if (op->iplo_size != sizeof(hte)) { IPFERROR(30018); - return(EINVAL); + return (EINVAL); } err = COPYIN(op->iplo_struct, &hte, sizeof(hte)); if (err != 0) { IPFERROR(30019); - return(EFAULT); + return (EFAULT); } hte.ipe_uid = uid; iph = ipf_htable_find(arg, op->iplo_unit, op->iplo_name); if (iph == NULL) { IPFERROR(30020); - return(ESRCH); + return (ESRCH); } if (ipf_htent_find(iph, &hte) != NULL) { IPFERROR(30021); - return(EEXIST); + return (EEXIST); } err = ipf_htent_insert(softc, arg, iph, &hte); - return(err); + return (err); } @@ -852,7 +852,7 @@ ipf_htent_insert(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, KMALLOC(ipe, iphtent_t *); if (ipe == NULL) - return(-1); + return (-1); bcopy((char *)ipeo, (char *)ipe, sizeof(*ipe)); ipe->ipe_addr.i6[0] &= ipe->ipe_mask.i6[0]; @@ -880,7 +880,7 @@ ipf_htent_insert(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, #endif { KFREE(ipe); - return(-1); + return (-1); } ipe->ipe_owner = iph; @@ -960,7 +960,7 @@ ipf_htent_insert(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, ipe->ipe_unit = iph->iph_unit; softh->ipf_nhtnodes[ipe->ipe_unit + 1]++; - return(0); + return (0); } @@ -1004,7 +1004,7 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) ipe.ipe_mask.i6, iph->iph_size); } else #endif - return(NULL); + return (NULL); for (ent = iph->iph_table[hv]; ent != NULL; ent = ent->ipe_hnext) { if (ent->ipe_family != ipe.ipe_family) @@ -1016,7 +1016,7 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) break; } - return(ent); + return (ent); } @@ -1050,7 +1050,7 @@ ipf_iphmfindgroup(ipf_main_softc_t *softc, void *tptr, void *aptr) else rval = NULL; RWLOCK_EXIT(&softc->ipf_poolrw); - return(rval); + return (rval); } @@ -1075,7 +1075,7 @@ ipf_iphmfindip(ipf_main_softc_t *softc, void *tptr, int ipversion, void *aptr, int rval; if (tptr == NULL || aptr == NULL) - return(-1); + return (-1); iph = tptr; addr = aptr; @@ -1099,7 +1099,7 @@ ipf_iphmfindip(ipf_main_softc_t *softc, void *tptr, int ipversion, void *aptr, rval = 1; } RWLOCK_EXIT(&softc->ipf_poolrw); - return(rval); + return (rval); } @@ -1137,7 +1137,7 @@ ipf_iphmfind(iphtable_t *iph, struct in_addr *addr) if (i < iph->iph_v4_masks.imt4_max) goto maskloop; } - return(ipe); + return (ipe); } @@ -1224,7 +1224,7 @@ ipf_htable_iter_next(ipf_main_softc_t *softc, void *arg, ipftoken_t *token, RWLOCK_EXIT(&softc->ipf_poolrw); if (err != 0) - return(err); + return (err); switch (ilp->ili_otype) { @@ -1258,7 +1258,7 @@ ipf_htable_iter_next(ipf_main_softc_t *softc, void *arg, ipftoken_t *token, if (hnext == NULL) ipf_token_mark_complete(token); - return(err); + return (err); } @@ -1278,10 +1278,10 @@ ipf_htable_iter_deref(ipf_main_softc_t *softc, void *arg, int otype, int unit, { if (data == NULL) - return(EFAULT); + return (EFAULT); if (unit < -1 || unit > IPL_LOGMAX) - return(EINVAL); + return (EINVAL); switch (otype) { @@ -1296,7 +1296,7 @@ ipf_htable_iter_deref(ipf_main_softc_t *softc, void *arg, int otype, int unit, break; } - return(0); + return (0); } @@ -1338,7 +1338,7 @@ ipf_iphmfind6(iphtable_t *iph, i6addr_t *addr) if (i < iph->iph_v6_masks.imt6_max) goto maskloop; } - return(ipe); + return (ipe); } #endif diff --git a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c index a3dafe21d565..c6e4be17e22e 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c @@ -47,7 +47,7 @@ ipf_p_ipsec_soft_create(ipf_main_softc_t *softc) KMALLOC(softi, ipf_ipsec_softc_t *); if (softi == NULL) - return(NULL); + return (NULL); bzero((char *)softi, sizeof(*softi)); softi->ipsec_fr.fr_ref = 1; @@ -56,7 +56,7 @@ ipf_p_ipsec_soft_create(ipf_main_softc_t *softc) softi->ipsec_proxy_init = 1; softi->ipsec_proxy_ttl = 60; - return(softi); + return (softi); } @@ -67,20 +67,20 @@ ipf_p_ipsec_soft_init(ipf_main_softc_t *softc, void *arg) softi->ipsec_nat_tqe = ipf_state_add_tq(softc, softi->ipsec_proxy_ttl); if (softi->ipsec_nat_tqe == NULL) - return(-1); + return (-1); softi->ipsec_state_tqe = ipf_nat_add_tq(softc, softi->ipsec_proxy_ttl); if (softi->ipsec_state_tqe == NULL) { if (ipf_deletetimeoutqueue(softi->ipsec_nat_tqe) == 0) ipf_freetimeoutqueue(softc, softi->ipsec_nat_tqe); softi->ipsec_nat_tqe = NULL; - return(-1); + return (-1); } softi->ipsec_nat_tqe->ifq_flags |= IFQF_PROXY; softi->ipsec_state_tqe->ifq_flags |= IFQF_PROXY; softi->ipsec_fr.fr_age[0] = softi->ipsec_proxy_ttl; softi->ipsec_fr.fr_age[1] = softi->ipsec_proxy_ttl; - return(0); + return (0); } @@ -140,7 +140,7 @@ ipf_p_ipsec_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) mb_t *m; if (fin->fin_v != 4) - return(-1); + return (-1); off = fin->fin_plen - fin->fin_dlen + fin->fin_ipoff; bzero(softi->ipsec_buffer, sizeof(softi->ipsec_buffer)); @@ -149,24 +149,24 @@ ipf_p_ipsec_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) dlen = M_LEN(m) - off; if (dlen < 16) - return(-1); + return (-1); COPYDATA(m, off, MIN(sizeof(softi->ipsec_buffer), dlen), softi->ipsec_buffer); if (ipf_nat_outlookup(fin, 0, IPPROTO_ESP, nat->nat_nsrcip, ip->ip_dst) != NULL) - return(-1); + return (-1); np = nat->nat_ptr; size = np->in_size; KMALLOC(ipsec, ipsec_pxy_t *); if (ipsec == NULL) - return(-1); + return (-1); KMALLOCS(ipn, ipnat_t *, size); if (ipn == NULL) { KFREE(ipsec); - return(-1); + return (-1); } aps->aps_data = ipsec; @@ -246,7 +246,7 @@ ipf_p_ipsec_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) (void) ipf_state_add(softc, &fi, &ipsec->ipsc_state, SI_WILDP); } ip->ip_p = p & 0xff; - return(0); + return (0); } @@ -265,10 +265,10 @@ ipf_p_ipsec_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int p; if ((fin->fin_out == 1) && (nat->nat_dir == NAT_INBOUND)) - return(0); + return (0); if ((fin->fin_out == 0) && (nat->nat_dir == NAT_OUTBOUND)) - return(0); + return (0); ipsec = aps->aps_data; @@ -330,7 +330,7 @@ ipf_p_ipsec_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) } ip->ip_p = p; } - return(0); + return (0); } @@ -351,7 +351,7 @@ ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat) nat = nat; /* LINT */ if ((fin->fin_dlen < sizeof(cookies)) || (fin->fin_flx & FI_FRAG)) - return(-1); + return (-1); off = fin->fin_plen - fin->fin_dlen + fin->fin_ipoff; ipsec = aps->aps_data; @@ -360,22 +360,22 @@ ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat) if ((cookies[0] != ipsec->ipsc_icookie[0]) || (cookies[1] != ipsec->ipsc_icookie[1])) - return(-1); + return (-1); if (ipsec->ipsc_rckset == 0) { if ((cookies[2]|cookies[3]) == 0) { - return(0); + return (0); } ipsec->ipsc_rckset = 1; ipsec->ipsc_rcookie[0] = cookies[2]; ipsec->ipsc_rcookie[1] = cookies[3]; - return(0); + return (0); } if ((cookies[2] != ipsec->ipsc_rcookie[0]) || (cookies[3] != ipsec->ipsc_rcookie[1])) - return(-1); - return(0); + return (-1); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c index 3d0d3bd16af7..026459299efd 100644 --- a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c @@ -76,13 +76,13 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) ircp->irc_port = 0; if (len < 31) - return(0); + return (0); s = buf; c = *s++; i = len - 1; if ((c != ':') && (c != 'P')) - return(0); + return (0); if (c == ':') { /* @@ -92,14 +92,14 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) c = *s; ircp->irc_snick = s; if (!ISALPHA(c)) - return(0); + return (0); i--; for (c = *s; !ISSPACE(c) && (i > 0); i--) c = *s++; if (i < 31) - return(0); + return (0); if (c != 'P') - return(0); + return (0); } else ircp->irc_snick = NULL; @@ -107,7 +107,7 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) * Check command string */ if (strncmp(s, "PRIVMSG ", 8)) - return(0); + return (0); i -= 8; s += 8; c = *s; @@ -117,11 +117,11 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) * Loosely check that the destination is a nickname of some sort */ if (!ISALPHA(c)) - return(0); + return (0); for (; !ISSPACE(c) && (i > 0); i--) c = *s++; if (i < 20) - return(0); + return (0); s++, i--; @@ -135,7 +135,7 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) } if (strncmp(s, "\001DCC ", 4)) - return(0); + return (0); i -= 4; s += 4; @@ -149,36 +149,36 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) break; } if (!ipf_p_irc_dcctypes[j]) - return(0); + return (0); ircp->irc_type = s; i -= k; s += k; if (i < 11) - return(0); + return (0); /* * Check for the arg */ c = *s; if (ISSPACE(c)) - return(0); + return (0); ircp->irc_arg = s; for (; (c != ' ') && (c != '\001') && (i > 0); i--) c = *s++; if (c == '\001') /* In reality a ^A can quote another ^A...*/ - return(0); + return (0); if (i < 5) - return(0); + return (0); s++; i--; c = *s; if (!ISDIGIT(c)) - return(0); + return (0); ircp->irc_addr = s; /* * Get the IP# @@ -190,17 +190,17 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) } if (i < 4) - return(0); + return (0); if (c != ' ') - return(0); + return (0); ircp->irc_ipnum = l; s++; i--; c = *s; if (!ISDIGIT(c)) - return(0); + return (0); /* * Get the port# */ @@ -210,13 +210,13 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) c = *s++; } if (i < 3) - return(0); + return (0); if (strncmp(s, "\001\r\n", 3)) - return(0); + return (0); s += 3; ircp->irc_len = s - buf; ircp->irc_port = l; - return(1); + return (1); } @@ -226,11 +226,11 @@ ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ircinfo_t *irc; if (fin->fin_v != 4) - return(-1); + return (-1); KMALLOC(irc, ircinfo_t *); if (irc == NULL) - return(-1); + return (-1); nat = nat; /* LINT */ @@ -238,7 +238,7 @@ ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) aps->aps_psiz = sizeof(ircinfo_t); bzero((char *)irc, sizeof(*irc)); - return(0); + return (0); } @@ -271,24 +271,24 @@ ipf_p_irc_send(fr_info_t *fin, nat_t *nat) dlen = MSGDSIZE(m) - off; if (dlen <= 0) - return(0); + return (0); COPYDATA(m, off, MIN(sizeof(ctcpbuf), dlen), ctcpbuf); if (dlen <= 0) - return(0); + return (0); ctcpbuf[sizeof(ctcpbuf) - 1] = '\0'; *newbuf = '\0'; irc = nat->nat_aps->aps_data; if (ipf_p_irc_complete(irc, ctcpbuf, dlen) == 0) - return(0); + return (0); /* * check that IP address in the DCC reply is the same as the * sender of the command - prevents use for port scanning. */ if (irc->irc_ipnum != ntohl(nat->nat_osrcaddr)) - return(0); + return (0); a5 = irc->irc_port; @@ -307,7 +307,7 @@ ipf_p_irc_send(fr_info_t *fin, nat_t *nat) inc = nlen - olen; if ((inc + fin->fin_plen) > 65535) - return(0); + return (0); #if SOLARIS for (m1 = m; m1->b_cont; m1 = m1->b_cont) @@ -373,7 +373,7 @@ ipf_p_irc_send(fr_info_t *fin, nat_t *nat) * security crap. */ if (ntohs(sp) < 1024) - return(0); + return (0); /* * The server may not make the connection back from port 20, but @@ -417,7 +417,7 @@ ipf_p_irc_send(fr_info_t *fin, nat_t *nat) } ip->ip_src = swip; } - return(inc); + return (inc); } @@ -425,5 +425,5 @@ int ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { aps = aps; /* LINT */ - return(ipf_p_irc_send(fin, nat)); + return (ipf_p_irc_send(fin, nat)); } diff --git a/sys/netpfil/ipfilter/netinet/ip_log.c b/sys/netpfil/ipfilter/netinet/ip_log.c index 980c1ef1eda3..56b2620fc9a2 100644 --- a/sys/netpfil/ipfilter/netinet/ip_log.c +++ b/sys/netpfil/ipfilter/netinet/ip_log.c @@ -165,14 +165,14 @@ static ipftuneable_t ipf_log_tuneables[] = { int ipf_log_main_load(void) { - return(0); + return (0); } int ipf_log_main_unload(void) { - return(0); + return (0); } /* ------------------------------------------------------------------------ */ @@ -191,7 +191,7 @@ ipf_log_soft_create(ipf_main_softc_t *softc) KMALLOC(softl, ipf_log_softc_t *); if (softl == NULL) - return(NULL); + return (NULL); bzero((char *)softl, sizeof(*softl)); bcopy((char *)magic, (char *)softl->ipl_magic, sizeof(magic)); @@ -201,11 +201,11 @@ ipf_log_soft_create(ipf_main_softc_t *softc) ipf_log_tuneables); if (softl->ipf_log_tune == NULL) { ipf_log_soft_destroy(softc, softl); - return(NULL); + return (NULL); } if (ipf_tune_array_link(softc, softl->ipf_log_tune) == -1) { ipf_log_soft_destroy(softc, softl); - return(NULL); + return (NULL); } for (i = IPL_LOGMAX; i >= 0; i--) { @@ -217,7 +217,7 @@ ipf_log_soft_create(ipf_main_softc_t *softc) softl->ipl_log_init = 0; softl->ipl_logsize = IPFILTER_LOGSIZE; - return(softl); + return (softl); } /* ------------------------------------------------------------------------ */ @@ -248,7 +248,7 @@ ipf_log_soft_init(ipf_main_softc_t *softc, void *arg) softl->ipl_log_init = 1; - return(0); + return (0); } @@ -266,7 +266,7 @@ ipf_log_soft_fini(ipf_main_softc_t *softc, void *arg) int i; if (softl->ipl_log_init == 0) - return(0); + return (0); softl->ipl_log_init = 0; @@ -294,7 +294,7 @@ ipf_log_soft_fini(ipf_main_softc_t *softc, void *arg) MUTEX_EXIT(&softl->ipl_mutex[i]); } - return(0); + return (0); } @@ -361,7 +361,7 @@ ipf_log_pkt(fr_info_t *fin, u_int flags) m = fin->fin_m; if (m == NULL) - return(-1); + return (-1); ipfl.fl_nattag.ipt_num[0] = 0; ifp = fin->fin_ifp; @@ -497,7 +497,7 @@ ipf_log_pkt(fr_info_t *fin, u_int flags) sizes[1] = hlen + mlen; types[1] = 1; # endif /* SOLARIS */ - return(ipf_log_items(softc, IPL_LOGIPF, fin, ptrs, sizes, types, 2)); + return (ipf_log_items(softc, IPL_LOGIPF, fin, ptrs, sizes, types, 2)); } @@ -543,14 +543,14 @@ ipf_log_items(ipf_main_softc_t *softc, int unit, fr_info_t *fin, void **items, if ((softl->ipl_used[unit] + len) > softl->ipl_logsize) { softl->ipl_logfail[unit]++; MUTEX_EXIT(&softl->ipl_mutex[unit]); - return(-1); + return (-1); } KMALLOCS(buf, caddr_t, len); if (buf == NULL) { softl->ipl_logfail[unit]++; MUTEX_EXIT(&softl->ipl_mutex[unit]); - return(-1); + return (-1); } ipl = (iplog_t *)buf; ipl->ipl_magic = softl->ipl_magic[unit]; @@ -592,7 +592,7 @@ ipf_log_items(ipf_main_softc_t *softc, int unit, fr_info_t *fin, void **items, MUTEX_EXIT(&softl->ipl_mutex[unit]); SPL_X(s); KFREES(buf, len); - return(0); + return (0); } bcopy((char *)fin, (char *)&softl->ipl_crc[unit], FI_LCSIZE); @@ -628,7 +628,7 @@ ipf_log_items(ipf_main_softc_t *softc, int unit, fr_info_t *fin, void **items, # ifdef IPL_SELECT iplog_input_ready(unit); # endif - return(0); + return (0); } @@ -656,7 +656,7 @@ ipf_log_read(ipf_main_softc_t *softc, minor_t unit, struct uio *uio) if (softl->ipl_log_init == 0) { IPFERROR(40007); - return(0); + return (0); } /* @@ -665,18 +665,18 @@ ipf_log_read(ipf_main_softc_t *softc, minor_t unit, struct uio *uio) */ if (IPL_LOGMAX < unit) { IPFERROR(40001); - return(ENXIO); + return (ENXIO); } if (uio->uio_resid == 0) - return(0); + return (0); if (uio->uio_resid < sizeof(iplog_t)) { IPFERROR(40002); - return(EINVAL); + return (EINVAL); } if (uio->uio_resid > softl->ipl_logsize) { IPFERROR(40005); - return(EINVAL); + return (EINVAL); } /* @@ -694,7 +694,7 @@ ipf_log_read(ipf_main_softc_t *softc, minor_t unit, struct uio *uio) softl->ipl_readers[unit]--; MUTEX_EXIT(&softl->ipl_mutex[unit]); IPFERROR(40003); - return(EINTR); + return (EINTR); } # else MUTEX_EXIT(&softl->ipl_mutex[unit]); @@ -706,7 +706,7 @@ ipf_log_read(ipf_main_softc_t *softc, minor_t unit, struct uio *uio) softl->ipl_readers[unit]--; MUTEX_EXIT(&softl->ipl_mutex[unit]); IPFERROR(40004); - return(error); + return (error); } # endif /* SOLARIS */ } @@ -714,7 +714,7 @@ ipf_log_read(ipf_main_softc_t *softc, minor_t unit, struct uio *uio) softl->ipl_readers[unit]--; MUTEX_EXIT(&softl->ipl_mutex[unit]); IPFERROR(40008); - return(EIO); + return (EIO); } # if defined(BSD) @@ -755,7 +755,7 @@ ipf_log_read(ipf_main_softc_t *softc, minor_t unit, struct uio *uio) softl->ipl_readers[unit]--; MUTEX_EXIT(&softl->ipl_mutex[unit]); SPL_X(s); - return(error); + return (error); } @@ -788,7 +788,7 @@ ipf_log_clear(ipf_main_softc_t *softc, minor_t unit) bzero((char *)&softl->ipl_crc[unit], FI_CSIZE); MUTEX_EXIT(&softl->ipl_mutex[unit]); SPL_X(s); - return(used); + return (used); } @@ -806,7 +806,7 @@ ipf_log_canread(ipf_main_softc_t *softc, int unit) { ipf_log_softc_t *softl = softc->ipf_log_soft; - return(softl->iplt[unit] != NULL); + return (softl->iplt[unit] != NULL); } @@ -825,9 +825,9 @@ ipf_log_bytesused(ipf_main_softc_t *softc, int unit) ipf_log_softc_t *softl = softc->ipf_log_soft; if (softl == NULL) - return(0); + return (0); - return(softl->ipl_used[unit]); + return (softl->ipl_used[unit]); } @@ -846,9 +846,9 @@ ipf_log_failures(ipf_main_softc_t *softc, int unit) ipf_log_softc_t *softl = softc->ipf_log_soft; if (softl == NULL) - return(0); + return (0); - return(softl->ipl_logfail[unit]); + return (softl->ipl_logfail[unit]); } @@ -867,8 +867,8 @@ ipf_log_logok(ipf_main_softc_t *softc, int unit) ipf_log_softc_t *softl = softc->ipf_log_soft; if (softl == NULL) - return(0); + return (0); - return(softl->ipl_logok[unit]); + return (softl->ipl_logok[unit]); } #endif /* IPFILTER_LOG */ diff --git a/sys/netpfil/ipfilter/netinet/ip_lookup.c b/sys/netpfil/ipfilter/netinet/ip_lookup.c index a18a1ee95ea0..19ee77faf41b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_lookup.c +++ b/sys/netpfil/ipfilter/netinet/ip_lookup.c @@ -104,7 +104,7 @@ ipf_lookup_soft_create(ipf_main_softc_t *softc) KMALLOC(softl, ipf_lookup_softc_t *); if (softl == NULL) - return(NULL); + return (NULL); bzero((char *)softl, sizeof(*softl)); @@ -112,11 +112,11 @@ ipf_lookup_soft_create(ipf_main_softc_t *softc) softl->ipf_back[i] = (*(*l)->ipfl_create)(softc); if (softl->ipf_back[i] == NULL) { ipf_lookup_soft_destroy(softc, softl); - return(NULL); + return (NULL); } } - return(softl); + return (softl); } @@ -141,7 +141,7 @@ ipf_lookup_soft_init(ipf_main_softc_t *softc, void *arg) break; } - return(err); + return (err); } @@ -165,7 +165,7 @@ ipf_lookup_soft_fini(ipf_main_softc_t *softc, void *arg) softl->ipf_back[i]); } - return(0); + return (0); } @@ -298,7 +298,7 @@ ipf_lookup_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, break; } SPL_X(s); - return(err); + return (err); } @@ -324,13 +324,13 @@ ipf_lookup_addnode(ipf_main_softc_t *softc, caddr_t data, int uid) err = BCOPYIN(data, &op, sizeof(op)); if (err != 0) { IPFERROR(50002); - return(EFAULT); + return (EFAULT); } if ((op.iplo_unit < 0 || op.iplo_unit > IPL_LOGMAX) && (op.iplo_unit != IPLT_ALL)) { IPFERROR(50003); - return(EINVAL); + return (EINVAL); } op.iplo_name[sizeof(op.iplo_name) - 1] = '\0'; @@ -349,7 +349,7 @@ ipf_lookup_addnode(ipf_main_softc_t *softc, caddr_t data, int uid) err = EINVAL; } - return(err); + return (err); } @@ -374,13 +374,13 @@ ipf_lookup_delnode(ipf_main_softc_t *softc, caddr_t data, int uid) err = BCOPYIN(data, &op, sizeof(op)); if (err != 0) { IPFERROR(50042); - return(EFAULT); + return (EFAULT); } if ((op.iplo_unit < 0 || op.iplo_unit > IPL_LOGMAX) && (op.iplo_unit != IPLT_ALL)) { IPFERROR(50013); - return(EINVAL); + return (EINVAL); } op.iplo_name[sizeof(op.iplo_name) - 1] = '\0'; @@ -397,7 +397,7 @@ ipf_lookup_delnode(ipf_main_softc_t *softc, caddr_t data, int uid) IPFERROR(50021); err = EINVAL; } - return(err); + return (err); } @@ -421,13 +421,13 @@ ipf_lookup_addtable(ipf_main_softc_t *softc, caddr_t data) err = BCOPYIN(data, &op, sizeof(op)); if (err != 0) { IPFERROR(50022); - return(EFAULT); + return (EFAULT); } if ((op.iplo_unit < 0 || op.iplo_unit > IPL_LOGMAX) && (op.iplo_unit != IPLT_ALL)) { IPFERROR(50023); - return(EINVAL); + return (EINVAL); } op.iplo_name[sizeof(op.iplo_name) - 1] = '\0'; @@ -458,7 +458,7 @@ ipf_lookup_addtable(ipf_main_softc_t *softc, caddr_t data) } } - return(err); + return (err); } @@ -482,13 +482,13 @@ ipf_lookup_deltable(ipf_main_softc_t *softc, caddr_t data) err = BCOPYIN(data, &op, sizeof(op)); if (err != 0) { IPFERROR(50028); - return(EFAULT); + return (EFAULT); } if ((op.iplo_unit < 0 || op.iplo_unit > IPL_LOGMAX) && (op.iplo_unit != IPLT_ALL)) { IPFERROR(50029); - return(EINVAL); + return (EINVAL); } op.iplo_name[sizeof(op.iplo_name) - 1] = '\0'; @@ -506,7 +506,7 @@ ipf_lookup_deltable(ipf_main_softc_t *softc, caddr_t data) IPFERROR(50030); err = EINVAL; } - return(err); + return (err); } @@ -530,13 +530,13 @@ ipf_lookup_stats(ipf_main_softc_t *softc, caddr_t data) err = BCOPYIN(data, &op, sizeof(op)); if (err != 0) { IPFERROR(50031); - return(EFAULT); + return (EFAULT); } if ((op.iplo_unit < 0 || op.iplo_unit > IPL_LOGMAX) && (op.iplo_unit != IPLT_ALL)) { IPFERROR(50032); - return(EINVAL); + return (EINVAL); } for (i = 0, l = backends; i < MAX_BACKENDS; i++, l++) { @@ -553,7 +553,7 @@ ipf_lookup_stats(ipf_main_softc_t *softc, caddr_t data) err = EINVAL; } - return(err); + return (err); } @@ -577,13 +577,13 @@ ipf_lookup_flush(ipf_main_softc_t *softc, caddr_t data) err = BCOPYIN(data, &flush, sizeof(flush)); if (err != 0) { IPFERROR(50034); - return(EFAULT); + return (EFAULT); } unit = flush.iplf_unit; if ((unit < 0 || unit > IPL_LOGMAX) && (unit != IPLT_ALL)) { IPFERROR(50035); - return(EINVAL); + return (EINVAL); } flush.iplf_name[sizeof(flush.iplf_name) - 1] = '\0'; @@ -610,7 +610,7 @@ ipf_lookup_flush(ipf_main_softc_t *softc, caddr_t data) err = EFAULT; } } - return(err); + return (err); } @@ -667,16 +667,16 @@ ipf_lookup_iterate(ipf_main_softc_t *softc, void *data, int uid, void *ctx) err = ipf_inobj(softc, data, NULL, &iter, IPFOBJ_LOOKUPITER); if (err != 0) - return(err); + return (err); if (iter.ili_unit < IPL_LOGALL && iter.ili_unit > IPL_LOGMAX) { IPFERROR(50038); - return(EINVAL); + return (EINVAL); } if (iter.ili_ival != IPFGENITER_LOOKUP) { IPFERROR(50039); - return(EINVAL); + return (EINVAL); } SPL_SCHED(s); @@ -684,7 +684,7 @@ ipf_lookup_iterate(ipf_main_softc_t *softc, void *data, int uid, void *ctx) if (token == NULL) { SPL_X(s); IPFERROR(50040); - return(ESRCH); + return (ESRCH); } for (i = 0; i < MAX_BACKENDS; i++) { @@ -706,7 +706,7 @@ ipf_lookup_iterate(ipf_main_softc_t *softc, void *data, int uid, void *ctx) ipf_token_deref(softc, token); RWLOCK_EXIT(&softc->ipf_tokens); - return(err); + return (err); } @@ -776,7 +776,7 @@ ipf_lookup_deltok(ipf_main_softc_t *softc, void *data, int uid, void *ctx) if (error == 0) error = ipf_token_del(softc, key, uid, ctx); SPL_X(s); - return(error); + return (error); } @@ -803,7 +803,7 @@ ipf_lookup_res_num(ipf_main_softc_t *softc, int unit, u_int type, u_int number, (void) snprintf(name, sizeof(name), "%u", number); - return(ipf_lookup_res_name(softc, unit, type, name, funcptr)); + return (ipf_lookup_res_name(softc, unit, type, name, funcptr)); } @@ -852,7 +852,7 @@ ipf_lookup_res_name(ipf_main_softc_t *softc, int unit, u_int type, char *name, RWLOCK_EXIT(&softc->ipf_poolrw); - return(ptr); + return (ptr); } @@ -885,7 +885,7 @@ ipf_lookup_find_htable(ipf_main_softc_t *softc, int unit, char *name) RWLOCK_EXIT(&softc->ipf_poolrw); - return(tab); + return (tab); } diff --git a/sys/netpfil/ipfilter/netinet/ip_nat.c b/sys/netpfil/ipfilter/netinet/ip_nat.c index cade98058c43..b3f654959673 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat.c @@ -267,7 +267,7 @@ int ipf_nat_main_load(void) { - return(0); + return (0); } @@ -282,7 +282,7 @@ ipf_nat_main_load(void) int ipf_nat_main_unload(void) { - return(0); + return (0); } @@ -302,7 +302,7 @@ ipf_nat_soft_create(ipf_main_softc_t *softc) KMALLOC(softn, ipf_nat_softc_t *); if (softn == NULL) - return(NULL); + return (NULL); bzero((char *)softn, sizeof(*softn)); @@ -311,11 +311,11 @@ ipf_nat_soft_create(ipf_main_softc_t *softc) ipf_nat_tuneables); if (softn->ipf_nat_tune == NULL) { ipf_nat_soft_destroy(softc, softn); - return(NULL); + return (NULL); } if (ipf_tune_array_link(softc, softn->ipf_nat_tune) == -1) { ipf_nat_soft_destroy(softc, softn); - return(NULL); + return (NULL); } softn->ipf_nat_list_tail = &softn->ipf_nat_list; @@ -346,7 +346,7 @@ ipf_nat_soft_create(ipf_main_softc_t *softc) softn->ipf_nat_table_wm_high = 99; softn->ipf_nat_table_wm_low = 90; - return(softn); + return (softn); } /* ------------------------------------------------------------------------ */ @@ -391,7 +391,7 @@ ipf_nat_soft_init(ipf_main_softc_t *softc, void *arg) bzero((char *)softn->ipf_nat_table[0], softn->ipf_nat_table_sz * sizeof(nat_t *)); } else { - return(-1); + return (-1); } KMALLOCS(softn->ipf_nat_table[1], nat_t **, \ @@ -401,7 +401,7 @@ ipf_nat_soft_init(ipf_main_softc_t *softc, void *arg) bzero((char *)softn->ipf_nat_table[1], softn->ipf_nat_table_sz * sizeof(nat_t *)); } else { - return(-2); + return (-2); } KMALLOCS(softn->ipf_nat_map_rules, ipnat_t **, \ @@ -411,7 +411,7 @@ ipf_nat_soft_init(ipf_main_softc_t *softc, void *arg) bzero((char *)softn->ipf_nat_map_rules, softn->ipf_nat_maprules_sz * sizeof(ipnat_t *)); } else { - return(-3); + return (-3); } KMALLOCS(softn->ipf_nat_rdr_rules, ipnat_t **, \ @@ -421,7 +421,7 @@ ipf_nat_soft_init(ipf_main_softc_t *softc, void *arg) bzero((char *)softn->ipf_nat_rdr_rules, softn->ipf_nat_rdrrules_sz * sizeof(ipnat_t *)); } else { - return(-4); + return (-4); } KMALLOCS(softn->ipf_hm_maptable, hostmap_t **, \ @@ -431,7 +431,7 @@ ipf_nat_soft_init(ipf_main_softc_t *softc, void *arg) bzero((char *)softn->ipf_hm_maptable, sizeof(hostmap_t *) * softn->ipf_nat_hostmap_sz); } else { - return(-5); + return (-5); } softn->ipf_hm_maplist = NULL; @@ -439,7 +439,7 @@ ipf_nat_soft_init(ipf_main_softc_t *softc, void *arg) softn->ipf_nat_table_sz * sizeof(u_int)); if (softn->ipf_nat_stats.ns_side[0].ns_bucketlen == NULL) { - return(-6); + return (-6); } bzero((char *)softn->ipf_nat_stats.ns_side[0].ns_bucketlen, softn->ipf_nat_table_sz * sizeof(u_int)); @@ -448,7 +448,7 @@ ipf_nat_soft_init(ipf_main_softc_t *softc, void *arg) softn->ipf_nat_table_sz * sizeof(u_int)); if (softn->ipf_nat_stats.ns_side[1].ns_bucketlen == NULL) { - return(-7); + return (-7); } bzero((char *)softn->ipf_nat_stats.ns_side[1].ns_bucketlen, @@ -511,7 +511,7 @@ ipf_nat_soft_init(ipf_main_softc_t *softc, void *arg) softn->ipf_nat_inited = 1; - return(0); + return (0); } @@ -595,7 +595,7 @@ ipf_nat_soft_fini(ipf_main_softc_t *softc, void *arg) MUTEX_DESTROY(&softn->ipf_nat_pending.ifq_lock); } - return(0); + return (0); } @@ -775,12 +775,12 @@ ipf_nat_hostmap(ipf_nat_softc_t *softn, ipnat_t *np, struct in_addr src, ((port == 0) || (port == hm->hm_port))) { softn->ipf_nat_stats.ns_hm_addref++; hm->hm_ref++; - return(hm); + return (hm); } if (np == NULL) { softn->ipf_nat_stats.ns_hm_nullnp++; - return(NULL); + return (NULL); } KMALLOC(hm, hostmap_t *); @@ -809,7 +809,7 @@ ipf_nat_hostmap(ipf_nat_softc_t *softn, ipnat_t *np, struct in_addr src, } else { softn->ipf_nat_stats.ns_hm_newfail++; } - return(hm); + return (hm); } @@ -997,7 +997,7 @@ ipf_nat_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, # endif { IPFERROR(60001); - return(EPERM); + return (EPERM); } #endif @@ -1386,7 +1386,7 @@ ipf_nat_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, ipf_nat_rule_fini(softc, nat); if (nt != NULL) KFREES(nt, nt->in_size); - return(error); + return (error); } @@ -1412,12 +1412,12 @@ ipf_nat_siocaddnat(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, ipnat_t *n, if (ipf_nat_resolverule(softc, n) != 0) { IPFERROR(60022); - return(ENOENT); + return (ENOENT); } if ((n->in_age[0] == 0) && (n->in_age[1] != 0)) { IPFERROR(60023); - return(EINVAL); + return (EINVAL); } if (n->in_redir == (NAT_DIVERTUDP|NAT_MAP)) { @@ -1496,7 +1496,7 @@ ipf_nat_siocaddnat(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, ipnat_t *n, RWLOCK_EXIT(&softc->ipf_nat); /* WRITE */ } - return(error); + return (error); } @@ -1517,12 +1517,12 @@ ipf_nat_ruleaddrinit(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, if ((n->in_ndst.na_atype == FRI_LOOKUP) && (n->in_ndst.na_type != IPLT_DSTLIST)) { IPFERROR(60071); - return(EINVAL); + return (EINVAL); } if ((n->in_nsrc.na_atype == FRI_LOOKUP) && (n->in_nsrc.na_type != IPLT_DSTLIST)) { IPFERROR(60069); - return(EINVAL); + return (EINVAL); } if (n->in_redir == NAT_BIMAP) { @@ -1543,27 +1543,27 @@ ipf_nat_ruleaddrinit(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, error = ipf_nat_nextaddrinit(softc, n->in_names, &n->in_osrc, 1, n->in_ifps[idx]); if (error != 0) - return(error); + return (error); error = ipf_nat_nextaddrinit(softc, n->in_names, &n->in_odst, 1, n->in_ifps[idx]); if (error != 0) - return(error); + return (error); error = ipf_nat_nextaddrinit(softc, n->in_names, &n->in_nsrc, 1, n->in_ifps[idx]); if (error != 0) - return(error); + return (error); error = ipf_nat_nextaddrinit(softc, n->in_names, &n->in_ndst, 1, n->in_ifps[idx]); if (error != 0) - return(error); + return (error); if (n->in_redir & NAT_DIVERTUDP) ipf_nat_builddivertmp(softn, n); - return(0); + return (0); } @@ -1605,9 +1605,9 @@ ipf_nat_resolverule(ipf_main_softc_t *softc, ipnat_t *n) n->in_pr[1], base + n->in_plabel); if (n->in_apr == NULL) - return(-1); + return (-1); } - return(0); + return (0); } @@ -1666,7 +1666,7 @@ ipf_nat_getsz(ipf_main_softc_t *softc, caddr_t data, int getlock) error = BCOPYIN(data, &ng, sizeof(ng)); if (error != 0) { IPFERROR(60024); - return(EFAULT); + return (EFAULT); } if (getlock) { @@ -1687,9 +1687,9 @@ ipf_nat_getsz(ipf_main_softc_t *softc, caddr_t data, int getlock) error = BCOPYOUT(&ng, data, sizeof(ng)); if (error != 0) { IPFERROR(60025); - return(EFAULT); + return (EFAULT); } - return(0); + return (0); } } else { /* @@ -1705,7 +1705,7 @@ ipf_nat_getsz(ipf_main_softc_t *softc, caddr_t data, int getlock) RWLOCK_EXIT(&softc->ipf_nat); } IPFERROR(60026); - return(ESRCH); + return (ESRCH); } } @@ -1726,9 +1726,9 @@ ipf_nat_getsz(ipf_main_softc_t *softc, caddr_t data, int getlock) error = BCOPYOUT(&ng, data, sizeof(ng)); if (error != 0) { IPFERROR(60027); - return(EFAULT); + return (EFAULT); } - return(0); + return (0); } @@ -1756,17 +1756,17 @@ ipf_nat_getent(ipf_main_softc_t *softc, caddr_t data, int getlock) error = ipf_inobj(softc, data, NULL, &ipns, IPFOBJ_NATSAVE); if (error != 0) - return(error); + return (error); if ((ipns.ipn_dsize < sizeof(ipns)) || (ipns.ipn_dsize > 81920)) { IPFERROR(60028); - return(EINVAL); + return (EINVAL); } KMALLOCS(ipn, nat_save_t *, ipns.ipn_dsize); if (ipn == NULL) { IPFERROR(60029); - return(ENOMEM); + return (ENOMEM); } if (getlock) { @@ -1860,7 +1860,7 @@ ipf_nat_getent(ipf_main_softc_t *softc, caddr_t data, int getlock) if (getlock) { RWLOCK_EXIT(&softc->ipf_nat); } - return(error); + return (error); } @@ -1891,7 +1891,7 @@ ipf_nat_putent(ipf_main_softc_t *softc, caddr_t data, int getlock) error = ipf_inobj(softc, data, NULL, &ipn, IPFOBJ_NATSAVE); if (error != 0) - return(error); + return (error); /* * Initialise early because of code at junkput label. @@ -1917,7 +1917,7 @@ ipf_nat_putent(ipf_main_softc_t *softc, caddr_t data, int getlock) KMALLOCS(ipnn, nat_save_t *, ipn.ipn_dsize); if (ipnn == NULL) { IPFERROR(60035); - return(ENOMEM); + return (ENOMEM); } bzero(ipnn, ipn.ipn_dsize); @@ -2177,7 +2177,7 @@ ipf_nat_putent(ipf_main_softc_t *softc, caddr_t data, int getlock) } if (error == 0) - return(0); + return (0); IPFERROR(60048); error = ENOMEM; @@ -2204,7 +2204,7 @@ ipf_nat_putent(ipf_main_softc_t *softc, caddr_t data, int getlock) } KFREE(nat); } - return(error); + return (error); } @@ -2416,7 +2416,7 @@ ipf_nat_flushtable(ipf_main_softc_t *softc, ipf_nat_softc_t *softn) j++; } - return(j); + return (j); } @@ -2454,7 +2454,7 @@ ipf_nat_clearlist(ipf_main_softc_t *softc, ipf_nat_softc_t *softn) #if SOLARIS && !defined(INSTANCES) pfil_delayed_copy = 1; #endif - return(i); + return (i); } @@ -2604,7 +2604,7 @@ ipf_nat_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) if (l > 0) { NBUMPSIDEX(1, ns_exhausted, ns_exhausted_1); DT4(ns_exhausted_1, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); - return(-1); + return (-1); } } @@ -2622,7 +2622,7 @@ ipf_nat_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) !(flags & IPN_TCPUDP))) { NBUMPSIDEX(1, ns_exhausted, ns_exhausted_2); DT4(ns_exhausted_2, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); - return(-1); + return (-1); } /* * map-block - Calculate destination address. @@ -2658,7 +2658,7 @@ ipf_nat_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) &in6, NULL) == -1) { NBUMPSIDEX(1, ns_new_ifpaddr, ns_new_ifpaddr_1); DT4(ns_new_ifpaddr_1, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); - return(-1); + return (-1); } in.s_addr = ntohl(in6.in4.s_addr); @@ -2669,7 +2669,7 @@ ipf_nat_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) if (l > 0) { NBUMPSIDEX(1, ns_exhausted, ns_exhausted_3); DT4(ns_exhausted_3, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); - return(-1); + return (-1); } in.s_addr = ntohl(fin->fin_saddr); @@ -2765,7 +2765,7 @@ ipf_nat_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) (np->in_snip != 0) && (st_ip == np->in_snip)) { NBUMPSIDED(1, ns_wrap); DT4(ns_wrap, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); - return(-1); + return (-1); } l++; } while (natl != NULL); @@ -2791,7 +2791,7 @@ ipf_nat_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) ((icmphdr_t *)fin->fin_dp)->icmp_id = port; nat->nat_nicmpid = port; } - return(0); + return (0); } @@ -2898,7 +2898,7 @@ ipf_nat_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) &in6, NULL) == -1) { NBUMPSIDEX(0, ns_new_ifpaddr, ns_new_ifpaddr_2); DT3(ns_new_ifpaddr_2, fr_info_t *, fin, nat_t *, nat, natinfo_t, ni); - return(-1); + return (-1); } in.s_addr = ntohl(in6.in4.s_addr); @@ -2947,7 +2947,7 @@ ipf_nat_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) if (in.s_addr == 0) { if (nport == dport) { NBUMPSIDED(0, ns_xlate_null); - return(-1); + return (-1); } in.s_addr = ntohl(fin->fin_daddr); } @@ -2969,7 +2969,7 @@ ipf_nat_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) if (natl != NULL) { DT2(ns_new_xlate_exists, fr_info_t *, fin, nat_t *, natl); NBUMPSIDE(0, ns_xlate_exists); - return(-1); + return (-1); } inb.s_addr = htonl(in.s_addr); @@ -2993,7 +2993,7 @@ ipf_nat_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) nat->nat_nicmpid = nport; } - return(move); + return (move); } /* ------------------------------------------------------------------------ */ @@ -3041,7 +3041,7 @@ ipf_nat_add(fr_info_t *fin, ipnat_t *np, nat_t **natsave, u_int flags, if (nsp->ns_active >= softn->ipf_nat_table_max) { NBUMPSIDED(fin->fin_out, ns_table_max); DT2(ns_table_max, nat_stat_t *, nsp, ipf_nat_softc_t *, softn); - return(NULL); + return (NULL); } move = 1; @@ -3069,7 +3069,7 @@ ipf_nat_add(fr_info_t *fin, ipnat_t *np, nat_t **natsave, u_int flags, printf("table_max reduced to %d\n", softn->ipf_nat_table_max); } - return(NULL); + return (NULL); } if (flags & IPN_ICMPQUERY) { @@ -3199,7 +3199,7 @@ ipf_nat_add(fr_info_t *fin, ipnat_t *np, nat_t **natsave, u_int flags, np->in_hits++; if (natsave != NULL) *natsave = nat; - return(nat); + return (nat); } @@ -3303,7 +3303,7 @@ ipf_nat_finalise(fr_info_t *fin, nat_t *nat) fr->fr_ref++; MUTEX_EXIT(&fr->fr_lock); } - return(0); + return (0); } NBUMPSIDED(fin->fin_out, ns_unfinalised); @@ -3313,7 +3313,7 @@ ipf_nat_finalise(fr_info_t *fin, nat_t *nat) */ if (nat->nat_sync != NULL) ipf_sync_del_nat(softc->ipf_sync_soft, nat->nat_sync); - return(-1); + return (-1); } @@ -3420,7 +3420,7 @@ ipf_nat_insert(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, nat_t *nat) ret = ipf_nat_hashtab_add(softc, softn, nat); if (ret == -1) MUTEX_DESTROY(&nat->nat_lock); - return(ret); + return (ret); } @@ -3457,7 +3457,7 @@ ipf_nat_hashtab_add(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, DT1(ns_bucket_max_0, int, softn->ipf_nat_stats.ns_side[0].ns_bucketlen[hv0]); NBUMPSIDE(0, ns_bucket_max); - return(-1); + return (-1); } if (softn->ipf_nat_stats.ns_side[1].ns_bucketlen[hv1] >= @@ -3465,7 +3465,7 @@ ipf_nat_hashtab_add(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, DT1(ns_bucket_max_1, int, softn->ipf_nat_stats.ns_side[1].ns_bucketlen[hv1]); NBUMPSIDE(1, ns_bucket_max); - return(-1); + return (-1); } /* @@ -3519,7 +3519,7 @@ ipf_nat_hashtab_add(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, NBUMPSIDE(0, ns_added); } softn->ipf_nat_stats.ns_active++; - return(0); + return (0); } @@ -3551,13 +3551,13 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) type = icmp->icmp_type; nside = &softn->ipf_nat_stats.ns_side[fin->fin_out]; /* - * Does it at least have the return(basic) IP header ? + * Does it at least have the return (basic) IP header ? * Only a basic IP header (no options) should be with an ICMP error * header. Also, if it's not an error type, then return. */ if ((fin->fin_hlen != sizeof(ip_t)) || !(fin->fin_flx & FI_ICMPERR)) { ATOMIC_INCL(nside->ns_icmp_basic); - return(NULL); + return (NULL); } /* @@ -3568,7 +3568,7 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) if ((minlen < sizeof(ip_t)) || (fin->fin_plen < ICMPERR_IPICMPHLEN + minlen)) { ATOMIC_INCL(nside->ns_icmp_size); - return(NULL); + return (NULL); } /* @@ -3589,13 +3589,13 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) if ((char *)oip + fin->fin_dlen - ICMPERR_ICMPHLEN > (char *)m->b_wptr) { ATOMIC_INCL(nside->ns_icmp_mbuf); - return(NULL); + return (NULL); } # else if ((char *)oip + fin->fin_dlen - ICMPERR_ICMPHLEN > (char *)fin->fin_ip + M_LEN(m)) { ATOMIC_INCL(nside->ns_icmp_mbuf); - return(NULL); + return (NULL); } # endif } @@ -3603,7 +3603,7 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) if (fin->fin_daddr != oip->ip_src.s_addr) { ATOMIC_INCL(nside->ns_icmp_address); - return(NULL); + return (NULL); } p = oip->ip_p; @@ -3637,7 +3637,7 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) oip->ip_src); fin->fin_data[0] = data[0]; fin->fin_data[1] = data[1]; - return(nat); + return (nat); } } @@ -3646,7 +3646,7 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) /* TRACE (fin,minlen) */ if (fin->fin_plen < ICMPERR_IPICMPHLEN + minlen) { ATOMIC_INCL(nside->ns_icmp_short); - return(NULL); + return (NULL); } data[0] = fin->fin_data[0]; @@ -3664,14 +3664,14 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) } fin->fin_data[0] = data[0]; fin->fin_data[1] = data[1]; - return(nat); + return (nat); } if (dir == NAT_INBOUND) nat = ipf_nat_inlookup(fin, 0, p, oip->ip_dst, oip->ip_src); else nat = ipf_nat_outlookup(fin, 0, p, oip->ip_dst, oip->ip_src); - return(nat); + return (nat); } @@ -3705,7 +3705,7 @@ ipf_nat_icmperror(fr_info_t *fin, u_int *nflags, int dir) if ((fin->fin_flx & (FI_SHORT|FI_FRAGBODY))) { NBUMPSIDED(fin->fin_out, ns_icmp_short); - return(NULL); + return (NULL); } /* @@ -3713,7 +3713,7 @@ ipf_nat_icmperror(fr_info_t *fin, u_int *nflags, int dir) */ if ((fin->fin_v != 4) || !(nat = ipf_nat_icmperrorlookup(fin, dir))) { NBUMPSIDED(fin->fin_out, ns_icmp_notfound); - return(NULL); + return (NULL); } tcp = NULL; @@ -3954,7 +3954,7 @@ ipf_nat_icmperror(fr_info_t *fin, u_int *nflags, int dir) } } /* nat_dir == NAT_INBOUND is impossible for icmp queries */ } - return(nat); + return (nat); } @@ -4108,7 +4108,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, nat->nat_ifps[0] = ifp; nat->nat_mtu[0] = GETIFMTU_4(ifp); } - return(nat); + return (nat); } /* @@ -4121,11 +4121,11 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, find_in_wild_ports: if (!(flags & NAT_TCPUDP) || !(flags & NAT_SEARCH)) { NBUMPSIDEX(0, ns_lookup_miss, ns_lookup_miss_0); - return(NULL); + return (NULL); } if (softn->ipf_nat_stats.ns_wilds == 0 || (fin->fin_flx & FI_NOWILD)) { NBUMPSIDEX(0, ns_lookup_nowild, ns_lookup_nowild_0); - return(NULL); + return (NULL); } RWLOCK_EXIT(&softc->ipf_nat); @@ -4215,7 +4215,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, if (nat == NULL) { NBUMPSIDE(0, ns_lookup_miss); } - return(nat); + return (nat); } @@ -4427,7 +4427,7 @@ ipf_nat_outlookup(fr_info_t *fin, u_int flags, u_int p, nat->nat_ifps[1] = ifp; nat->nat_mtu[1] = GETIFMTU_4(ifp); } - return(nat); + return (nat); } /* @@ -4440,11 +4440,11 @@ ipf_nat_outlookup(fr_info_t *fin, u_int flags, u_int p, find_out_wild_ports: if (!(flags & NAT_TCPUDP) || !(flags & NAT_SEARCH)) { NBUMPSIDEX(1, ns_lookup_miss, ns_lookup_miss_1); - return(NULL); + return (NULL); } if (softn->ipf_nat_stats.ns_wilds == 0 || (fin->fin_flx & FI_NOWILD)) { NBUMPSIDEX(1, ns_lookup_nowild, ns_lookup_nowild_1); - return(NULL); + return (NULL); } RWLOCK_EXIT(&softc->ipf_nat); @@ -4533,7 +4533,7 @@ ipf_nat_outlookup(fr_info_t *fin, u_int flags, u_int p, if (nat == NULL) { NBUMPSIDE(1, ns_lookup_miss); } - return(nat); + return (nat); } @@ -4614,7 +4614,7 @@ ipf_nat_lookupredir(natlookup_t *np) } } - return(nat); + return (nat); } @@ -4647,7 +4647,7 @@ ipf_nat_match(fr_info_t *fin, ipnat_t *np) } match ^= ((np->in_flags & IPN_NOTSRC) != 0); if (match) - return(0); + return (0); match = 0; switch (np->in_odstatype) @@ -4663,17 +4663,17 @@ ipf_nat_match(fr_info_t *fin, ipnat_t *np) match ^= ((np->in_flags & IPN_NOTDST) != 0); if (match) - return(0); + return (0); ft = &np->in_tuc; if (!(fin->fin_flx & FI_TCPUDP) || (fin->fin_flx & (FI_SHORT|FI_FRAGBODY))) { if (ft->ftu_scmp || ft->ftu_dcmp) - return(0); - return(1); + return (0); + return (1); } - return(ipf_tcpudpchk(&fin->fin_fi, ft)); + return (ipf_tcpudpchk(&fin->fin_fi, ft)); } @@ -4767,9 +4767,9 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) if (fin->fin_v == 6) { #ifdef USE_INET6 - return(ipf_nat6_checkout(fin, passp)); + return (ipf_nat6_checkout(fin, passp)); #else - return(0); + return (0); #endif } @@ -4777,10 +4777,10 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) softn = softc->ipf_nat_soft; if (softn->ipf_nat_lock != 0) - return(0); + return (0); if (softn->ipf_nat_stats.ns_rules == 0 && softn->ipf_nat_instances == NULL) - return(0); + return (0); natfailed = 0; fr = fin->fin_fr; @@ -4957,7 +4957,7 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) break; } fin->fin_ifp = sifp; - return(rval); + return (rval); } /* ------------------------------------------------------------------------ */ @@ -5076,7 +5076,7 @@ ipf_nat_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) skip = ipf_nat_decap(fin, nat); if (skip <= 0) { NBUMPSIDED(1, ns_decap_fail); - return(-1); + return (-1); } m = fin->fin_m; @@ -5099,7 +5099,7 @@ ipf_nat_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) fin->fin_flx |= FI_NATED; if (np != NULL && np->in_tag.ipt_num[0] != 0) fin->fin_nattag = &np->in_tag; - return(1); + return (1); /* NOTREACHED */ } @@ -5113,7 +5113,7 @@ ipf_nat_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) m = M_DUP(np->in_divmp); if (m == NULL) { NBUMPSIDED(1, ns_divert_dup); - return(-1); + return (-1); } ip = MTOD(m, ip_t *); @@ -5221,7 +5221,7 @@ ipf_nat_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) i = 1; } fin->fin_flx |= FI_NATED; - return(i); + return (i); } @@ -5260,10 +5260,10 @@ ipf_nat_checkin(fr_info_t *fin, u_32_t *passp) softn = softc->ipf_nat_soft; if (softn->ipf_nat_lock != 0) - return(0); + return (0); if (softn->ipf_nat_stats.ns_rules == 0 && softn->ipf_nat_instances == NULL) - return(0); + return (0); tcp = NULL; icmp = NULL; @@ -5442,7 +5442,7 @@ ipf_nat_checkin(fr_info_t *fin, u_32_t *passp) NBUMPSIDE(0, ns_translated); break; } - return(rval); + return (rval); } @@ -5492,7 +5492,7 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) i = ipf_proxy_check(fin, nat); if (i == -1) { NBUMPSIDED(0, ns_ipf_proxy_fail); - return(-1); + return (-1); } } } @@ -5556,7 +5556,7 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) m = M_DUP(np->in_divmp); if (m == NULL) { NBUMPSIDED(0, ns_divert_dup); - return(-1); + return (-1); } ip = MTOD(m, ip_t *); @@ -5595,7 +5595,7 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) skip = ipf_nat_decap(fin, nat); if (skip <= 0) { NBUMPSIDED(0, ns_decap_fail); - return(-1); + return (-1); } m = fin->fin_m; @@ -5617,7 +5617,7 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) fin->fin_flx |= FI_NATED; if (np != NULL && np->in_tag.ipt_num[0] != 0) fin->fin_nattag = &np->in_tag; - return(1); + return (1); /* NOTREACHED */ } } @@ -5670,7 +5670,7 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) fin->fin_flx |= FI_NATED; if (np != NULL && np->in_tag.ipt_num[0] != 0) fin->fin_nattag = &np->in_tag; - return(1); + return (1); } @@ -5753,7 +5753,7 @@ ipf_nat_proto(fr_info_t *fin, nat_t *nat, u_int nflags) } #endif } - return(csump); + return (csump); } @@ -6003,9 +6003,9 @@ ipf_nat_icmpquerytype(int icmptype) case ICMP_IREQREPLY: case ICMP_MASKREQ: case ICMP_MASKREPLY: - return(1); + return (1); default: - return(0); + return (0); } } @@ -6210,7 +6210,7 @@ ipf_nat_clone(fr_info_t *fin, nat_t *nat) KMALLOC(clone, nat_t *); if (clone == NULL) { NBUMPSIDED(fin->fin_out, ns_clone_nomem); - return(NULL); + return (NULL); } bcopy((char *)nat, (char *)clone, sizeof(*clone)); @@ -6235,7 +6235,7 @@ ipf_nat_clone(fr_info_t *fin, nat_t *nat) if (ipf_nat_insert(softc, softn, clone) == -1) { KFREE(clone); NBUMPSIDED(fin->fin_out, ns_insert_fail); - return(NULL); + return (NULL); } np = clone->nat_ptr; @@ -6264,7 +6264,7 @@ ipf_nat_clone(fr_info_t *fin, nat_t *nat) clone->nat_sync = ipf_sync_new(softc, SMC_NAT, fin, clone); if (softn->ipf_nat_logging) ipf_nat_log(softc, softn, clone, NL_CLONE); - return(clone); + return (clone); } @@ -6300,34 +6300,34 @@ ipf_nat_wildok(nat_t *nat, int sport, int dport, int flags, int dir) (flags & SI_W_SPORT)) && ((nat->nat_odport == dport) || (flags & SI_W_DPORT))) - return(1); + return (1); break; case 2: /* outbound packet / inbound entry */ if (((nat->nat_osport == dport) || (flags & SI_W_SPORT)) && ((nat->nat_odport == sport) || (flags & SI_W_DPORT))) - return(1); + return (1); break; case 1: /* inbound packet / outbound entry */ if (((nat->nat_osport == dport) || (flags & SI_W_SPORT)) && ((nat->nat_odport == sport) || (flags & SI_W_DPORT))) - return(1); + return (1); break; case 0: /* inbound packet / inbound entry */ if (((nat->nat_osport == sport) || (flags & SI_W_SPORT)) && ((nat->nat_odport == dport) || (flags & SI_W_DPORT))) - return(1); + return (1); break; default: break; } - return(0); + return (0); } @@ -6471,7 +6471,7 @@ ipf_nat_getnext(ipf_main_softc_t *softc, ipftoken_t *t, ipfgeniter_t *itp, if (itp->igi_nitems != 1) { IPFERROR(60075); - return(ENOSPC); + return (ENOSPC); } READ_ENTER(&softc->ipf_nat); @@ -6537,7 +6537,7 @@ ipf_nat_getnext(ipf_main_softc_t *softc, ipftoken_t *t, ipfgeniter_t *itp, default : RWLOCK_EXIT(&softc->ipf_nat); IPFERROR(60055); - return(EINVAL); + return (EINVAL); } RWLOCK_EXIT(&softc->ipf_nat); @@ -6583,7 +6583,7 @@ ipf_nat_getnext(ipf_main_softc_t *softc, ipftoken_t *t, ipfgeniter_t *itp, if (nnext == NULL) ipf_token_mark_complete(t); - return(error); + return (error); } @@ -6720,7 +6720,7 @@ ipf_nat_extraflush(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, int which) if (which != 2) { SPL_X(s); - return(removed); + return (removed); } softn->ipf_nat_stats.ns_flush_queue++; @@ -6745,7 +6745,7 @@ ipf_nat_extraflush(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, int which) } SPL_X(s); - return(removed); + return (removed); } @@ -6765,7 +6765,7 @@ static int ipf_nat_flush_entry(ipf_main_softc_t *softc, void *entry) { ipf_nat_delete(softc, entry, NL_FLUSH); - return(0); + return (0); } @@ -6790,7 +6790,7 @@ ipf_nat_iterator(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp, if (itp->igi_data == NULL) { IPFERROR(60052); - return(EFAULT); + return (EFAULT); } switch (itp->igi_type) @@ -6810,7 +6810,7 @@ ipf_nat_iterator(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp, break; } - return(error); + return (error); } @@ -6897,7 +6897,7 @@ ipf_nat_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) if ((src_search == 0) && (np->in_spnext == 0) && (dst_search == 0) && (np->in_dpnext == 0)) { if (l > 0) - return(-1); + return (-1); } /* @@ -6905,7 +6905,7 @@ ipf_nat_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) */ if (ipf_nat_nextaddr(fin, &np->in_nsrc, &frnat.fin_saddr, &frnat.fin_saddr) == -1) { - return(-1); + return (-1); } if ((np->in_nsrcaddr == 0) && (np->in_nsrcmsk == 0xffffffff)) { @@ -6961,7 +6961,7 @@ ipf_nat_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) if (ipf_nat_nextaddr(fin, &np->in_ndst, &frnat.fin_daddr, &frnat.fin_daddr) == -1) - return(-1); + return (-1); if ((np->in_ndstaddr == 0) && (np->in_ndstmsk == 0xffffffff)) { dst_search = 0; if (np->in_stepnext == 2) @@ -7051,7 +7051,7 @@ ipf_nat_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) DT3(ipf_nat_rewrite_2, nat_t *, natl, ipnat_t *, np , int, l); if ((natl != NULL) && (l > 8)) /* XXX 8 is arbitrary */ - return(-1); + return (-1); np->in_stepnext &= 0x3; @@ -7074,7 +7074,7 @@ ipf_nat_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) nat->nat_nicmpid = frnat.fin_data[1]; } - return(0); + return (0); } @@ -7139,7 +7139,7 @@ ipf_nat_newdivert(fr_info_t *fin, nat_t *nat, natinfo_t *nai) if (natl != NULL) { NBUMPSIDED(fin->fin_out, ns_divert_exist); DT3(ns_divert_exist, fr_info_t *, fin, nat_t *, nat, natinfo_t, nai); - return(-1); + return (-1); } nat->nat_nsrcaddr = frnat.fin_saddr; @@ -7159,7 +7159,7 @@ ipf_nat_newdivert(fr_info_t *fin, nat_t *nat, natinfo_t *nai) else nat->nat_dir = NAT_DIVERTOUT; - return(0); + return (0); } @@ -7190,7 +7190,7 @@ ipf_nat_builddivertmp(ipf_nat_softc_t *softn, ipnat_t *np) ALLOC_MB_T(np->in_divmp, len); if (np->in_divmp == NULL) { NBUMPD(ipf_nat_stats, ns_divert_build); - return(-1); + return (-1); } /* @@ -7221,7 +7221,7 @@ ipf_nat_builddivertmp(ipf_nat_softc_t *softn, ipnat_t *np) uh->uh_dport = htons(np->in_dpnext); } - return(0); + return (0); } @@ -7275,7 +7275,7 @@ ipf_nat_decap(fr_info_t *fin, nat_t *nat) ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, sumd, 0); #endif } - return(0); + return (0); } m = fin->fin_m; @@ -7286,17 +7286,17 @@ ipf_nat_decap(fr_info_t *fin, nat_t *nat) case NAT_DIVERTIN : case NAT_DIVERTOUT : if (fin->fin_plen < MINDECAP) - return(-1); + return (-1); skip += sizeof(udphdr_t); break; case NAT_ENCAPIN : case NAT_ENCAPOUT : if (fin->fin_plen < (skip + sizeof(ip_t))) - return(-1); + return (-1); break; default : - return(-1); + return (-1); /* NOTREACHED */ } @@ -7307,7 +7307,7 @@ ipf_nat_decap(fr_info_t *fin, nat_t *nat) */ if (M_LEN(m) < skip + sizeof(ip_t)) { if (ipf_pr_pullup(fin, skip + sizeof(ip_t)) == -1) - return(-1); + return (-1); } hdr = MTOD(fin->fin_m, char *); @@ -7316,7 +7316,7 @@ ipf_nat_decap(fr_info_t *fin, nat_t *nat) if (ipf_pr_pullup(fin, skip + hlen) == -1) { NBUMPSIDED(fin->fin_out, ns_decap_pullup); - return(-1); + return (-1); } fin->fin_hlen = hlen; @@ -7326,10 +7326,10 @@ ipf_nat_decap(fr_info_t *fin, nat_t *nat) if (ipf_makefrip(hlen, (ip_t *)hdr, fin) == -1) { NBUMPSIDED(fin->fin_out, ns_decap_bad); - return(-1); + return (-1); } - return(skip); + return (skip); } @@ -7384,7 +7384,7 @@ ipf_nat_nextaddr(fr_info_t *fin, nat_addr_t *na, u_32_t *old, u_32_t *dst) case FRI_NETWORK : default : DT4(ns_na_atype, fr_info_t *, fin, nat_addr_t *, na, u_32_t *, old, u_32_t *, new); - return(-1); + return (-1); } error = -1; @@ -7415,7 +7415,7 @@ ipf_nat_nextaddr(fr_info_t *fin, nat_addr_t *na, u_32_t *old, u_32_t *dst) fin->fin_ifp, &newip, NULL) == -1) { NBUMPSIDED(fin->fin_out, ns_ifpaddrfail); DT4(ns_ifpaddrfail, fr_info_t *, fin, nat_addr_t *, na, u_32_t *, old, u_32_t *, new); - return(-1); + return (-1); } new = newip.in4.s_addr; } else { @@ -7429,7 +7429,7 @@ ipf_nat_nextaddr(fr_info_t *fin, nat_addr_t *na, u_32_t *old, u_32_t *dst) DT4(ns_badnextaddr_2, fr_info_t *, fin, nat_addr_t *, na, u_32_t *, old, u_32_t *, new); } - return(error); + return (error); } @@ -7474,11 +7474,11 @@ ipf_nat_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, } if (na->na_func == NULL) { IPFERROR(60060); - return(ESRCH); + return (ESRCH); } if (na->na_ptr == NULL) { IPFERROR(60056); - return(ESRCH); + return (ESRCH); } break; @@ -7500,7 +7500,7 @@ ipf_nat_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, case FRI_NONE : na->na_addr[0].in4.s_addr &= na->na_addr[1].in4.s_addr; - return(0); + return (0); case FRI_NORMAL : na->na_addr[0].in4.s_addr &= na->na_addr[1].in4.s_addr; @@ -7508,14 +7508,14 @@ ipf_nat_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, default : IPFERROR(60054); - return(EINVAL); + return (EINVAL); } if (initial && (na->na_atype == FRI_NORMAL)) { if (na->na_addr[0].in4.s_addr == 0) { if ((na->na_addr[1].in4.s_addr == 0xffffffff) || (na->na_addr[1].in4.s_addr == 0)) { - return(0); + return (0); } } @@ -7526,7 +7526,7 @@ ipf_nat_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, } } - return(0); + return (0); } @@ -7548,7 +7548,7 @@ ipf_nat_matchflush(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, error = ipf_matcharray_load(softc, data, &obj, &array); if (error != 0) - return(error); + return (error); flushed = 0; @@ -7565,7 +7565,7 @@ ipf_nat_matchflush(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, KFREES(array, array[0] * sizeof(*array)); - return(error); + return (error); } @@ -7755,7 +7755,7 @@ ipf_nat_matcharray(nat_t *nat, int *array, u_long ticks) break; } - return(e); + return (e); } @@ -7777,7 +7777,7 @@ ipf_nat_gettable(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, char *data) error = ipf_inobj(softc, data, NULL, &table, IPFOBJ_GTABLE); if (error != 0) - return(error); + return (error); switch (table.ita_type) { @@ -7795,14 +7795,14 @@ ipf_nat_gettable(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, char *data) default : IPFERROR(60058); - return(EINVAL); + return (EINVAL); } if (error != 0) { IPFERROR(60059); error = EFAULT; } - return(error); + return (error); } @@ -7822,7 +7822,7 @@ ipf_nat_settimeout(struct ipf_main_softc_s *softc, ipftuneable_t *t, ipf_nat_softc_t *softn = softc->ipf_nat_soft; if (!strncmp(t->ipft_name, "tcp_", 4)) - return(ipf_settimeout_tcp(t, p, softn->ipf_nat_tcptq)); + return (ipf_settimeout_tcp(t, p, softn->ipf_nat_tcptq)); if (!strcmp(t->ipft_name, "udp_timeout")) { ipf_apply_timeout(&softn->ipf_nat_udptq, p->ipftu_int); @@ -7836,9 +7836,9 @@ ipf_nat_settimeout(struct ipf_main_softc_s *softc, ipftuneable_t *t, ipf_apply_timeout(&softn->ipf_nat_iptq, p->ipftu_int); } else { IPFERROR(60062); - return(ESRCH); + return (ESRCH); } - return(0); + return (0); } @@ -7872,7 +7872,7 @@ ipf_nat_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, ipftuneval_t *p) * In case there is nothing to do... */ if (newsize == softn->ipf_nat_table_sz) - return(0); + return (0); newtab[0] = NULL; newtab[1] = NULL; @@ -8007,7 +8007,7 @@ ipf_nat_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, ipftuneval_t *p) } RWLOCK_EXIT(&softc->ipf_nat); - return(0); + return (0); badrehash: if (bucketlens[1] != NULL) { @@ -8023,7 +8023,7 @@ ipf_nat_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, ipftuneval_t *p) KFREES(newtab[1], newsize * sizeof(nat_t *)); } IPFERROR(error); - return(ENOMEM); + return (ENOMEM); } @@ -8054,7 +8054,7 @@ ipf_nat_rehash_rules(ipf_main_softc_t *softc, ipftuneable_t *t, * In case there is nothing to do... */ if (newsize == *t->ipft_pint) - return(0); + return (0); /* * All inbound rules have the NAT_REDIRECT bit set in in_redir and @@ -8073,7 +8073,7 @@ ipf_nat_rehash_rules(ipf_main_softc_t *softc, ipftuneable_t *t, KMALLOCS(newtab, ipnat_t **, newsize * sizeof(ipnat_t *)); if (newtab == NULL) { IPFERROR(60067); - return(ENOMEM); + return (ENOMEM); } bzero((char *)newtab, newsize * sizeof(ipnat_t *)); @@ -8110,7 +8110,7 @@ ipf_nat_rehash_rules(ipf_main_softc_t *softc, ipftuneable_t *t, } RWLOCK_EXIT(&softc->ipf_nat); - return(0); + return (0); } @@ -8138,12 +8138,12 @@ ipf_nat_hostmap_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, * In case there is nothing to do... */ if (newsize == *t->ipft_pint) - return(0); + return (0); KMALLOCS(newtab, hostmap_t **, newsize * sizeof(hostmap_t *)); if (newtab == NULL) { IPFERROR(60068); - return(ENOMEM); + return (ENOMEM); } bzero((char *)newtab, newsize * sizeof(hostmap_t *)); @@ -8166,7 +8166,7 @@ ipf_nat_hostmap_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, } RWLOCK_EXIT(&softc->ipf_nat); - return(0); + return (0); } @@ -8180,7 +8180,7 @@ ipf_nat_add_tq(ipf_main_softc_t *softc, int ttl) { ipf_nat_softc_t *softs = softc->ipf_nat_soft; - return(ipf_addtimeoutqueue(softc, &softs->ipf_nat_utqe, ttl)); + return (ipf_addtimeoutqueue(softc, &softs->ipf_nat_utqe, ttl)); } /* ------------------------------------------------------------------------ */ @@ -8254,44 +8254,44 @@ static int ipf_nat_cmp_rules(ipnat_t *n1, ipnat_t *n2) { if (n1->in_size != n2->in_size) - return(1); + return (1); if (bcmp((char *)&n1->in_v, (char *)&n2->in_v, offsetof(ipnat_t, in_ndst) - offsetof(ipnat_t, in_v)) != 0) - return(2); + return (2); if (bcmp((char *)&n1->in_tuc, (char *)&n2->in_tuc, n1->in_size - offsetof(ipnat_t, in_tuc)) != 0) - return(3); + return (3); if (n1->in_ndst.na_atype != n2->in_ndst.na_atype) - return(5); + return (5); if (n1->in_ndst.na_function != n2->in_ndst.na_function) - return(6); + return (6); if (bcmp((char *)&n1->in_ndst.na_addr, (char *)&n2->in_ndst.na_addr, sizeof(n1->in_ndst.na_addr))) - return(7); + return (7); if (n1->in_nsrc.na_atype != n2->in_nsrc.na_atype) - return(8); + return (8); if (n1->in_nsrc.na_function != n2->in_nsrc.na_function) - return(9); + return (9); if (bcmp((char *)&n1->in_nsrc.na_addr, (char *)&n2->in_nsrc.na_addr, sizeof(n1->in_nsrc.na_addr))) - return(10); + return (10); if (n1->in_odst.na_atype != n2->in_odst.na_atype) - return(11); + return (11); if (n1->in_odst.na_function != n2->in_odst.na_function) - return(12); + return (12); if (bcmp((char *)&n1->in_odst.na_addr, (char *)&n2->in_odst.na_addr, sizeof(n1->in_odst.na_addr))) - return(13); + return (13); if (n1->in_osrc.na_atype != n2->in_osrc.na_atype) - return(14); + return (14); if (n1->in_osrc.na_function != n2->in_osrc.na_function) - return(15); + return (15); if (bcmp((char *)&n1->in_osrc.na_addr, (char *)&n2->in_osrc.na_addr, sizeof(n1->in_osrc.na_addr))) - return(16); - return(0); + return (16); + return (0); } @@ -8334,13 +8334,13 @@ ipf_nat_rule_init(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, case 4 : error = ipf_nat_ruleaddrinit(softc, softn, n); if (error != 0) - return(error); + return (error); break; #ifdef USE_INET6 case 6 : error = ipf_nat6_ruleaddrinit(softc, softn, n); if (error != 0) - return(error); + return (error); break; #endif default : @@ -8357,7 +8357,7 @@ ipf_nat_rule_init(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, n->in_ifps[1], &n->in_ndstip6); } - return(error); + return (error); } diff --git a/sys/netpfil/ipfilter/netinet/ip_nat6.c b/sys/netpfil/ipfilter/netinet/ip_nat6.c index a894b8e56eca..c8b61afa25bc 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat6.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat6.c @@ -172,26 +172,26 @@ ipf_nat6_ruleaddrinit(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, error = ipf_nat6_nextaddrinit(softc, n->in_names, &n->in_osrc, 1, n->in_ifps[idx]); if (error != 0) - return(error); + return (error); error = ipf_nat6_nextaddrinit(softc, n->in_names, &n->in_odst, 1, n->in_ifps[idx]); if (error != 0) - return(error); + return (error); error = ipf_nat6_nextaddrinit(softc, n->in_names, &n->in_nsrc, 1, n->in_ifps[idx]); if (error != 0) - return(error); + return (error); error = ipf_nat6_nextaddrinit(softc, n->in_names, &n->in_ndst, 1, n->in_ifps[idx]); if (error != 0) - return(error); + return (error); if (n->in_redir & NAT_DIVERTUDP) ipf_nat6_builddivertmp(softn, n); - return(0); + return (0); } @@ -385,12 +385,12 @@ ipf_nat6_hostmap(ipf_nat_softc_t *softn, ipnat_t *np, ((port == 0) || (port == hm->hm_port))) { softn->ipf_nat_stats.ns_hm_addref++; hm->hm_ref++; - return(hm); + return (hm); } if (np == NULL) { softn->ipf_nat_stats.ns_hm_nullnp++; - return(NULL); + return (NULL); } KMALLOC(hm, hostmap_t *); @@ -422,7 +422,7 @@ ipf_nat6_hostmap(ipf_nat_softc_t *softn, ipnat_t *np, } else { softn->ipf_nat_stats.ns_hm_newfail++; } - return(hm); + return (hm); } @@ -497,7 +497,7 @@ ipf_nat6_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) if (IP6_ISONES(&np->in_nsrcmsk6) && (np->in_spnext == 0)) { if (l > 0) { NBUMPSIDE6DX(1, ns_exhausted, ns_exhausted_1); - return(-1); + return (-1); } } @@ -523,7 +523,7 @@ ipf_nat6_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) if ((l >= np->in_ppip) || ((l > 0) && !(flags & IPN_TCPUDP))) { NBUMPSIDE6DX(1, ns_exhausted, ns_exhausted_2); - return(-1); + return (-1); } /* * map-block - Calculate destination address. @@ -558,7 +558,7 @@ ipf_nat6_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) &in, NULL) == -1) { NBUMPSIDE6DX(1, ns_new_ifpaddr, ns_new_ifpaddr_1); - return(-1); + return (-1); } } else if (IP6_ISZERO(&np->in_nsrcip6) && @@ -568,7 +568,7 @@ ipf_nat6_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) */ if (l > 0) { NBUMPSIDE6DX(1, ns_exhausted, ns_exhausted_3); - return(-1); + return (-1); } in = fin->fin_src6; @@ -675,7 +675,7 @@ ipf_nat6_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) (!IP6_ISZERO(&np->in_snip6) && IP6_EQ(&st_ip, &np->in_snip6))) { NBUMPSIDE6D(1, ns_wrap); - return(-1); + return (-1); } l++; } while (natl != NULL); @@ -701,7 +701,7 @@ ipf_nat6_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni) ((struct icmp6_hdr *)fin->fin_dp)->icmp6_id = port; nat->nat_nicmpid = port; } - return(0); + return (0); } @@ -806,7 +806,7 @@ ipf_nat6_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) if (ipf_ifpaddr(softc, 6, FRI_NORMAL, fin->fin_ifp, &in, NULL) == -1) { NBUMPSIDE6DX(0, ns_new_ifpaddr, ns_new_ifpaddr_2); - return(-1); + return (-1); } } else if (IP6_ISZERO(&np->in_ndstip6) && @@ -859,7 +859,7 @@ ipf_nat6_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) if (IP6_ISZERO(&in)) { if (nport == dport) { NBUMPSIDE6D(0, ns_xlate_null); - return(-1); + return (-1); } in = fin->fin_dst6; } @@ -880,7 +880,7 @@ ipf_nat6_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) fin->fin_data[1] = dp; if (natl != NULL) { NBUMPSIDE6D(0, ns_xlate_exists); - return(-1); + return (-1); } nat->nat_ndst6 = in; @@ -904,7 +904,7 @@ ipf_nat6_newrdr(fr_info_t *fin, nat_t *nat, natinfo_t *ni) nat->nat_nicmpid = nport; } - return(move); + return (move); } /* ------------------------------------------------------------------------ */ @@ -954,7 +954,7 @@ ipf_nat6_add(fr_info_t *fin, ipnat_t *np, nat_t **natsave, u_int flags, if (nsp->ns_active >= softn->ipf_nat_table_max) { NBUMPSIDE6(fin->fin_out, ns_table_max); - return(NULL); + return (NULL); } move = 1; @@ -981,7 +981,7 @@ ipf_nat6_add(fr_info_t *fin, ipnat_t *np, nat_t **natsave, u_int flags, printf("table_max reduced to %d\n", softn->ipf_nat_table_max); } - return(NULL); + return (NULL); } if (flags & IPN_ICMPQUERY) { @@ -1111,7 +1111,7 @@ ipf_nat6_add(fr_info_t *fin, ipnat_t *np, nat_t **natsave, u_int flags, np->in_hits++; if (natsave != NULL) *natsave = nat; - return(nat); + return (nat); } @@ -1221,7 +1221,7 @@ ipf_nat6_finalise(fr_info_t *fin, nat_t *nat) fr->fr_ref++; MUTEX_EXIT(&fr->fr_lock); } - return(0); + return (0); } NBUMPSIDE6D(fin->fin_out, ns_unfinalised); @@ -1230,7 +1230,7 @@ ipf_nat6_finalise(fr_info_t *fin, nat_t *nat) */ if (nat->nat_sync != NULL) ipf_sync_del_nat(softc->ipf_sync_soft, nat->nat_sync); - return(-1); + return (-1); } @@ -1339,7 +1339,7 @@ ipf_nat6_insert(ipf_main_softc_t *softc, ipf_nat_softc_t *softn, nat_t *nat) nat->nat_mtu[1] = GETIFMTU_6(nat->nat_ifps[1]); } - return(ipf_nat_hashtab_add(softc, softn, nat)); + return (ipf_nat_hashtab_add(softc, softn, nat)); } @@ -1372,13 +1372,13 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) type = icmp6->icmp6_type; nside = &softn->ipf_nat_stats.ns_side6[fin->fin_out]; /* - * Does it at least have the return(basic) IP header ? + * Does it at least have the return (basic) IP header ? * Only a basic IP header (no options) should be with an ICMP error * header. Also, if it's not an error type, then return. */ if (!(fin->fin_flx & FI_ICMPERR)) { ATOMIC_INCL(nside->ns_icmp_basic); - return(NULL); + return (NULL); } /* @@ -1386,7 +1386,7 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) */ if (fin->fin_plen < ICMP6ERR_IPICMPHLEN) { ATOMIC_INCL(nside->ns_icmp_size); - return(NULL); + return (NULL); } oip6 = (ip6_t *)((char *)fin->fin_dp + 8); @@ -1408,13 +1408,13 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) if ((char *)oip6 + fin->fin_dlen - ICMPERR_ICMPHLEN > (char *)m->b_wptr) { ATOMIC_INCL(nside->ns_icmp_mbuf); - return(NULL); + return (NULL); } # else if ((char *)oip6 + fin->fin_dlen - ICMPERR_ICMPHLEN > (char *)fin->fin_ip + M_LEN(m)) { ATOMIC_INCL(nside->ns_icmp_mbuf); - return(NULL); + return (NULL); } # endif } @@ -1422,7 +1422,7 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) if (IP6_NEQ(&fin->fin_dst6, &oip6->ip6_src)) { ATOMIC_INCL(nside->ns_icmp_address); - return(NULL); + return (NULL); } p = oip6->ip6_nxt; @@ -1456,7 +1456,7 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) &oip6->ip6_src); fin->fin_data[0] = data[0]; fin->fin_data[1] = data[1]; - return(nat); + return (nat); } } @@ -1465,7 +1465,7 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) /* TRACE (fin,minlen) */ if (fin->fin_plen < ICMPERR_IPICMPHLEN + minlen) { ATOMIC_INCL(nside->ns_icmp_short); - return(NULL); + return (NULL); } data[0] = fin->fin_data[0]; @@ -1483,7 +1483,7 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) } fin->fin_data[0] = data[0]; fin->fin_data[1] = data[1]; - return(nat); + return (nat); } if (dir == NAT_INBOUND) nat = ipf_nat6_inlookup(fin, 0, p, &oip6->ip6_dst, @@ -1492,7 +1492,7 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) nat = ipf_nat6_outlookup(fin, 0, p, &oip6->ip6_dst, &oip6->ip6_src); - return(nat); + return (nat); } @@ -1531,7 +1531,7 @@ ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) r += ds[i]; } - return(r); + return (r); } @@ -1565,7 +1565,7 @@ ipf_nat6_icmperror(fr_info_t *fin, u_int *nflags, int dir) if ((fin->fin_flx & (FI_SHORT|FI_FRAGBODY))) { NBUMPSIDE6D(fin->fin_out, ns_icmp_short); - return(NULL); + return (NULL); } /* @@ -1573,7 +1573,7 @@ ipf_nat6_icmperror(fr_info_t *fin, u_int *nflags, int dir) */ if ((fin->fin_v != 6) || !(nat = ipf_nat6_icmperrorlookup(fin, dir))) { NBUMPSIDE6D(fin->fin_out, ns_icmp_notfound); - return(NULL); + return (NULL); } tcp = NULL; @@ -1827,7 +1827,7 @@ ipf_nat6_icmperror(fr_info_t *fin, u_int *nflags, int dir) } } /* nat6_dir == NAT_INBOUND is impossible for icmp queries */ } - return(nat); + return (nat); } @@ -1976,7 +1976,7 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, nat->nat_ifps[0] = ifp; nat->nat_mtu[0] = GETIFMTU_6(ifp); } - return(nat); + return (nat); } /* @@ -1989,11 +1989,11 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, find_in_wild_ports: if (!(flags & NAT_TCPUDP) || !(flags & NAT_SEARCH)) { NBUMPSIDE6DX(0, ns_lookup_miss, ns_lookup_miss_1); - return(NULL); + return (NULL); } if (softn->ipf_nat_stats.ns_wilds == 0 || (fin->fin_flx & FI_NOWILD)) { NBUMPSIDE6D(0, ns_lookup_nowild); - return(NULL); + return (NULL); } RWLOCK_EXIT(&softc->ipf_nat); @@ -2083,7 +2083,7 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, if (nat == NULL) { NBUMPSIDE6DX(0, ns_lookup_miss, ns_lookup_miss_2); } - return(nat); + return (nat); } @@ -2289,7 +2289,7 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, nat->nat_ifps[1] = ifp; nat->nat_mtu[1] = GETIFMTU_6(ifp); } - return(nat); + return (nat); } /* @@ -2302,11 +2302,11 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, find_out_wild_ports: if (!(flags & NAT_TCPUDP) || !(flags & NAT_SEARCH)) { NBUMPSIDE6DX(1, ns_lookup_miss, ns_lookup_miss_3); - return(NULL); + return (NULL); } if (softn->ipf_nat_stats.ns_wilds == 0 || (fin->fin_flx & FI_NOWILD)) { NBUMPSIDE6D(1, ns_lookup_nowild); - return(NULL); + return (NULL); } RWLOCK_EXIT(&softc->ipf_nat); @@ -2395,7 +2395,7 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, if (nat == NULL) { NBUMPSIDE6DX(1, ns_lookup_miss, ns_lookup_miss_4); } - return(nat); + return (nat); } @@ -2479,7 +2479,7 @@ ipf_nat6_lookupredir(natlookup_t *np) } } - return(nat); + return (nat); } @@ -2513,7 +2513,7 @@ ipf_nat6_match(fr_info_t *fin, ipnat_t *np) } match ^= ((np->in_flags & IPN_NOTSRC) != 0); if (match) - return(0); + return (0); match = 0; switch (np->in_odstatype) @@ -2530,17 +2530,17 @@ ipf_nat6_match(fr_info_t *fin, ipnat_t *np) match ^= ((np->in_flags & IPN_NOTDST) != 0); if (match) - return(0); + return (0); ft = &np->in_tuc; if (!(fin->fin_flx & FI_TCPUDP) || (fin->fin_flx & (FI_SHORT|FI_FRAGBODY))) { if (ft->ftu_scmp || ft->ftu_dcmp) - return(0); - return(1); + return (0); + return (1); } - return(ipf_tcpudpchk(&fin->fin_fi, ft)); + return (ipf_tcpudpchk(&fin->fin_fi, ft)); } @@ -2576,7 +2576,7 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) nat_t *nat; if (softn->ipf_nat_stats.ns_rules == 0 || softn->ipf_nat_lock != 0) - return(0); + return (0); icmp6 = NULL; natfailed = 0; @@ -2607,7 +2607,7 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) * so as to keep IPv6 working. */ if (icmp6->icmp6_type > ICMP6_ECHO_REPLY) - return(0); + return (0); /* * This is an incoming packet, so the destination is @@ -2743,7 +2743,7 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) break; } fin->fin_ifp = sifp; - return(rval); + return (rval); } /* ------------------------------------------------------------------------ */ @@ -2804,7 +2804,7 @@ ipf_nat6_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) skip = ipf_nat6_decap(fin, nat); if (skip <= 0) { NBUMPSIDE6D(1, ns_decap_fail); - return(-1); + return (-1); } m = fin->fin_m; @@ -2827,7 +2827,7 @@ ipf_nat6_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) fin->fin_flx |= FI_NATED; if (np != NULL && np->in_tag.ipt_num[0] != 0) fin->fin_nattag = &np->in_tag; - return(1); + return (1); /* NOTREACHED */ } @@ -2840,7 +2840,7 @@ ipf_nat6_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) m = M_DUP(np->in_divmp); if (m == NULL) { NBUMPSIDE6D(1, ns_divert_dup); - return(-1); + return (-1); } ip6 = MTOD(m, ip6_t *); @@ -2934,7 +2934,7 @@ ipf_nat6_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) i = 1; } fin->fin_flx |= FI_NATED; - return(i); + return (i); } @@ -2969,7 +2969,7 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) nat_t *nat; if (softn->ipf_nat_stats.ns_rules == 0 || softn->ipf_nat_lock != 0) - return(0); + return (0); tcp = NULL; icmp6 = NULL; @@ -2997,7 +2997,7 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) * so as to keep IPv6 working. */ if (icmp6->icmp6_type > ICMP6_ECHO_REPLY) - return(0); + return (0); /* * This is an incoming packet, so the destination is @@ -3135,7 +3135,7 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) NBUMPSIDE6D(0, ns_translated); break; } - return(rval); + return (rval); } @@ -3186,7 +3186,7 @@ ipf_nat6_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) i = ipf_proxy_check(fin, nat); if (i == -1) { NBUMPSIDE6D(0, ns_ipf_proxy_fail); - return(-1); + return (-1); } } } @@ -3233,7 +3233,7 @@ ipf_nat6_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) m = M_DUP(np->in_divmp); if (m == NULL) { NBUMPSIDE6D(0, ns_divert_dup); - return(-1); + return (-1); } ip6 = MTOD(m, ip6_t *); @@ -3260,7 +3260,7 @@ ipf_nat6_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) skip = ipf_nat6_decap(fin, nat); if (skip <= 0) { NBUMPSIDE6D(0, ns_decap_fail); - return(-1); + return (-1); } m = fin->fin_m; @@ -3281,7 +3281,7 @@ ipf_nat6_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) fin->fin_flx |= FI_NATED; if (np != NULL && np->in_tag.ipt_num[0] != 0) fin->fin_nattag = &np->in_tag; - return(1); + return (1); /* NOTREACHED */ } } @@ -3330,7 +3330,7 @@ ipf_nat6_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) fin->fin_flx |= FI_NATED; if (np != NULL && np->in_tag.ipt_num[0] != 0) fin->fin_nattag = &np->in_tag; - return(1); + return (1); } @@ -3380,7 +3380,7 @@ ipf_nat6_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) if ((src_search == 0) && (np->in_spnext == 0) && (dst_search == 0) && (np->in_dpnext == 0)) { if (l > 0) - return(-1); + return (-1); } /* @@ -3388,7 +3388,7 @@ ipf_nat6_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) */ if (ipf_nat6_nextaddr(fin, &np->in_nsrc, &frnat.fin_src6, &frnat.fin_src6) == -1) { - return(-1); + return (-1); } if (IP6_ISZERO(&np->in_nsrcip6) && @@ -3445,7 +3445,7 @@ ipf_nat6_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) if (ipf_nat6_nextaddr(fin, &np->in_ndst, &frnat.fin_dst6, &frnat.fin_dst6) == -1) - return(-1); + return (-1); if (IP6_ISZERO(&np->in_ndstip6) && IP6_ISONES(&np->in_ndstmsk6)) { @@ -3538,7 +3538,7 @@ ipf_nat6_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) /* TRACE natl, in_stepnext, l */ if ((natl != NULL) && (l > 8)) /* XXX 8 is arbitrary */ - return(-1); + return (-1); np->in_stepnext &= 0x3; @@ -3560,7 +3560,7 @@ ipf_nat6_newrewrite(fr_info_t *fin, nat_t *nat, natinfo_t *nai) nat->nat_nicmpid = frnat.fin_data[1]; } - return(0); + return (0); } @@ -3620,7 +3620,7 @@ ipf_nat6_newdivert(fr_info_t *fin, nat_t *nat, natinfo_t *nai) if (natl != NULL) { NBUMPSIDE6D(fin->fin_out, ns_divert_exist); - return(-1); + return (-1); } nat->nat_nsrc6 = frnat.fin_src6; @@ -3637,7 +3637,7 @@ ipf_nat6_newdivert(fr_info_t *fin, nat_t *nat, natinfo_t *nai) else nat->nat_dir = NAT_DIVERTOUT; - return(0); + return (0); } @@ -3667,7 +3667,7 @@ ipf_nat6_builddivertmp(ipf_nat_softc_t *softn, ipnat_t *np) ALLOC_MB_T(np->in_divmp, len); if (np->in_divmp == NULL) { ATOMIC_INCL(softn->ipf_nat_stats.ns_divert_build); - return(-1); + return (-1); } /* @@ -3692,7 +3692,7 @@ ipf_nat6_builddivertmp(ipf_nat_softc_t *softn, ipnat_t *np) uh->uh_dport = htons(np->in_dpnext); } - return(0); + return (0); } @@ -3723,7 +3723,7 @@ ipf_nat6_decap(fr_info_t *fin, nat_t *nat) mb_t *m; if ((fin->fin_flx & FI_ICMPERR) != 0) { - return(0); + return (0); } m = fin->fin_m; @@ -3734,17 +3734,17 @@ ipf_nat6_decap(fr_info_t *fin, nat_t *nat) case NAT_DIVERTIN : case NAT_DIVERTOUT : if (fin->fin_plen < MINDECAP) - return(-1); + return (-1); skip += sizeof(udphdr_t); break; case NAT_ENCAPIN : case NAT_ENCAPOUT : if (fin->fin_plen < (skip + sizeof(ip6_t))) - return(-1); + return (-1); break; default : - return(-1); + return (-1); /* NOTREACHED */ } @@ -3755,7 +3755,7 @@ ipf_nat6_decap(fr_info_t *fin, nat_t *nat) */ if (M_LEN(m) < skip + sizeof(ip6_t)) { if (ipf_pr_pullup(fin, skip + sizeof(ip6_t)) == -1) - return(-1); + return (-1); } hdr = MTOD(fin->fin_m, char *); @@ -3763,7 +3763,7 @@ ipf_nat6_decap(fr_info_t *fin, nat_t *nat) if (ipf_pr_pullup(fin, skip + sizeof(ip6_t)) == -1) { NBUMPSIDE6D(fin->fin_out, ns_decap_pullup); - return(-1); + return (-1); } fin->fin_hlen = sizeof(ip6_t); @@ -3773,10 +3773,10 @@ ipf_nat6_decap(fr_info_t *fin, nat_t *nat) if (ipf_makefrip(sizeof(ip6_t), (ip_t *)hdr, fin) == -1) { NBUMPSIDE6D(fin->fin_out, ns_decap_bad); - return(-1); + return (-1); } - return(skip); + return (skip); } @@ -3833,7 +3833,7 @@ ipf_nat6_nextaddr(fr_info_t *fin, nat_addr_t *na, i6addr_t *old, i6addr_t *dst) case FRI_PEERADDR : case FRI_NETWORK : default : - return(-1); + return (-1); } error = -1; @@ -3860,7 +3860,7 @@ ipf_nat6_nextaddr(fr_info_t *fin, nat_addr_t *na, i6addr_t *old, i6addr_t *dst) if (ipf_ifpaddr(softc, 6, na->na_atype, fin->fin_ifp, &newip, NULL) == -1) { NBUMPSIDE6(fin->fin_out, ns_ifpaddrfail); - return(-1); + return (-1); } new = newip; } else { @@ -3875,7 +3875,7 @@ ipf_nat6_nextaddr(fr_info_t *fin, nat_addr_t *na, i6addr_t *old, i6addr_t *dst) break; } - return(error); + return (error); } @@ -3919,11 +3919,11 @@ ipf_nat6_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, } if (na->na_func == NULL) { IPFERROR(60072); - return(ESRCH); + return (ESRCH); } if (na->na_ptr == NULL) { IPFERROR(60073); - return(ESRCH); + return (ESRCH); } break; case FRI_DYNAMIC : @@ -3945,7 +3945,7 @@ ipf_nat6_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, case FRI_NONE : IP6_ANDASSIGN(&na->na_addr[0].in6, &na->na_addr[1].in6); - return(0); + return (0); case FRI_NORMAL : IP6_ANDASSIGN(&na->na_addr[0].in6, &na->na_addr[1].in6); @@ -3953,14 +3953,14 @@ ipf_nat6_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, default : IPFERROR(60074); - return(EINVAL); + return (EINVAL); } if (initial && (na->na_atype == FRI_NORMAL)) { if (IP6_ISZERO(&na->na_addr[0].in6)) { if (IP6_ISONES(&na->na_addr[1].in6) || IP6_ISZERO(&na->na_addr[1].in6)) { - return(0); + return (0); } } @@ -3970,7 +3970,7 @@ ipf_nat6_nextaddrinit(ipf_main_softc_t *softc, char *base, nat_addr_t *na, } } - return(0); + return (0); } @@ -4010,9 +4010,9 @@ ipf_nat6_icmpquerytype(int icmptype) case ICMP6_WRUREPLY: case MLD6_MTRACE_RESP: case MLD6_MTRACE: - return(1); + return (1); default: - return(0); + return (0); } } #endif /* USE_INET6 */ diff --git a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c index 8291219e7370..2ad642adfbcd 100644 --- a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c @@ -84,7 +84,7 @@ ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) * no net bios datagram could possibly be shorter than this */ if (dlen < 11) - return(0); + return (0); ip = fin->fin_ip; udp = (udphdr_t *)fin->fin_dp; @@ -112,5 +112,5 @@ ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) /* replace data in packet */ COPYBACK(m, off, sizeof(dgmbuf), dgmbuf); - return(0); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/ip_pool.c b/sys/netpfil/ipfilter/netinet/ip_pool.c index 59adb1a930b2..a617e6cf19de 100644 --- a/sys/netpfil/ipfilter/netinet/ip_pool.c +++ b/sys/netpfil/ipfilter/netinet/ip_pool.c @@ -228,7 +228,7 @@ main(int argc, char *argv[]) ipf_pool_fini(); - return(0); + return (0); } @@ -261,7 +261,7 @@ ipf_pool_soft_create(ipf_main_softc_t *softc) KMALLOC(softp, ipf_pool_softc_t *); if (softp == NULL) { IPFERROR(70032); - return(NULL); + return (NULL); } bzero((char *)softp, sizeof(*softp)); @@ -270,10 +270,10 @@ ipf_pool_soft_create(ipf_main_softc_t *softc) if (softp->ipf_radix == NULL) { IPFERROR(70033); KFREE(softp); - return(NULL); + return (NULL); } - return(softp); + return (softp); } @@ -292,7 +292,7 @@ ipf_pool_soft_init(ipf_main_softc_t *softc, void *arg) ipf_rx_init(softp->ipf_radix); - return(0); + return (0); } @@ -366,26 +366,26 @@ ipf_pool_node_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, if (op->iplo_size != sizeof(node)) { IPFERROR(70014); - return(EINVAL); + return (EINVAL); } err = COPYIN(op->iplo_struct, &node, sizeof(node)); if (err != 0) { IPFERROR(70015); - return(EFAULT); + return (EFAULT); } p = ipf_pool_find(arg, op->iplo_unit, op->iplo_name); if (p == NULL) { IPFERROR(70017); - return(ESRCH); + return (ESRCH); } if (node.ipn_addr.adf_family == AF_INET) { if (node.ipn_addr.adf_len != offsetof(addrfamily_t, adf_addr) + sizeof(struct in_addr)) { IPFERROR(70028); - return(EINVAL); + return (EINVAL); } } #ifdef USE_INET6 @@ -393,13 +393,13 @@ ipf_pool_node_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, if (node.ipn_addr.adf_len != offsetof(addrfamily_t, adf_addr) + sizeof(struct in6_addr)) { IPFERROR(70034); - return(EINVAL); + return (EINVAL); } } #endif if (node.ipn_mask.adf_len != node.ipn_addr.adf_len) { IPFERROR(70029); - return(EINVAL); + return (EINVAL); } /* @@ -410,7 +410,7 @@ ipf_pool_node_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, node.ipn_mask.adf_addr.in4.s_addr) != node.ipn_addr.adf_addr.in4.s_addr) { IPFERROR(70035); - return(EINVAL); + return (EINVAL); } } #ifdef USE_INET6 @@ -419,7 +419,7 @@ ipf_pool_node_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, &node.ipn_mask.adf_addr.in6, &node.ipn_addr.adf_addr.in6)) { IPFERROR(70036); - return(EINVAL); + return (EINVAL); } } #endif @@ -432,11 +432,11 @@ ipf_pool_node_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, m = ipf_pool_findeq(arg, p, &node.ipn_addr, &node.ipn_mask); if (m != NULL) { IPFERROR(70018); - return(EEXIST); + return (EEXIST); } err = ipf_pool_insert_node(softc, arg, p, &node); - return(err); + return (err); } @@ -459,21 +459,21 @@ ipf_pool_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, if (op->iplo_size != sizeof(node)) { IPFERROR(70019); - return(EINVAL); + return (EINVAL); } node.ipn_uid = uid; err = COPYIN(op->iplo_struct, &node, sizeof(node)); if (err != 0) { IPFERROR(70020); - return(EFAULT); + return (EFAULT); } if (node.ipn_addr.adf_family == AF_INET) { if (node.ipn_addr.adf_len != offsetof(addrfamily_t, adf_addr) + sizeof(struct in_addr)) { IPFERROR(70030); - return(EINVAL); + return (EINVAL); } } #ifdef USE_INET6 @@ -481,35 +481,35 @@ ipf_pool_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op, if (node.ipn_addr.adf_len != offsetof(addrfamily_t, adf_addr) + sizeof(struct in6_addr)) { IPFERROR(70037); - return(EINVAL); + return (EINVAL); } } #endif if (node.ipn_mask.adf_len != node.ipn_addr.adf_len) { IPFERROR(70031); - return(EINVAL); + return (EINVAL); } p = ipf_pool_find(arg, op->iplo_unit, op->iplo_name); if (p == NULL) { IPFERROR(70021); - return(ESRCH); + return (ESRCH); } m = ipf_pool_findeq(arg, p, &node.ipn_addr, &node.ipn_mask); if (m == NULL) { IPFERROR(70022); - return(ENOENT); + return (ENOENT); } if ((uid != 0) && (uid != m->ipn_uid)) { IPFERROR(70024); - return(EACCES); + return (EACCES); } err = ipf_pool_remove_node(softc, arg, p, m); - return(err); + return (err); } @@ -534,7 +534,7 @@ ipf_pool_table_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) err = ipf_pool_create(softc, arg, op); } - return(err); + return (err); } @@ -549,7 +549,7 @@ ipf_pool_table_add(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) static int ipf_pool_table_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) { - return(ipf_pool_destroy(softc, arg, op->iplo_unit, op->iplo_name)); + return (ipf_pool_destroy(softc, arg, op->iplo_unit, op->iplo_name)); } @@ -572,7 +572,7 @@ ipf_pool_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) if (op->iplo_size != sizeof(ipf_pool_stat_t)) { IPFERROR(70001); - return(EINVAL); + return (EINVAL); } bcopy((char *)&softp->ipf_pool_stats, (char *)&stats, sizeof(stats)); @@ -595,10 +595,10 @@ ipf_pool_stats_get(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) err = COPYOUT(&stats, op->iplo_struct, sizeof(stats)); if (err != 0) { IPFERROR(70026); - return(EFAULT); + return (EFAULT); } } - return(0); + return (0); } @@ -636,7 +636,7 @@ ipf_pool_exists(ipf_pool_softc_t *softp, int unit, char *name) sizeof(p->ipo_name)) == 0) break; } - return(p); + return (p); } @@ -659,9 +659,9 @@ ipf_pool_find(void *arg, int unit, char *name) p = ipf_pool_exists(softp, unit, name); if ((p != NULL) && (p->ipo_flags & IPOOL_DELETE)) - return(NULL); + return (NULL); - return(p); + return (p); } @@ -684,7 +684,7 @@ ipf_pool_select_add_ref(void *arg, int unit, char *name) if (p != NULL) { ATOMIC_INC32(p->ipo_ref); } - return(p); + return (p); } @@ -706,7 +706,7 @@ ipf_pool_findeq(ipf_pool_softc_t *softp, ip_pool_t *ipo, addrfamily_t *addr, ipf_rdx_node_t *n; n = ipo->ipo_head->lookup(ipo->ipo_head, addr, mask); - return(ip_pool_node_t *)n; + return (ip_pool_node_t *)n; } @@ -734,7 +734,7 @@ ipf_pool_search(ipf_main_softc_t *softc, void *tptr, int ipversion, void *dptr, ipo = tptr; if (ipo == NULL) - return(-1); + return (-1); rv = 1; m = NULL; @@ -754,7 +754,7 @@ ipf_pool_search(ipf_main_softc_t *softc, void *tptr, int ipversion, void *dptr, v.adf_addr.in6 = addr->in6; #endif } else - return(-1); + return (-1); READ_ENTER(&softc->ipf_poolrw); @@ -768,7 +768,7 @@ ipf_pool_search(ipf_main_softc_t *softc, void *tptr, int ipversion, void *dptr, rv = m->ipn_info; } RWLOCK_EXIT(&softc->ipf_poolrw); - return(rv); + return (rv); } @@ -794,19 +794,19 @@ ipf_pool_insert_node(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, if ((node->ipn_addr.adf_len > sizeof(*rn)) || (node->ipn_addr.adf_len < 4)) { IPFERROR(70003); - return(EINVAL); + return (EINVAL); } if ((node->ipn_mask.adf_len > sizeof(*rn)) || (node->ipn_mask.adf_len < 4)) { IPFERROR(70004); - return(EINVAL); + return (EINVAL); } KMALLOC(x, ip_pool_node_t *); if (x == NULL) { IPFERROR(70002); - return(ENOMEM); + return (ENOMEM); } *x = *node; @@ -864,7 +864,7 @@ ipf_pool_insert_node(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, if (rn == NULL) { KFREE(x); IPFERROR(70005); - return(ENOMEM); + return (ENOMEM); } x->ipn_ref = 1; @@ -874,7 +874,7 @@ ipf_pool_insert_node(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, softp->ipf_pool_stats.ipls_nodes++; - return(0); + return (0); } @@ -911,24 +911,24 @@ ipf_pool_create(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, if (h != NULL) { if ((h->ipo_flags & IPOOL_DELETE) == 0) { IPFERROR(70006); - return(EEXIST); + return (EEXIST); } h->ipo_flags &= ~IPOOL_DELETE; - return(0); + return (0); } } KMALLOC(h, ip_pool_t *); if (h == NULL) { IPFERROR(70007); - return(ENOMEM); + return (ENOMEM); } bzero(h, sizeof(*h)); if (ipf_rx_inithead(softp->ipf_radix, &h->ipo_head) != 0) { KFREE(h); IPFERROR(70008); - return(ENOMEM); + return (ENOMEM); } if ((op->iplo_arg & LOOKUP_ANON) != 0) { @@ -968,7 +968,7 @@ ipf_pool_create(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, softp->ipf_pool_stats.ipls_pools++; - return(0); + return (0); } @@ -1006,10 +1006,10 @@ ipf_pool_remove_node(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, if (ptr != NULL) { ipf_pool_node_deref(softp, ipe); - return(0); + return (0); } IPFERROR(70027); - return(ESRCH); + return (ESRCH); } @@ -1039,17 +1039,17 @@ ipf_pool_destroy(ipf_main_softc_t *softc, ipf_pool_softc_t *softp, ipo = ipf_pool_exists(softp, unit, name); if (ipo == NULL) { IPFERROR(70009); - return(ESRCH); + return (ESRCH); } if (ipo->ipo_ref != 1) { ipf_pool_clearnodes(softc, softp, ipo); ipo->ipo_flags |= IPOOL_DELETE; - return(0); + return (0); } ipf_pool_free(softc, softp, ipo); - return(0); + return (0); } @@ -1086,7 +1086,7 @@ ipf_pool_flush(ipf_main_softc_t *softc, void *arg, iplookupflush_t *fp) num++; } } - return(num); + return (num); } @@ -1169,7 +1169,7 @@ ipf_pool_deref(ipf_main_softc_t *softc, void *arg, void *pool) else if ((ipo->ipo_ref == 1) && (ipo->ipo_flags & IPOOL_DELETE)) ipf_pool_destroy(softc, arg, ipo->ipo_unit, ipo->ipo_name); - return(0); + return (0); } @@ -1280,7 +1280,7 @@ ipf_pool_iter_next(ipf_main_softc_t *softc, void *arg, ipftoken_t *token, RWLOCK_EXIT(&softc->ipf_poolrw); if (err != 0) - return(err); + return (err); switch (ilp->ili_otype) { @@ -1313,7 +1313,7 @@ ipf_pool_iter_next(ipf_main_softc_t *softc, void *arg, ipftoken_t *token, if (pnext == NULL) ipf_token_mark_complete(token); - return(err); + return (err); } @@ -1333,10 +1333,10 @@ ipf_pool_iter_deref(ipf_main_softc_t *softc, void *arg, int otype, int unit, ipf_pool_softc_t *softp = arg; if (data == NULL) - return(EINVAL); + return (EINVAL); if (unit < 0 || unit > IPL_LOGMAX) - return(EINVAL); + return (EINVAL); switch (otype) { @@ -1351,7 +1351,7 @@ ipf_pool_iter_deref(ipf_main_softc_t *softc, void *arg, int otype, int unit, break; } - return(0); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c index 2d936f0e871b..17ba01ce8d94 100644 --- a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c @@ -116,7 +116,7 @@ ipf_p_pptp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ip_t *ip; if (fin->fin_v != 4) - return(-1); + return (-1); ip = fin->fin_ip; np = nat->nat_ptr; @@ -126,19 +126,19 @@ ipf_p_pptp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ip->ip_dst) != NULL) { if (ipf_p_pptp_debug > 0) printf("ipf_p_pptp_new: GRE session already exists\n"); - return(-1); + return (-1); } KMALLOC(pptp, pptp_pxy_t *); if (pptp == NULL) { if (ipf_p_pptp_debug > 0) printf("ipf_p_pptp_new: malloc for aps_data failed\n"); - return(-1); + return (-1); } KMALLOCS(ipn, ipnat_t *, size); if (ipn == NULL) { KFREE(pptp); - return(-1); + return (-1); } aps->aps_data = pptp; @@ -182,7 +182,7 @@ ipf_p_pptp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) pptp->pptp_side[0].pptps_wptr = pptp->pptp_side[0].pptps_buffer; pptp->pptp_side[1].pptps_wptr = pptp->pptp_side[1].pptps_buffer; - return(0); + return (0); } @@ -291,7 +291,7 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) fin->fin_ipoff; if (dlen <= 0) - return(0); + return (0); /* * If the complete data packet is before what we expect to see * "next", just ignore it as the chances are we've already seen it. @@ -301,13 +301,13 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) */ end = start + dlen; if (pptps->pptps_next > end && pptps->pptps_next > start) - return(0); + return (0); if (pptps->pptps_next != start) { if (ipf_p_pptp_debug > 5) printf("%s: next (%x) != start (%x)\n", funcname, pptps->pptps_next, start); - return(-1); + return (-1); } msg = (char *)fin->fin_dp + (TCP_OFF(tcp) << 2); @@ -333,7 +333,7 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) printf("%s: bad cookie (%x)\n", funcname, hdr->pptph_cookie); - return(-1); + return (-1); } } dlen -= len; @@ -385,7 +385,7 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) dlen -= len; } - return(0); + return (0); } @@ -407,7 +407,7 @@ ipf_p_pptp_message(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, default : break; } - return(0); + return (0); } @@ -492,7 +492,7 @@ ipf_p_pptp_mctl(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, break; } - return(0); + return (0); } @@ -522,7 +522,7 @@ ipf_p_pptp_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) pptp->pptp_side[rev].pptps_next = ntohl(tcp->th_seq) + 1; pptp->pptp_side[rev].pptps_nexthdr = ntohl(tcp->th_seq) + 1; } - return(ipf_p_pptp_nextmessage(fin, nat, (pptp_pxy_t *)aps->aps_data, + return (ipf_p_pptp_nextmessage(fin, nat, (pptp_pxy_t *)aps->aps_data, rev)); } diff --git a/sys/netpfil/ipfilter/netinet/ip_proxy.c b/sys/netpfil/ipfilter/netinet/ip_proxy.c index 2d4966d786c9..3ee88af26886 100644 --- a/sys/netpfil/ipfilter/netinet/ip_proxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_proxy.c @@ -259,7 +259,7 @@ ipf_proxy_main_load(void) if (ap->apr_load != NULL) (*ap->apr_load)(); } - return(0); + return (0); } @@ -283,7 +283,7 @@ ipf_proxy_main_unload(void) if (ap->apr_unload != NULL) (*ap->apr_unload)(); - return(0); + return (0); } @@ -304,7 +304,7 @@ ipf_proxy_soft_create(ipf_main_softc_t *softc) KMALLOC(softp, ipf_proxy_softc_t *); if (softp == NULL) - return(softp); + return (softp); bzero((char *)softp, sizeof(*softp)); @@ -320,11 +320,11 @@ ipf_proxy_soft_create(ipf_main_softc_t *softc) ipf_proxy_tuneables); if (softp->ipf_proxy_tune == NULL) { ipf_proxy_soft_destroy(softc, softp); - return(NULL); + return (NULL); } if (ipf_tune_array_link(softc, softp->ipf_proxy_tune) == -1) { ipf_proxy_soft_destroy(softc, softp); - return(NULL); + return (NULL); } last = NULL; @@ -349,10 +349,10 @@ ipf_proxy_soft_create(ipf_main_softc_t *softc) last = apn; } - return(softp); + return (softp); failed: ipf_proxy_soft_destroy(softc, softp); - return(NULL); + return (NULL); } @@ -372,7 +372,7 @@ ipf_proxy_create_clone(ipf_main_softc_t *softc, aproxy_t *orig) KMALLOC(apn, aproxy_t *); if (apn == NULL) - return(NULL); + return (NULL); bcopy((char *)orig, (char *)apn, sizeof(*apn)); apn->apr_next = NULL; @@ -382,14 +382,14 @@ ipf_proxy_create_clone(ipf_main_softc_t *softc, aproxy_t *orig) apn->apr_soft = (*apn->apr_create)(softc); if (apn->apr_soft == NULL) { KFREE(apn); - return(NULL); + return (NULL); } } apn->apr_parent = orig; orig->apr_clones++; - return(apn); + return (apn); } @@ -417,7 +417,7 @@ ipf_proxy_soft_init(ipf_main_softc_t *softc, void *arg) KMALLOCS(softp->ips_sess_tab, ap_session_t **, size); if (softp->ips_sess_tab == NULL) - return(-1); + return (-1); bzero(softp->ips_sess_tab, size); @@ -425,12 +425,12 @@ ipf_proxy_soft_init(ipf_main_softc_t *softc, void *arg) if (ap->apr_init != NULL) { err = (*ap->apr_init)(softc, ap->apr_soft); if (err != 0) - return(-2); + return (-2); } } softp->ips_init_run = 1; - return(0); + return (0); } @@ -463,7 +463,7 @@ ipf_proxy_soft_fini(ipf_main_softc_t *softc, void *arg) } softp->ips_init_run = 0; - return(0); + return (0); } @@ -554,7 +554,7 @@ ipf_proxy_add(void *arg, aproxy_t *ap) if (softp->ips_proxy_debug & 0x01) printf("ipf_proxy_add: %s/%d present (B)\n", a->apr_label, a->apr_p); - return(-1); + return (-1); } for (a = ap_proxylist; (a != NULL); a = a->apr_next) @@ -564,13 +564,13 @@ ipf_proxy_add(void *arg, aproxy_t *ap) if (softp->ips_proxy_debug & 0x01) printf("ipf_proxy_add: %s/%d present (D)\n", a->apr_label, a->apr_p); - return(-1); + return (-1); } ap->apr_next = ap_proxylist; ap_proxylist = ap; if (ap->apr_load != NULL) (*ap->apr_load)(); - return(0); + return (0); } @@ -611,7 +611,7 @@ ipf_proxy_ctl(ipf_main_softc_t *softc, void *arg, ap_ctl_t *ctl) printf("ipf_proxy_ctl: %s/%d ctl error %d\n", a->apr_label, a->apr_p, error); } - return(error); + return (error); } @@ -634,13 +634,13 @@ ipf_proxy_del(aproxy_t *ap) a->apr_flags |= APR_DELETE; if (ap->apr_ref == 0 && ap->apr_clones == 0) { *app = a->apr_next; - return(0); + return (0); } - return(1); + return (1); } } - return(-1); + return (-1); } @@ -664,10 +664,10 @@ ipf_proxy_ok(fr_info_t *fin, tcphdr_t *tcp, ipnat_t *np) if ((apr == NULL) || (apr->apr_flags & APR_DELETE) || (fin->fin_p != apr->apr_p)) - return(0); + return (0); if ((tcp == NULL) && dport) - return(0); - return(1); + return (0); + return (1); } @@ -696,7 +696,7 @@ ipf_proxy_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, case SIOCPROXY : error = ipf_inobj(softc, data, NULL, &ctl, IPFOBJ_PROXYCTL); if (error != 0) { - return(error); + return (error); } ptr = NULL; @@ -729,7 +729,7 @@ ipf_proxy_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, IPFERROR(80004); error = EINVAL; } - return(error); + return (error); } @@ -763,7 +763,7 @@ ipf_proxy_match(fr_info_t *fin, nat_t *nat) if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_match: flx 0x%x (BAD|SHORT)\n", fin->fin_flx); - return(-1); + return (-1); } apr = ipn->in_apr; @@ -771,7 +771,7 @@ ipf_proxy_match(fr_info_t *fin, nat_t *nat) if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_match:apr %lx apr_flags 0x%x\n", (u_long)apr, apr ? apr->apr_flags : 0); - return(-1); + return (-1); } if (apr->apr_match != NULL) { @@ -779,10 +779,10 @@ ipf_proxy_match(fr_info_t *fin, nat_t *nat) if (result != 0) { if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_match: result %d\n", result); - return(-1); + return (-1); } } - return(0); + return (0); } @@ -811,7 +811,7 @@ ipf_proxy_new(fr_info_t *fin, nat_t *nat) if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_new: nat_ptr %lx nat_aps %lx\n", (u_long)nat->nat_ptr, (u_long)nat->nat_aps); - return(-1); + return (-1); } apr = nat->nat_ptr->in_apr; @@ -821,7 +821,7 @@ ipf_proxy_new(fr_info_t *fin, nat_t *nat) if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_new: apr_flags 0x%x p %d/%d\n", apr->apr_flags, fin->fin_p, apr->apr_p); - return(-1); + return (-1); } KMALLOC(aps, ap_session_t *); @@ -829,7 +829,7 @@ ipf_proxy_new(fr_info_t *fin, nat_t *nat) if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_new: malloc failed (%lu)\n", (u_long)sizeof(ap_session_t)); - return(-1); + return (-1); } bzero((char *)aps, sizeof(*aps)); @@ -845,14 +845,14 @@ ipf_proxy_new(fr_info_t *fin, nat_t *nat) if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_new: new(%lx) failed\n", (u_long)apr->apr_new); - return(-1); + return (-1); } aps->aps_nat = nat; aps->aps_next = softp->ips_sess_list; softp->ips_sess_list = aps; nat->nat_aps = aps; - return(0); + return (0); } @@ -892,7 +892,7 @@ ipf_proxy_check(fr_info_t *fin, nat_t *nat) if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_check: flx 0x%x (BAD)\n", fin->fin_flx); - return(-1); + return (-1); } #ifndef IPFILTER_CKSUM @@ -902,7 +902,7 @@ ipf_proxy_check(fr_info_t *fin, nat_t *nat) fin->fin_p); if (fin->fin_p == IPPROTO_TCP) softc->ipf_stats[fin->fin_out].fr_tcpbad++; - return(-1); + return (-1); } #endif @@ -918,7 +918,7 @@ ipf_proxy_check(fr_info_t *fin, nat_t *nat) if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_check: %s %x\n", "coalesce failed", fin->fin_flx); - return(-1); + return (-1); } #endif ip = fin->fin_ip; @@ -962,12 +962,12 @@ ipf_proxy_check(fr_info_t *fin, nat_t *nat) printf("ipf_proxy_check: out %d err %x rv %d\n", fin->fin_out, err, rv); if (rv == 1) - return(-1); + return (-1); if (rv == 2) { ipf_proxy_deref(apr); nat->nat_aps = NULL; - return(-1); + return (-1); } /* @@ -1019,7 +1019,7 @@ ipf_proxy_check(fr_info_t *fin, nat_t *nat) aps->aps_bytes += fin->fin_plen; aps->aps_pkts++; } - return(1); + return (1); } @@ -1045,12 +1045,12 @@ ipf_proxy_lookup(void *arg, u_int pr, char *name) if ((ap->apr_p == pr) && !strncmp(name, ap->apr_label, sizeof(ap->apr_label))) { ap->apr_ref++; - return(ap); + return (ap); } if (softp->ips_proxy_debug & 0x08) printf("ipf_proxy_lookup: failed for %d/%s\n", pr, name); - return(NULL); + return (NULL); } @@ -1254,7 +1254,7 @@ ipf_proxy_fixseqack(fr_info_t *fin, ip_t *ip, ap_session_t *aps, int inc) if (softp->ips_proxy_debug & 0x10) printf("ipf_proxy_fixseqack: seq %u ack %u\n", (u_32_t)ntohl(tcp->th_seq), (u_32_t)ntohl(tcp->th_ack)); - return(ch ? 2 : 0); + return (ch ? 2 : 0); } @@ -1288,7 +1288,7 @@ ipf_proxy_rule_rev(nat_t *nat) KMALLOCS(ipn, ipnat_t *, size); if (ipn == NULL) - return(NULL); + return (NULL); bzero((char *)ipn, size); @@ -1347,7 +1347,7 @@ ipf_proxy_rule_rev(nat_t *nat) bcopy(old->in_names, ipn->in_names, ipn->in_namelen); MUTEX_INIT(&ipn->in_lock, "ipnat rev rule lock"); - return(ipn); + return (ipn); } @@ -1375,7 +1375,7 @@ ipf_proxy_rule_fwd(nat_t *nat) KMALLOCS(ipn, ipnat_t *, size); if (ipn == NULL) - return(NULL); + return (NULL); bzero((char *)ipn, size); @@ -1419,5 +1419,5 @@ ipf_proxy_rule_fwd(nat_t *nat) bcopy(old->in_names, ipn->in_names, ipn->in_namelen); MUTEX_INIT(&ipn->in_lock, "ipnat fwd rule lock"); - return(ipn); + return (ipn); } diff --git a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c index 31ee6e7871c3..6e09fa18a492 100644 --- a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c @@ -57,17 +57,17 @@ ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) nat = nat; /* LINT */ if (fin->fin_v != 4) - return(-1); + return (-1); KMALLOCS(aps->aps_data, void *, sizeof(raudio_t)); if (aps->aps_data == NULL) - return(-1); + return (-1); bzero(aps->aps_data, sizeof(raudio_t)); rap = aps->aps_data; aps->aps_psiz = sizeof(raudio_t); rap->rap_mode = RAP_M_TCP; /* default is for TCP */ - return(0); + return (0); } @@ -90,7 +90,7 @@ ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) * for the proxy to do. */ if (rap->rap_eos == 1) - return(0); + return (0); m = fin->fin_m; tcp = (tcphdr_t *)fin->fin_dp; @@ -99,7 +99,7 @@ ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) dlen = MSGDSIZE(m) - off; if (dlen <= 0) - return(0); + return (0); if (dlen > sizeof(membuf)) dlen = sizeof(membuf); @@ -116,7 +116,7 @@ ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (rap->rap_seenpna == 0) { s = (u_char *)memstr("PNA", (char *)membuf, 3, dlen); if (s == NULL) - return(0); + return (0); s += 3; rap->rap_seenpna = 1; } else @@ -132,7 +132,7 @@ ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) s += 2; rap->rap_seenver = 1; } else - return(0); + return (0); } /* @@ -168,7 +168,7 @@ ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) rap->rap_gotid = 0; } } - return(0); + return (0); } @@ -199,7 +199,7 @@ ipf_p_raudio_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) * then data is sent back on the same channel that is already open. */ if (rap->rap_sdone != 0) - return(0); + return (0); m = fin->fin_m; tcp = (tcphdr_t *)fin->fin_dp; @@ -208,7 +208,7 @@ ipf_p_raudio_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) dlen = MSGDSIZE(m) - off; if (dlen <= 0) - return(0); + return (0); if (dlen > sizeof(membuf)) dlen = sizeof(membuf); @@ -224,7 +224,7 @@ ipf_p_raudio_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (rap->rap_sseq == 0) { s = (u_char *)memstr("PNA", (char *)membuf, 3, dlen); if (s == NULL) - return(0); + return (0); a1 = s - membuf; dlen -= a1; a1 = 0; @@ -240,7 +240,7 @@ ipf_p_raudio_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) a2 -= a1; s = membuf; } else - return(0); + return (0); for (a3 = a1, a4 = a2; (a4 > 0) && (a3 < 19) && (a3 >= 0); a4--,a3++) { rap->rap_sbf |= (1 << a3); @@ -248,7 +248,7 @@ ipf_p_raudio_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) } if ((rap->rap_sbf != 0x7ffff) || (!rap->rap_eos)) /* 19 bits */ - return(0); + return (0); rap->rap_sdone = 1; s = (u_char *)rap->rap_svr + 11; @@ -329,5 +329,5 @@ ipf_p_raudio_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ip->ip_len = slen; ip->ip_src = swa; ip->ip_dst = swb; - return(0); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c index 382693e91df9..1589a20a6fed 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c @@ -82,7 +82,7 @@ ipf_p_rcmd_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) #ifdef IP_RCMD_PROXY_DEBUG printf("ipf_p_rcmd_new:KMALLOCS(%d) failed\n", sizeof(*rc)); #endif - return(-1); + return (-1); } aps->aps_sport = tcp->th_sport; aps->aps_dport = tcp->th_dport; @@ -90,7 +90,7 @@ ipf_p_rcmd_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ipn = ipf_proxy_rule_rev(nat); if (ipn == NULL) { KFREE(rc); - return(-1); + return (-1); } aps->aps_data = rc; @@ -99,7 +99,7 @@ ipf_p_rcmd_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) rc->rcmd_rule = ipn; - return(0); + return (0); } @@ -129,7 +129,7 @@ ipf_rcmd_atoi(char *ptr) i *= 10; i += c - '0'; } - return(i); + return (i); } @@ -167,12 +167,12 @@ ipf_p_rcmd_portmsg(fr_info_t *fin, ap_session_t *aps, nat_t *nat) dlen = fin->fin_dlen - tcpsz; if (dlen <= 0) - return(0); + return (0); rc = (rcmdinfo_t *)aps->aps_data; if ((rc->rcmd_portseq != 0) && (tcp->th_seq != rc->rcmd_portseq)) - return(0); + return (0); bzero(portbuf, sizeof(portbuf)); COPYDATA(m, off, MIN(sizeof(portbuf), dlen), portbuf); @@ -185,7 +185,7 @@ ipf_p_rcmd_portmsg(fr_info_t *fin, ap_session_t *aps, nat_t *nat) printf("ipf_p_rcmd_portmsg:sp == 0 dlen %d [%s]\n", dlen, portbuf); #endif - return(0); + return (0); } if (rc->rcmd_port != 0 && sp != rc->rcmd_port) { @@ -193,7 +193,7 @@ ipf_p_rcmd_portmsg(fr_info_t *fin, ap_session_t *aps, nat_t *nat) printf("ipf_p_rcmd_portmsg:sp(%d) != rcmd_port(%d)\n", sp, rc->rcmd_port); #endif - return(0); + return (0); } rc->rcmd_port = sp; @@ -241,7 +241,7 @@ ipf_p_rcmd_portmsg(fr_info_t *fin, ap_session_t *aps, nat_t *nat) } } if (nat2 != NULL) - return(APR_ERR(1)); + return (APR_ERR(1)); /* * Add skeleton NAT entry for connection which will come @@ -311,8 +311,8 @@ ipf_p_rcmd_portmsg(fr_info_t *fin, ap_session_t *aps, nat_t *nat) ip->ip_len = slen; } if (nat2 == NULL) - return(APR_ERR(1)); - return(0); + return (APR_ERR(1)); + return (0); } @@ -320,8 +320,8 @@ int ipf_p_rcmd_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { if (nat->nat_dir == NAT_OUTBOUND) - return(ipf_p_rcmd_portmsg(fin, aps, nat)); - return(0); + return (ipf_p_rcmd_portmsg(fin, aps, nat)); + return (0); } @@ -329,6 +329,6 @@ int ipf_p_rcmd_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) { if (nat->nat_dir == NAT_INBOUND) - return(ipf_p_rcmd_portmsg(fin, aps, nat)); - return(0); + return (ipf_p_rcmd_portmsg(fin, aps, nat)); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c index b70d6b55285b..7af11dd4a2dd 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c @@ -151,18 +151,18 @@ ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) nat = nat; /* LINT */ if (fin->fin_v != 4) - return(-1); + return (-1); KMALLOC(rs, rpcb_session_t *); if (rs == NULL) - return(-1); + return (-1); bzero((char *)rs, sizeof(*rs)); MUTEX_INIT(&rs->rs_rxlock, "ipf Sun RPCB proxy session lock"); aps->aps_data = rs; - return(0); + return (0); } /* -------------------------------------------------------------------- */ @@ -208,7 +208,7 @@ ipf_p_rpcb_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) /* Disallow fragmented or illegally short packets. */ if ((fin->fin_flx & (FI_FRAG|FI_SHORT)) != 0) - return(APR_ERR(1)); + return (APR_ERR(1)); /* Perform basic variable initialization. */ rs = (rpcb_session_t *)aps->aps_data; @@ -220,7 +220,7 @@ ipf_p_rpcb_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) /* Disallow packets outside legal range for supported requests. */ if ((dlen < RPCB_REQMIN) || (dlen > RPCB_REQMAX)) - return(APR_ERR(1)); + return (APR_ERR(1)); /* Copy packet over to convenience buffer. */ rm = &rpcmsg; @@ -234,7 +234,7 @@ ipf_p_rpcb_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) switch(rv) { case -1: - return(APR_ERR(1)); + return (APR_ERR(1)); /*NOTREACHED*/ break; case 0: @@ -247,7 +247,7 @@ ipf_p_rpcb_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) IPF_PANIC(1, ("illegal rv %d (ipf_p_rpcb_req)", rv)); } - return(rv); + return (rv); } /* -------------------------------------------------------------------- */ @@ -277,7 +277,7 @@ ipf_p_rpcb_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) /* Disallow fragmented or illegally short packets. */ if ((fin->fin_flx & (FI_FRAG|FI_SHORT)) != 0) - return(APR_ERR(1)); + return (APR_ERR(1)); /* Perform basic variable initialization. */ rs = (rpcb_session_t *)aps->aps_data; @@ -291,7 +291,7 @@ ipf_p_rpcb_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) /* Disallow packets outside legal range for supported requests. */ if ((dlen < RPCB_REPMIN) || (dlen > RPCB_REPMAX)) - return(APR_ERR(1)); + return (APR_ERR(1)); /* Copy packet over to convenience buffer. */ rm = &rpcmsg; @@ -312,7 +312,7 @@ ipf_p_rpcb_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ipf_p_rpcb_deref(rs, rx); MUTEX_EXIT(&rs->rs_rxlock); } - return(APR_ERR(1)); + return (APR_ERR(1)); /*NOTREACHED*/ break; case 0: /* Negative reply / request rejected */ @@ -350,7 +350,7 @@ ipf_p_rpcb_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) MUTEX_EXIT(&rs->rs_rxlock); } - return(diff); + return (diff); } /* @@ -420,7 +420,7 @@ ipf_p_rpcb_decodereq(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, if ((B(p++) != RPCB_CALL) || (B(p++) != RPCB_MSG_VERSION) || (B(p++) != RPCB_PROG)) - return(-1); + return (-1); /* Record the RPCB version and procedure. */ rc->rc_vers = p++; @@ -428,9 +428,9 @@ ipf_p_rpcb_decodereq(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, /* Bypass RPC authentication stuff. */ if (ipf_p_rpcb_skipauth(rm, &rc->rc_authcred, &p) != 0) - return(-1); + return (-1); if (ipf_p_rpcb_skipauth(rm, &rc->rc_authverf, &p) != 0) - return(-1); + return (-1); /* Compare RPCB version and procedure numbers. */ switch(B(rc->rc_vers)) @@ -438,18 +438,18 @@ ipf_p_rpcb_decodereq(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, case 2: /* This proxy only supports PMAP_GETPORT. */ if (B(rc->rc_proc) != RPCB_GETPORT) - return(-1); + return (-1); /* Portmap requests contain four 4 byte parameters. */ if (RPCB_BUF_EQ(rm, p, 16) == 0) - return(-1); + return (-1); p += 2; /* Skip requested program and version numbers. */ /* Sanity check the requested protocol. */ xdr = B(p); if (!(xdr == IPPROTO_UDP || xdr == IPPROTO_TCP)) - return(-1); + return (-1); rx.rx_type = RPCB_RES_PMAP; rx.rx_proto = xdr; @@ -465,23 +465,23 @@ ipf_p_rpcb_decodereq(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, break; case RPCB_GETADDRLIST: if (B(rc->rc_vers) != 4) - return(-1); + return (-1); rx.rx_type = RPCB_RES_LIST; break; default: - return(-1); + return (-1); } ra = &rc->rc_rpcbargs; /* Decode the 'struct rpcb' request. */ if (ipf_p_rpcb_xdrrpcb(rm, p, ra) != 0) - return(-1); + return (-1); /* Are the target address & port valid? */ if ((ra->ra_maddr.xu_ip != nat->nat_ndstaddr) || (ra->ra_maddr.xu_port != nat->nat_ndport)) - return(-1); + return (-1); /* Do we need to rewrite this packet? */ if ((nat->nat_ndstaddr != nat->nat_odstaddr) || @@ -489,17 +489,17 @@ ipf_p_rpcb_decodereq(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, mod = 1; break; default: - return(-1); + return (-1); } MUTEX_ENTER(&rs->rs_rxlock); if (ipf_p_rpcb_insert(rs, &rx) != 0) { MUTEX_EXIT(&rs->rs_rxlock); - return(-1); + return (-1); } MUTEX_EXIT(&rs->rs_rxlock); - return(mod); + return (mod); } /* -------------------------------------------------------------------- */ @@ -522,7 +522,7 @@ ipf_p_rpcb_skipauth(rpc_msg_t *rm, xdr_auth_t *auth, u_32_t **buf) /* Make sure we have enough space for expected fixed auth parms. */ if (RPCB_BUF_GEQ(rm, p, 8) == 0) - return(-1); + return (-1); p++; /* We don't care about auth_flavor. */ @@ -531,7 +531,7 @@ ipf_p_rpcb_skipauth(rpc_msg_t *rm, xdr_auth_t *auth, u_32_t **buf) /* Test for absurdity / illegality of auth_data length. */ if ((XDRALIGN(xdr) < xdr) || (RPCB_BUF_GEQ(rm, p, XDRALIGN(xdr)) == 0)) - return(-1); + return (-1); auth->xa_string.xs_str = (char *)p; @@ -539,7 +539,7 @@ ipf_p_rpcb_skipauth(rpc_msg_t *rm, xdr_auth_t *auth, u_32_t **buf) *buf = (u_32_t *)p; - return(0); + return (0); } /* -------------------------------------------------------------------- */ @@ -557,15 +557,15 @@ ipf_p_rpcb_insert(rpcb_session_t *rs, rpcb_xact_t *rx) rxp = ipf_p_rpcb_lookup(rs, rx->rx_xid); if (rxp != NULL) { ++rxp->rx_ref; - return(0); + return (0); } if (V_rpcbcnt == RPCB_MAXREQS) - return(-1); + return (-1); KMALLOC(rxp, rpcb_xact_t *); if (rxp == NULL) - return(-1); + return (-1); bcopy((char *)rx, (char *)rxp, sizeof(*rx)); @@ -580,7 +580,7 @@ ipf_p_rpcb_insert(rpcb_session_t *rs, rpcb_xact_t *rx) ++V_rpcbcnt; - return(0); + return (0); } /* -------------------------------------------------------------------- */ @@ -598,24 +598,24 @@ static int ipf_p_rpcb_xdrrpcb(rpc_msg_t *rm, u_32_t *p, rpcb_args_t *ra) { if (!RPCB_BUF_GEQ(rm, p, 20)) - return(-1); + return (-1); /* Bypass target program & version. */ p += 2; /* Decode r_netid. Must be "tcp" or "udp". */ if (ipf_p_rpcb_getproto(rm, &ra->ra_netid, &p) != 0) - return(-1); + return (-1); /* Decode r_maddr. */ if (ipf_p_rpcb_getuaddr(rm, &ra->ra_maddr, &p) != 0) - return(-1); + return (-1); /* Advance to r_owner and make sure it's empty. */ if (!RPCB_BUF_EQ(rm, p, 4) || (B(p) != 0)) - return(-1); + return (-1); - return(0); + return (0); } /* -------------------------------------------------------------------- */ @@ -637,7 +637,7 @@ ipf_p_rpcb_getuaddr(rpc_msg_t *rm, xdr_uaddr_t *xu, u_32_t **p) /* Test for string length. */ if (!RPCB_BUF_GEQ(rm, *p, 4)) - return(-1); + return (-1); xu->xu_xslen = (*p)++; xu->xu_xsstr = (char *)*p; @@ -645,7 +645,7 @@ ipf_p_rpcb_getuaddr(rpc_msg_t *rm, xdr_uaddr_t *xu, u_32_t **p) /* Length check */ l = B(xu->xu_xslen); if (l < 11 || l > 23 || !RPCB_BUF_GEQ(rm, *p, XDRALIGN(l))) - return(-1); + return (-1); /* Advance p */ *(char **)p += XDRALIGN(l); @@ -662,7 +662,7 @@ ipf_p_rpcb_getuaddr(rpc_msg_t *rm, xdr_uaddr_t *xu, u_32_t **p) * an IP address and [ef] are the bytes of a L4 port. */ if (!(ISDIGIT(uastr[0]) && ISDIGIT(uastr[l-1]))) - return(-1); + return (-1); b = uastr; for (c = &uastr[1], d = 0, dd = 0; c < &uastr[l-1]; c++) { if (ISDIGIT(*c)) { @@ -671,13 +671,13 @@ ipf_p_rpcb_getuaddr(rpc_msg_t *rm, xdr_uaddr_t *xu, u_32_t **p) } if (*c == '.') { if (dd != 0) - return(-1); + return (-1); /* Check for ASCII byte. */ *c = '\0'; t = ipf_p_rpcb_atoi(b); if (t > 255) - return(-1); + return (-1); /* Aim b at beginning of the next byte. */ b = c + 1; @@ -691,18 +691,18 @@ ipf_p_rpcb_getuaddr(rpc_msg_t *rm, xdr_uaddr_t *xu, u_32_t **p) dd = 1; continue; } - return(-1); + return (-1); } if (d != 5) /* String must contain exactly 5 periods. */ - return(-1); + return (-1); /* Handle the last byte (port low byte) */ t = ipf_p_rpcb_atoi(b); if (t > 255) - return(-1); + return (-1); pp[d - 4] = t & 0xff; - return(0); + return (0); } /* -------------------------------------------------------------------- */ @@ -722,7 +722,7 @@ ipf_p_rpcb_atoi(char *ptr) i *= 10; i += c - '0'; } - return(i); + return (i); } /* -------------------------------------------------------------------- */ @@ -794,7 +794,7 @@ ipf_p_rpcb_modreq(fr_info_t *fin, nat_t *nat, rpc_msg_t *rm, mb_t *m, /* XXX Storage lengths. */ } - return(diff); + return (diff); } /* -------------------------------------------------------------------- */ @@ -840,7 +840,7 @@ ipf_p_rpcb_decoderep(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, MUTEX_ENTER(&rs->rs_rxlock); if ((rx = ipf_p_rpcb_lookup(rs, xdr)) == NULL) { MUTEX_EXIT(&rs->rs_rxlock); - return(-1); + return (-1); } ++rx->rx_ref; /* per thread reference */ MUTEX_EXIT(&rs->rs_rxlock); @@ -849,28 +849,28 @@ ipf_p_rpcb_decoderep(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, /* Test call vs reply */ if (B(p++) != RPCB_REPLY) - return(-1); + return (-1); /* Test reply_stat */ switch(B(p++)) { case RPCB_MSG_DENIED: - return(0); + return (0); case RPCB_MSG_ACCEPTED: break; default: - return(-1); + return (-1); } /* Bypass RPC authentication stuff. */ if (ipf_p_rpcb_skipauth(rm, &rr->rr_authverf, &p) != 0) - return(-1); + return (-1); /* Test accept status */ if (!RPCB_BUF_GEQ(rm, p, 4)) - return(-1); + return (-1); if (B(p++) != 0) - return(0); + return (0); /* Parse out the expected reply */ switch(rx->rx_type) @@ -878,27 +878,27 @@ ipf_p_rpcb_decoderep(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, case RPCB_RES_PMAP: /* There must be only one 4 byte argument. */ if (!RPCB_BUF_EQ(rm, p, 4)) - return(-1); + return (-1); rr->rr_v2 = p; xdr = B(rr->rr_v2); /* Reply w/ a 0 port indicates service isn't registered */ if (xdr == 0) - return(0); + return (0); /* Is the value sane? */ if (xdr > 65535) - return(-1); + return (-1); /* Create NAT & state table entries. */ if (ipf_p_rpcb_getnat(fin, nat, rx->rx_proto, (u_int)xdr) != 0) - return(-1); + return (-1); break; case RPCB_RES_STRING: /* Expecting a XDR string; need 4 bytes for length */ if (!RPCB_BUF_GEQ(rm, p, 4)) - return(-1); + return (-1); rr->rr_v3.xu_str.xs_len = p++; rr->rr_v3.xu_str.xs_str = (char *)p; @@ -907,35 +907,35 @@ ipf_p_rpcb_decoderep(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, /* A null string indicates an unregistered service */ if ((xdr == 0) && RPCB_BUF_EQ(rm, p, 0)) - return(0); + return (0); /* Decode the target IP address / port. */ if (ipf_p_rpcb_getuaddr(rm, &rr->rr_v3, &p) != 0) - return(-1); + return (-1); /* Validate the IP address and port contained. */ if (nat->nat_odstaddr != rr->rr_v3.xu_ip) - return(-1); + return (-1); /* Create NAT & state table entries. */ if (ipf_p_rpcb_getnat(fin, nat, rx->rx_proto, (u_int)rr->rr_v3.xu_port) != 0) - return(-1); + return (-1); break; case RPCB_RES_LIST: if (!RPCB_BUF_GEQ(rm, p, 4)) - return(-1); + return (-1); /* rpcb_entry_list_ptr */ switch(B(p)) { case 0: - return(0); + return (0); /*NOTREACHED*/ break; case 1: break; default: - return(-1); + return (-1); } rl = &rr->rr_v4; rl->rl_list = p++; @@ -944,31 +944,31 @@ ipf_p_rpcb_decoderep(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, for(;;) { re = &rl->rl_entries[rl->rl_cnt]; if (ipf_p_rpcb_getuaddr(rm, &re->re_maddr, &p) != 0) - return(-1); + return (-1); if (ipf_p_rpcb_getproto(rm, &re->re_netid, &p) != 0) - return(-1); + return (-1); /* re_semantics & re_pfamily length */ if (!RPCB_BUF_GEQ(rm, p, 12)) - return(-1); + return (-1); p++; /* Skipping re_semantics. */ xdr = B(p++); if ((xdr != 4) || strncmp((char *)p, "inet", 4)) - return(-1); + return (-1); p++; if (ipf_p_rpcb_getproto(rm, &re->re_proto, &p) != 0) - return(-1); + return (-1); if (!RPCB_BUF_GEQ(rm, p, 4)) - return(-1); + return (-1); re->re_more = p; if (B(re->re_more) > 1) /* 0,1 only legal values */ - return(-1); + return (-1); ++rl->rl_cnt; ++cnt; if (B(re->re_more) == 0) break; /* Replies in max out at 2; TCP and/or UDP */ if (cnt > 2) - return(-1); + return (-1); p++; } @@ -978,7 +978,7 @@ ipf_p_rpcb_decoderep(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, re->re_proto.xp_proto, (u_int)re->re_maddr.xu_port); if (rv != 0) - return(-1); + return (-1); } break; default: @@ -986,7 +986,7 @@ ipf_p_rpcb_decoderep(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs, IPF_PANIC(1, ("illegal rx_type %d", rx->rx_type)); } - return(1); + return (1); } /* -------------------------------------------------------------------- */ @@ -1002,13 +1002,13 @@ ipf_p_rpcb_lookup(rpcb_session_t *rs, u_32_t xid) rpcb_xact_t *rx; if (rs->rs_rxlist == NULL) - return(NULL); + return (NULL); for (rx = rs->rs_rxlist; rx != NULL; rx = rx->rx_next) if (rx->rx_xid == xid) break; - return(rx); + return (rx); } /* -------------------------------------------------------------------- */ @@ -1060,7 +1060,7 @@ ipf_p_rpcb_getproto(rpc_msg_t *rm, xdr_proto_t *xp, u_32_t **p) /* Must have 4 bytes for length & 4 bytes for "tcp" or "udp". */ if (!RPCB_BUF_GEQ(rm, p, 8)) - return(-1); + return (-1); xp->xp_xslen = (*p)++; xp->xp_xsstr = (char *)*p; @@ -1068,7 +1068,7 @@ ipf_p_rpcb_getproto(rpc_msg_t *rm, xdr_proto_t *xp, u_32_t **p) /* Test the string length. */ len = B(xp->xp_xslen); if (len != 3) - return(-1); + return (-1); /* Test the actual string & record the protocol accordingly. */ if (!strncmp((char *)xp->xp_xsstr, "tcp\0", 4)) @@ -1076,13 +1076,13 @@ ipf_p_rpcb_getproto(rpc_msg_t *rm, xdr_proto_t *xp, u_32_t **p) else if (!strncmp((char *)xp->xp_xsstr, "udp\0", 4)) xp->xp_proto = IPPROTO_UDP; else { - return(-1); + return (-1); } /* Advance past the string. */ (*p)++; - return(0); + return (0); } /* -------------------------------------------------------------------- */ @@ -1158,7 +1158,7 @@ ipf_p_rpcb_getnat(fr_info_t *fin, nat_t *nat, u_int proto, u_int port) if ((natl != NULL) && (is != NULL)) { MUTEX_DOWNGRADE(&softc->ipf_nat); - return(0); + return (0); } /* Slightly modify the following structures for actual use in creating @@ -1206,7 +1206,7 @@ ipf_p_rpcb_getnat(fr_info_t *fin, nat_t *nat, u_int proto, u_int port) if (natl == NULL) { MUTEX_DOWNGRADE(&softc->ipf_nat); - return(-1); + return (-1); } natl->nat_ptr = ipn; @@ -1234,11 +1234,11 @@ ipf_p_rpcb_getnat(fr_info_t *fin, nat_t *nat, u_int proto, u_int port) * * nat_delete(natl, NL_EXPIRE); */ - return(-1); + return (-1); } } - return(0); + return (0); } /* -------------------------------------------------------------------- */ @@ -1297,7 +1297,7 @@ ipf_p_rpcb_modv3(fr_info_t *fin, nat_t *nat, rpc_msg_t *rm, mb_t *m, if (diff != 0) ipf_p_rpcb_fixlen(fin, diff); - return(diff); + return (diff); } /* -------------------------------------------------------------------- */ @@ -1376,7 +1376,7 @@ ipf_p_rpcb_modv4(fr_info_t *fin, nat_t *nat, rpc_msg_t *rm, mb_t *m, if (diff != 0) ipf_p_rpcb_fixlen(fin, diff); - return(diff); + return (diff); } diff --git a/sys/netpfil/ipfilter/netinet/ip_rules.c b/sys/netpfil/ipfilter/netinet/ip_rules.c index f15c6c7c41ca..0792459b2070 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rules.c +++ b/sys/netpfil/ipfilter/netinet/ip_rules.c @@ -90,7 +90,7 @@ u_32_t *passp; frentry_t *fr = NULL; fr = (frentry_t *)&in_rule__0; - return(fr); + return (fr); } frentry_t *ipfrule_match_out_(fin, passp) @@ -100,7 +100,7 @@ u_32_t *passp; frentry_t *fr = NULL; fr = (frentry_t *)&out_rule__0; - return(fr); + return (fr); } static frentry_t ipfrule_out_; @@ -137,7 +137,7 @@ int ipfrule_add_out_(void) fp->fr_func = (ipfunc_t)ipfrule_match_out_; err = frrequest(&V_ipfmain, IPL_LOGIPF, SIOCADDFR, (caddr_t)fp, V_ipfmain.ipf_active, 0); - return(err); + return (err); } @@ -166,10 +166,10 @@ int ipfrule_remove_out_(void) (caddr_t)&ipfrule_out_, V_ipfmain.ipf_active, 0); if (err) - return(err); + return (err); - return(err); + return (err); } static frentry_t ipfrule_in_; @@ -206,7 +206,7 @@ int ipfrule_add_in_(void) fp->fr_func = (ipfunc_t)ipfrule_match_in_; err = frrequest(&V_ipfmain, IPL_LOGIPF, SIOCADDFR, (caddr_t)fp, V_ipfmain.ipf_active, 0); - return(err); + return (err); } @@ -235,10 +235,10 @@ int ipfrule_remove_in_(void) (caddr_t)&ipfrule_in_, V_ipfmain.ipf_active, 0); if (err) - return(err); + return (err); - return(err); + return (err); } int ipfrule_add(void) @@ -247,11 +247,11 @@ int ipfrule_add(void) err = ipfrule_add_out_(); if (err != 0) - return(err); + return (err); err = ipfrule_add_in_(); if (err != 0) - return(err); - return(0); + return (err); + return (0); } @@ -261,10 +261,10 @@ int ipfrule_remove(void) err = ipfrule_remove_out_(); if (err != 0) - return(err); + return (err); err = ipfrule_remove_in_(); if (err != 0) - return(err); - return(0); + return (err); + return (0); } #endif /* IPFILTER_COMPILED */ diff --git a/sys/netpfil/ipfilter/netinet/ip_scan.c b/sys/netpfil/ipfilter/netinet/ip_scan.c index b35de82ee031..45d6df0d3b2d 100644 --- a/sys/netpfil/ipfilter/netinet/ip_scan.c +++ b/sys/netpfil/ipfilter/netinet/ip_scan.c @@ -84,7 +84,7 @@ ipf_scan_init(void) { RWLOCK_INIT(&ipf_scan_rwlock, "ip scan rwlock"); ipf_scan_inited = 1; - return(0); + return (0); } @@ -107,13 +107,13 @@ ipf_scan_add(caddr_t data) KMALLOC(isc, ipscan_t *); if (!isc) { ipf_interror = 90001; - return(ENOMEM); + return (ENOMEM); } err = copyinptr(data, isc, sizeof(*isc)); if (err) { KFREE(isc); - return(err); + return (err); } WRITE_ENTER(&ipf_scan_rwlock); @@ -123,7 +123,7 @@ ipf_scan_add(caddr_t data) RWLOCK_EXIT(&ipf_scan_rwlock); KFREE(isc); ipf_interror = 90002; - return(EEXIST); + return (EEXIST); } if (ipf_scan_tail) { @@ -144,7 +144,7 @@ ipf_scan_add(caddr_t data) ipf_scan_stat.iscs_entries++; RWLOCK_EXIT(&ipf_scan_rwlock); - return(0); + return (0); } @@ -156,7 +156,7 @@ ipf_scan_remove(caddr_t data) err = copyinptr(data, &isc, sizeof(isc)); if (err) - return(err); + return (err); WRITE_ENTER(&ipf_scan_rwlock); @@ -167,7 +167,7 @@ ipf_scan_remove(caddr_t data) if (i->ipsc_fref) { RWLOCK_EXIT(&ipf_scan_rwlock); ipf_interror = 90003; - return(EBUSY); + return (EBUSY); } *i->ipsc_pnext = i->ipsc_next; @@ -184,7 +184,7 @@ ipf_scan_remove(caddr_t data) KFREE(i); } RWLOCK_EXIT(&ipf_scan_rwlock); - return(err); + return (err); } @@ -195,8 +195,8 @@ ipf_scan_lookup(char *tag) for (i = ipf_scan_list; i; i = i->ipsc_next) if (!strcmp(i->ipsc_tag, tag)) - return(i); - return(NULL); + return (i); + return (NULL); } @@ -214,11 +214,11 @@ ipf_scan_attachfr(struct frentry *fr) RWLOCK_EXIT(&ipf_scan_rwlock); if (i == NULL) { ipf_interror = 90004; - return(ENOENT); + return (ENOENT); } fr->fr_isc = i; } - return(0); + return (0); } @@ -246,7 +246,7 @@ ipf_scan_attachis(struct ipstate *is) } } RWLOCK_EXIT(&ipf_scan_rwlock); - return(0); + return (0); } @@ -259,7 +259,7 @@ ipf_scan_detachfr(struct frentry *fr) if (i != NULL) { ATOMIC_DEC32(i->ipsc_fref); } - return(0); + return (0); } @@ -276,7 +276,7 @@ ipf_scan_detachis(is) is->is_flags &= ~(IS_SC_CLIENT|IS_SC_SERVER); } RWLOCK_EXIT(&ipf_scan_rwlock); - return(0); + return (0); } @@ -298,16 +298,16 @@ ipf_scan_matchstr(sinfo_t *sp, char *str, int n) { case '.' : if (*s != *up) - return(1); + return (1); break; case '?' : if (!ISALPHA(*up) || ((*s & 0x5f) != (*up & 0x5f))) - return(1); + return (1); break; case '*' : break; } - return(0); + return (0); } @@ -328,9 +328,9 @@ ipf_scan_matchisc(ipscan_t *isc, ipstate_t *is, int cl, int sl, int maxm[2]) */ if (maxm != NULL) { if (isc->ipsc_clen < maxm[0]) - return(0); + return (0); if (isc->ipsc_slen < maxm[1]) - return(0); + return (0); j = maxm[0]; k = maxm[1]; } else { @@ -376,7 +376,7 @@ ipf_scan_matchisc(ipscan_t *isc, ipstate_t *is, int cl, int sl, int maxm[2]) maxm[0] = j; maxm[1] = k; } - return(ret); + return (ret); } @@ -435,7 +435,7 @@ ipf_scan_match(ipstate_t *is) if (k == 1) isc = lm; if (isc == NULL) - return(0); + return (0); /* * No matches or partial matches, so reset the respective @@ -500,7 +500,7 @@ ipf_scan_match(ipstate_t *is) break; } - return(i); + return (i); } @@ -519,7 +519,7 @@ ipf_scan_packet(fr_info_t *fin, ipstate_t *is) seq = ntohl(tcp->th_seq); if (!is->is_s0[rv]) - return(1); + return (1); /* * check if this packet has more data that falls within the first @@ -528,11 +528,11 @@ ipf_scan_packet(fr_info_t *fin, ipstate_t *is) s0 = is->is_s0[rv]; off = seq - s0; if ((off > 15) || (off < 0)) - return(1); + return (1); thoff = TCP_OFF(tcp) << 2; dlen = fin->fin_dlen - thoff; if (dlen <= 0) - return(1); + return (1); if (dlen > 16) dlen = 16; if (off + dlen > 16) @@ -548,7 +548,7 @@ ipf_scan_packet(fr_info_t *fin, ipstate_t *is) for (j = 0, i = is->is_smsk[rv]; i & 1; i >>= 1) j++; if (j == 0) - return(1); + return (1); (void) ipf_scan_match(is); #if 0 @@ -561,7 +561,7 @@ ipf_scan_packet(fr_info_t *fin, ipstate_t *is) if (!(is->is_flags & IS_SC_SERVER)) bzero(is->is_sbuf[1], sizeof(is->is_sbuf[1])); #endif - return(0); + return (0); } @@ -593,6 +593,6 @@ ipf_scan_ioctl(caddr_t data, ioctlcmd_t cmd, int mode, int uid, void *ctx) break; } - return(err); + return (err); } #endif /* IPFILTER_SCAN */ diff --git a/sys/netpfil/ipfilter/netinet/ip_state.c b/sys/netpfil/ipfilter/netinet/ip_state.c index f5dbef531aa9..ecee192e5571 100644 --- a/sys/netpfil/ipfilter/netinet/ip_state.c +++ b/sys/netpfil/ipfilter/netinet/ip_state.c @@ -198,7 +198,7 @@ static int ipf_state_putent(ipf_main_softc_t *, ipf_state_softc_t *, int ipf_state_main_load(void) { - return(0); + return (0); } @@ -213,7 +213,7 @@ ipf_state_main_load(void) int ipf_state_main_unload(void) { - return(0); + return (0); } @@ -232,7 +232,7 @@ ipf_state_soft_create(ipf_main_softc_t *softc) KMALLOC(softs, ipf_state_softc_t *); if (softs == NULL) - return(NULL); + return (NULL); bzero((char *)softs, sizeof(*softs)); @@ -241,11 +241,11 @@ ipf_state_soft_create(ipf_main_softc_t *softc) ipf_state_tuneables); if (softs->ipf_state_tune == NULL) { ipf_state_soft_destroy(softc, softs); - return(NULL); + return (NULL); } if (ipf_tune_array_link(softc, softs->ipf_state_tune) == -1) { ipf_state_soft_destroy(softc, softs); - return(NULL); + return (NULL); } #ifdef IPFILTER_LOG @@ -264,7 +264,7 @@ ipf_state_soft_create(ipf_main_softc_t *softc) softs->ipf_state_lock = 0; softs->ipf_state_doflush = 0; - return(softs); + return (softs); } @@ -298,7 +298,7 @@ ipf_state_seed_alloc(u_int state_size, u_int state_max) u_long *state_seed; KMALLOCS(state_seed, u_long *, state_size * sizeof(*state_seed)); if (state_seed == NULL) - return(NULL); + return (NULL); for (i = 0; i < state_size; i++) { /* @@ -314,7 +314,7 @@ ipf_state_seed_alloc(u_int state_size, u_int state_max) state_seed[i] *= state_max; #endif } - return(state_seed); + return (state_seed); } @@ -342,7 +342,7 @@ ipf_state_soft_init(ipf_main_softc_t *softc, void *arg) KMALLOCS(softs->ipf_state_table, ipstate_t **, softs->ipf_state_size * sizeof(ipstate_t *)); if (softs->ipf_state_table == NULL) - return(-1); + return (-1); bzero((char *)softs->ipf_state_table, softs->ipf_state_size * sizeof(ipstate_t *)); @@ -350,12 +350,12 @@ ipf_state_soft_init(ipf_main_softc_t *softc, void *arg) softs->ipf_state_seed = ipf_state_seed_alloc(softs->ipf_state_size, softs->ipf_state_max); if (softs->ipf_state_seed == NULL) - return(-2); + return (-2); KMALLOCS(softs->ipf_state_stats.iss_bucketlen, u_int *, softs->ipf_state_size * sizeof(u_int)); if (softs->ipf_state_stats.iss_bucketlen == NULL) - return(-3); + return (-3); bzero((char *)softs->ipf_state_stats.iss_bucketlen, softs->ipf_state_size * sizeof(u_int)); @@ -403,7 +403,7 @@ ipf_state_soft_init(ipf_main_softc_t *softc, void *arg) softs->ipf_state_wm_last = softc->ipf_ticks; softs->ipf_state_inited = 1; - return(0); + return (0); } @@ -474,7 +474,7 @@ ipf_state_soft_fini(ipf_main_softc_t *softc, void *arg) softs->ipf_state_stats.iss_bucketlen = NULL; } - return(0); + return (0); } @@ -522,7 +522,7 @@ ipf_state_stats(ipf_main_softc_t *softc) issp->iss_log_ok = 0; issp->iss_log_fail = 0; #endif - return(issp); + return (issp); } /* ------------------------------------------------------------------------ */ @@ -544,7 +544,7 @@ ipf_state_remove(ipf_main_softc_t *softc, caddr_t data) sp = &st; error = ipf_inobj(softc, data, NULL, &st, IPFOBJ_IPSTATE); if (error) - return(EFAULT); + return (EFAULT); WRITE_ENTER(&softc->ipf_state); for (sp = softs->ipf_state_list; sp; sp = sp->is_next) @@ -557,12 +557,12 @@ ipf_state_remove(ipf_main_softc_t *softc, caddr_t data) sizeof(st.is_ps))) { ipf_state_del(softc, sp, ISL_REMOVE); RWLOCK_EXIT(&softc->ipf_state); - return(0); + return (0); } RWLOCK_EXIT(&softc->ipf_state); IPFERROR(100001); - return(ESRCH); + return (ESRCH); } @@ -814,7 +814,7 @@ ipf_state_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, error = EINVAL; break; } - return(error); + return (error); } @@ -841,7 +841,7 @@ ipf_state_getent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, error = ipf_inobj(softc, data, NULL, &ips, IPFOBJ_STATESAVE); if (error) - return(EFAULT); + return (EFAULT); READ_ENTER(&softc->ipf_state); isn = ips.ips_next; @@ -851,9 +851,9 @@ ipf_state_getent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, if (ips.ips_next == NULL) { RWLOCK_EXIT(&softc->ipf_state); IPFERROR(100021); - return(ENOENT); + return (ENOENT); } - return(0); + return (0); } } else { /* @@ -867,7 +867,7 @@ ipf_state_getent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, if (!is) { RWLOCK_EXIT(&softc->ipf_state); IPFERROR(100022); - return(ESRCH); + return (ESRCH); } } ips.ips_next = isn->is_next; @@ -878,7 +878,7 @@ ipf_state_getent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, sizeof(ips.ips_fr)); RWLOCK_EXIT(&softc->ipf_state); error = ipf_outobj(softc, data, &ips, IPFOBJ_STATESAVE); - return(error); + return (error); } @@ -906,12 +906,12 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, error = ipf_inobj(softc, data, NULL, &ips, IPFOBJ_STATESAVE); if (error != 0) - return(error); + return (error); KMALLOC(isn, ipstate_t *); if (isn == NULL) { IPFERROR(100023); - return(ENOMEM); + return (ENOMEM); } bcopy((char *)&ips.ips_is, (char *)isn, sizeof(*isn)); @@ -935,7 +935,7 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, MUTEX_EXIT(&isn->is_lock); RWLOCK_EXIT(&softc->ipf_state); - return(inserr); + return (inserr); } if (isn->is_flags & SI_NEWFR) { @@ -943,7 +943,7 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, if (fr == NULL) { KFREE(isn); IPFERROR(100024); - return(ENOMEM); + return (ENOMEM); } bcopy((char *)&ips.ips_fr, (char *)fr, sizeof(*fr)); out = fr->fr_flags & FR_OUTQUE ? 1 : 0; @@ -993,7 +993,7 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, MUTEX_DESTROY(&fr->fr_lock); KFREE(fr); IPFERROR(100025); - return(EFAULT); + return (EFAULT); } READ_ENTER(&softc->ipf_state); error = ipf_state_insert(softc, isn, 0); @@ -1021,7 +1021,7 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, } } - return(error); + return (error); } @@ -1084,7 +1084,7 @@ ipf_state_insert(ipf_main_softc_t *softc, ipstate_t *is, int rev) is->is_family, &is->is_src) == -1)) { SBUMPD(ipf_state_stats, iss_max_track); MUTEX_EXIT(&softs->ipf_stinsert); - return(-1); + return (-1); } MUTEX_ENTER(&fr->fr_lock); @@ -1123,7 +1123,7 @@ ipf_state_insert(ipf_main_softc_t *softc, ipstate_t *is, int rev) ipf_state_setqueue(softc, is, rev); - return(0); + return (0); } @@ -1151,7 +1151,7 @@ ipf_state_matchipv4addrs(ipstate_t *is1, ipstate_t *is2) else rv = 0; - return(rv); + return (rv); } @@ -1180,7 +1180,7 @@ ipf_state_matchipv6addrs(ipstate_t *is1, ipstate_t *is2) else rv = 0; - return(rv); + return (rv); } @@ -1220,7 +1220,7 @@ ipf_state_matchaddresses(ipstate_t *is1, ipstate_t *is2) rv = ipf_state_matchipv6addrs(is1, is2); } - return(rv); + return (rv); } @@ -1245,7 +1245,7 @@ ipf_state_matchports(udpinfo_t *ppairs1, udpinfo_t *ppairs2) else rv = 0; - return(rv); + return (rv); } @@ -1290,7 +1290,7 @@ ipf_state_matchisps(ipstate_t *is1, ipstate_t *is2) rv = 0; } - return(rv); + return (rv); } @@ -1318,7 +1318,7 @@ ipf_state_match(ipstate_t *is1, ipstate_t *is2) rv = 0; } - return(rv); + return (rv); } /* ------------------------------------------------------------------------ */ @@ -1363,17 +1363,17 @@ ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, if (softs->ipf_state_lock) { SBUMPD(ipf_state_stats, iss_add_locked); fin->fin_error = EAGAIN; - return(-1); + return (-1); } if (fin->fin_flx & (FI_SHORT|FI_STATE|FI_FRAGBODY|FI_BAD)) { SBUMPD(ipf_state_stats, iss_add_bad); - return(-1); + return (-1); } if ((fin->fin_flx & FI_OOW) && !(fin->fin_tcpf & TH_SYN)) { SBUMPD(ipf_state_stats, iss_add_oow); - return(-1); + return (-1); } if ((softs->ipf_state_stats.iss_active * 100 / softs->ipf_state_max) > @@ -1396,12 +1396,12 @@ ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, if ((softs->ipf_state_stats.iss_active >= softs->ipf_state_max) && (fr->fr_statemax == 0)) { SBUMPD(ipf_state_stats, iss_max); - return(1); + return (1); } if ((fr->fr_statemax != 0) && (fr->fr_statecnt >= fr->fr_statemax)) { SBUMPD(ipf_state_stats, iss_max_ref); - return(2); + return (2); } } @@ -1499,7 +1499,7 @@ ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, break; default : SBUMPD(ipf_state_stats, iss_icmp6_notquery); - return(-2); + return (-2); } break; #endif @@ -1517,7 +1517,7 @@ ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, break; default : SBUMPD(ipf_state_stats, iss_icmp_notquery); - return(-3); + return (-3); } break; @@ -1539,7 +1539,7 @@ ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, if (tcp->th_flags & TH_RST) { SBUMPD(ipf_state_stats, iss_tcp_rstadd); - return(-4); + return (-4); } /* TRACE is, flags, hv */ @@ -1637,13 +1637,13 @@ ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, } if (is != NULL) { SBUMPD(ipf_state_stats, iss_add_dup); - return(3); + return (3); } if (softs->ipf_state_stats.iss_bucketlen[hv] >= softs->ipf_state_maxbucket) { SBUMPD(ipf_state_stats, iss_bucket_full); - return(4); + return (4); } /* @@ -1652,7 +1652,7 @@ ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, KMALLOC(is, ipstate_t *); if (is == NULL) { SBUMPD(ipf_state_stats, iss_nomem); - return(5); + return (5); } bcopy((char *)&ips, (char *)is, sizeof(*is)); is->is_flags = flags & IS_INHERITED; @@ -1742,7 +1742,7 @@ ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, is->is_tqehead[1] = NULL; } KFREE(is); - return(-1); + return (-1); } /* @@ -1845,7 +1845,7 @@ ipf_state_add(ipf_main_softc_t *softc, fr_info_t *fin, ipstate_t **stsave, } fin->fin_dif = &is->is_dif; - return(0); + return (0); } @@ -1872,7 +1872,7 @@ ipf_tcpoptions(ipf_state_softc_t *softs, fr_info_t *fin, tcphdr_t *tcp, len = (TCP_OFF(tcp) << 2); if (fin->fin_dlen < len) { SBUMPD(ipf_state_stats, iss_tcp_toosmall); - return(0); + return (0); } len -= sizeof(*tcp); @@ -1948,7 +1948,7 @@ ipf_tcpoptions(ipf_state_softc_t *softs, fr_info_t *fin, tcphdr_t *tcp, if (retval == -1) { SBUMPD(ipf_state_stats, iss_tcp_badopt); } - return(retval); + return (retval); } @@ -1995,7 +1995,7 @@ ipf_state_tcp(ipf_main_softc_t *softc, ipf_state_softc_t *softs, MUTEX_EXIT(&is->is_lock); DT1(iss_tcp_closing, ipstate_t *, is); SBUMP(ipf_state_stats.iss_tcp_closing); - return(0); + return (0); } } @@ -2014,7 +2014,7 @@ ipf_state_tcp(ipf_main_softc_t *softc, ipf_state_softc_t *softs, MUTEX_EXIT(&is->is_lock); DT2(iss_tcp_fsm, fr_info_t *, fin, ipstate_t *, is); SBUMP(ipf_state_stats.iss_tcp_fsm); - return(0); + return (0); } if (softs->ipf_state_logging > 4) @@ -2062,7 +2062,7 @@ ipf_state_tcp(ipf_main_softc_t *softc, ipf_state_softc_t *softs, ret = 0; } MUTEX_EXIT(&is->is_lock); - return(ret); + return (ret); } @@ -2192,7 +2192,7 @@ ipf_state_tcpinwindow(fr_info_t *fin, tcpdata_t *fdata, tcpdata_t *tdata, DT2(iss_tcp_struct, tcpdata_t *, fdata, int, seq); SBUMP(ipf_state_stats.iss_tcp_strict); fin->fin_flx |= FI_OOW; - return(0); + return (0); } } @@ -2278,11 +2278,11 @@ ipf_state_tcpinwindow(fr_info_t *fin, tcpdata_t *fdata, tcpdata_t *tdata, fdata->td_end = end; if (SEQ_GE(ack + win, tdata->td_maxend)) tdata->td_maxend = ack + win; - return(1); + return (1); } SBUMP(ipf_state_stats.iss_oow); fin->fin_flx |= FI_OOW; - return(0); + return (0); } @@ -2307,12 +2307,12 @@ ipf_state_clone(fr_info_t *fin, tcphdr_t *tcp, ipstate_t *is) if (softs->ipf_state_stats.iss_active == softs->ipf_state_max) { SBUMPD(ipf_state_stats, iss_max); softs->ipf_state_doflush = 1; - return(NULL); + return (NULL); } KMALLOC(clone, ipstate_t *); if (clone == NULL) { SBUMPD(ipf_state_stats, iss_clone_nomem); - return(NULL); + return (NULL); } bcopy((char *)is, (char *)clone, sizeof(*clone)); @@ -2355,7 +2355,7 @@ ipf_state_clone(fr_info_t *fin, tcphdr_t *tcp, ipstate_t *is) clone->is_flags |= SI_CLONED; if (ipf_state_insert(softc, clone, fin->fin_rev) == -1) { KFREE(clone); - return(NULL); + return (NULL); } clone->is_ref = 1; @@ -2368,7 +2368,7 @@ ipf_state_clone(fr_info_t *fin, tcphdr_t *tcp, ipstate_t *is) clone->is_sync = ipf_sync_new(softc, SMC_STATE, fin, clone); DT2(iss_clone, ipstate_t *, is, ipstate_t *, clone); SBUMP(ipf_state_stats.iss_cloned); - return(clone); + return (clone); } @@ -2402,7 +2402,7 @@ ipf_matchsrcdst(fr_info_t *fin, ipstate_t *is, i6addr_t *src, i6addr_t *dst, * are allowed to match it. */ if (is->is_sti.tqe_ifq == &softs->ipf_state_deletetq) - return(NULL); + return (NULL); rev = IP6_NEQ(&is->is_dst, dst); ifp = fin->fin_ifp; @@ -2439,7 +2439,7 @@ ipf_matchsrcdst(fr_info_t *fin, ipstate_t *is, i6addr_t *src, i6addr_t *dst, DT2(iss_lookup_badifp, fr_info_t *, fin, ipstate_t *, is); SBUMP(ipf_state_stats.iss_lookup_badifp); /* TRACE is, out, rev, idx */ - return(NULL); + return (NULL); } ret = 0; @@ -2476,7 +2476,7 @@ ipf_matchsrcdst(fr_info_t *fin, ipstate_t *is, i6addr_t *src, i6addr_t *dst, SBUMP(ipf_state_stats.iss_lookup_badport); DT2(iss_lookup_badport, fr_info_t *, fin, ipstate_t *, is); /* TRACE rev, is, sp, dp, src, dst */ - return(NULL); + return (NULL); } /* @@ -2533,12 +2533,12 @@ ipf_matchsrcdst(fr_info_t *fin, ipstate_t *is, i6addr_t *src, i6addr_t *dst, ((fin->fin_secmsk & is->is_secmsk) != is->is_sec) || ((fin->fin_auth & is->is_authmsk) != is->is_auth)) { SBUMPD(ipf_state_stats, iss_miss_mask); - return(NULL); + return (NULL); } if ((fin->fin_flx & FI_IGNORE) != 0) { fin->fin_rev = rev; - return(is); + return (is); } /* @@ -2552,7 +2552,7 @@ ipf_matchsrcdst(fr_info_t *fin, ipstate_t *is, i6addr_t *src, i6addr_t *dst, clone = ipf_state_clone(fin, tcp, is); if (clone == NULL) - return(NULL); + return (NULL); is = clone; } else { ATOMIC_DECL(softs->ipf_state_stats.iss_wild); @@ -2606,7 +2606,7 @@ ipf_matchsrcdst(fr_info_t *fin, ipstate_t *is, i6addr_t *src, i6addr_t *dst, COPYIFNAME(fin->fin_v, ifp, is->is_ifname[idx]); } fin->fin_rev = rev; - return(is); + return (is); } @@ -2639,7 +2639,7 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) u_int hv; /* - * Does it at least have the return(basic) IP header ? + * Does it at least have the return (basic) IP header ? * Is it an actual recognised ICMP error type? * Only a basic IP header (no options) should be with * an ICMP error header. @@ -2648,7 +2648,7 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) (fin->fin_plen < ICMPERR_MINPKTLEN) || !(fin->fin_flx & FI_ICMPERR)) { SBUMPD(ipf_state_stats, iss_icmp_bad); - return(NULL); + return (NULL); } ic = fin->fin_dp; type = ic->icmp_type; @@ -2660,7 +2660,7 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) */ if (fin->fin_plen < ICMPERR_MAXPKTLEN + ((IP_HL(oip) - 5) << 2)) { SBUMPDX(ipf_state_stats, iss_icmp_short, iss_icmp_short_1); - return(NULL); + return (NULL); } /* @@ -2670,7 +2670,7 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) if ((len <= 0) || ((IP_HL(oip) << 2) > len)) { DT2(iss_icmp_len, fr_info_t *, fin, struct ip*, oip); SBUMPDX(ipf_state_stats, iss_icmp_short, iss_icmp_short_1); - return(NULL); + return (NULL); } /* @@ -2690,12 +2690,12 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) # if SOLARIS if ((char *)oip + len > (char *)m->b_wptr) { SBUMPDX(ipf_state_stats, iss_icmp_short, iss_icmp_short_2); - return(NULL); + return (NULL); } # else if ((char *)oip + len > (char *)fin->fin_ip + m->m_len) { SBUMPDX(ipf_state_stats, iss_icmp_short, iss_icmp_short_3); - return(NULL); + return (NULL); } # endif } @@ -2766,7 +2766,7 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) if ((ofin.fin_flx & FI_ICMPERR) != 0) { DT1(iss_icmp_icmperr, fr_info_t *, &ofin); SBUMP(ipf_state_stats.iss_icmp_icmperr); - return(NULL); + return (NULL); } /* @@ -2788,17 +2788,17 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) is = ipf_matchsrcdst(&ofin, is, &src, &dst, NULL, FI_ICMPCMP); if ((is != NULL) && !ipf_allowstateicmp(fin, is, &src)) - return(is); + return (is); } RWLOCK_EXIT(&softc->ipf_state); SBUMPDX(ipf_state_stats, iss_icmp_miss, iss_icmp_miss_1); - return(NULL); + return (NULL); case IPPROTO_TCP : case IPPROTO_UDP : break; default : SBUMPDX(ipf_state_stats, iss_icmp_miss, iss_icmp_miss_2); - return(NULL); + return (NULL); } tcp = (tcphdr_t *)((char *)oip + (IP_HL(oip) << 2)); @@ -2823,12 +2823,12 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) (is = ipf_matchsrcdst(&ofin, is, &src, &dst, tcp, FI_ICMPCMP))) { if (ipf_allowstateicmp(fin, is, &src) == 0) - return(is); + return (is); } } RWLOCK_EXIT(&softc->ipf_state); SBUMPDX(ipf_state_stats, iss_icmp_miss, iss_icmp_miss_3); - return(NULL); + return (NULL); } @@ -2864,7 +2864,7 @@ ipf_allowstateicmp(fr_info_t *fin, ipstate_t *is, i6addr_t *src) fin->fin_fr = savefr; if (FR_ISBLOCK(ipass)) { SBUMPD(ipf_state_stats, iss_icmp_headblock); - return(1); + return (1); } } @@ -2882,11 +2882,11 @@ ipf_allowstateicmp(fr_info_t *fin, ipstate_t *is, i6addr_t *src) if (is->is_pass & FR_NOICMPERR) { SBUMPD(ipf_state_stats, iss_icmp_banned); - return(1); + return (1); } if (is->is_icmppkts[i] > is->is_pkts[oi]) { SBUMPD(ipf_state_stats, iss_icmp_toomany); - return(1); + return (1); } DT2(iss_icmp_hits, fr_info_t *, fin, ipstate_t *, is); @@ -2898,7 +2898,7 @@ ipf_allowstateicmp(fr_info_t *fin, ipstate_t *is, i6addr_t *src) * for the accompanying state table entry. * It remains to be seen if that is correct. XXX */ - return(0); + return (0); } @@ -3089,7 +3089,7 @@ ipf_state_lookup(fr_info_t *fin, tcphdr_t *tcp, ipftq_t **ifqp) is = ipf_checkicmp6matchingstate(fin); if (is != NULL) - return(is); + return (is); break; #endif @@ -3234,7 +3234,7 @@ ipf_state_lookup(fr_info_t *fin, tcphdr_t *tcp, ipftq_t **ifqp) } else { SBUMP(ipf_state_stats.iss_lookup_miss); } - return(is); + return (is); } @@ -3261,11 +3261,11 @@ ipf_state_check(fr_info_t *fin, u_32_t *passp) int inout; if (softs->ipf_state_lock || (softs->ipf_state_list == NULL)) - return(NULL); + return (NULL); if (fin->fin_flx & (FI_SHORT|FI_FRAGBODY|FI_BAD)) { SBUMPD(ipf_state_stats, iss_check_bad); - return(NULL); + return (NULL); } if ((fin->fin_flx & FI_TCPUDP) || @@ -3325,7 +3325,7 @@ ipf_state_check(fr_info_t *fin, u_32_t *passp) } if (is == NULL) { SBUMP(ipf_state_stats.iss_check_miss); - return(NULL); + return (NULL); } fr = is->is_rule; @@ -3334,12 +3334,12 @@ ipf_state_check(fr_info_t *fin, u_32_t *passp) if (fin->fin_nattag == NULL) { RWLOCK_EXIT(&softc->ipf_state); SBUMPD(ipf_state_stats, iss_check_notag); - return(NULL); + return (NULL); } if (ipf_matchtag(&fr->fr_nattag, fin->fin_nattag)!=0) { RWLOCK_EXIT(&softc->ipf_state); SBUMPD(ipf_state_stats, iss_check_nattag); - return(NULL); + return (NULL); } } (void) strncpy(fin->fin_group, FR_NAME(fr, fr_group), @@ -3393,7 +3393,7 @@ ipf_state_check(fr_info_t *fin, u_32_t *passp) if ((pass & FR_LOGFIRST) != 0) pass &= ~(FR_LOGFIRST|FR_LOG); *passp = pass; - return(fr); + return (fr); } @@ -3592,7 +3592,7 @@ ipf_state_del(ipf_main_softc_t *softc, ipstate_t *is, int why) MUTEX_EXIT(&is->is_lock); if (!orphan) softs->ipf_state_stats.iss_orphan++; - return(refs); + return (refs); } fr = is->is_rule; @@ -3653,7 +3653,7 @@ ipf_state_del(ipf_main_softc_t *softc, ipstate_t *is, int why) KFREE(is); softs->ipf_state_stats.iss_active--; - return(0); + return (0); } @@ -3864,7 +3864,7 @@ ipf_state_flush(ipf_main_softc_t *softc, int which, int proto) if (which != 2) { SPL_X(s); - return(removed); + return (removed); } SBUMP(ipf_state_stats.iss_flush_timeout); @@ -3887,7 +3887,7 @@ ipf_state_flush(ipf_main_softc_t *softc, int which, int proto) } SPL_X(s); - return(removed); + return (removed); } @@ -3905,7 +3905,7 @@ ipf_state_flush(ipf_main_softc_t *softc, int which, int proto) static int ipf_state_flush_entry(ipf_main_softc_t *softc, void *entry) { - return(ipf_state_del(softc, entry, ISL_FLUSH)); + return (ipf_state_del(softc, entry, ISL_FLUSH)); } @@ -4281,7 +4281,7 @@ ipf_tcp_age(ipftqent_t *tqe, fr_info_t *fin, ipftq_t *tqtab, int flags, int ok) tqtab + nstate); } - return(rval); + return (rval); } @@ -4382,7 +4382,7 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) int type; /* - * Does it at least have the return(basic) IP header ? + * Does it at least have the return (basic) IP header ? * Is it an actual recognised ICMP error type? * Only a basic IP header (no options) should be with * an ICMP error header. @@ -4390,7 +4390,7 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) if ((fin->fin_v != 6) || (fin->fin_plen < ICMP6ERR_MINPKTLEN) || !(fin->fin_flx & FI_ICMPERR)) { SBUMPD(ipf_state_stats, iss_icmp_bad); - return(NULL); + return (NULL); } ic6 = fin->fin_dp; @@ -4399,7 +4399,7 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) oip6 = (ip6_t *)((char *)ic6 + ICMPERR_ICMPHLEN); if (fin->fin_plen < sizeof(*oip6)) { SBUMPD(ipf_state_stats, iss_icmp_short); - return(NULL); + return (NULL); } bcopy((char *)fin, (char *)&ofin, sizeof(*fin)); @@ -4434,7 +4434,7 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) if (ofin.fin_flx & FI_ICMPERR) { DT1(iss_icmp6_icmperr, fr_info_t *, &ofin); SBUMP(ipf_state_stats.iss_icmp6_icmperr); - return(NULL); + return (NULL); } if (oip6->ip6_nxt == IPPROTO_ICMPV6) { @@ -4449,7 +4449,7 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) if (!(oic->icmp6_type & ICMP6_INFOMSG_MASK)) { DT1(iss_icmp6_notinfo, fr_info_t *, &ofin); SBUMP(ipf_state_stats.iss_icmp6_notinfo); - return(NULL); + return (NULL); } /* @@ -4484,13 +4484,13 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) (oic->icmp6_type == ICMP6_ECHO_REQUEST)) || (ic->ici_type - 1 == oic->icmp6_type )) { if (!ipf_allowstateicmp(fin, is, &src)) - return(is); + return (is); } } } RWLOCK_EXIT(&softc->ipf_state); SBUMPD(ipf_state_stats, iss_icmp6_miss); - return(NULL); + return (NULL); } hv = (pr = oip6->ip6_nxt); @@ -4545,11 +4545,11 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) continue; is = ipf_matchsrcdst(&ofin, is, &src, &dst, tcp, FI_ICMPCMP); if ((is != NULL) && (ipf_allowstateicmp(fin, is, &src) == 0)) - return(is); + return (is); } RWLOCK_EXIT(&softc->ipf_state); SBUMPD(ipf_state_stats, iss_icmp_miss); - return(NULL); + return (NULL); } #endif @@ -4757,23 +4757,23 @@ ipf_state_iter(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp, if (itp->igi_data == NULL) { IPFERROR(100026); - return(EFAULT); + return (EFAULT); } if (itp->igi_nitems < 1) { IPFERROR(100027); - return(ENOSPC); + return (ENOSPC); } if (itp->igi_type != IPFGENITER_STATE) { IPFERROR(100028); - return(EINVAL); + return (EINVAL); } is = token->ipt_data; if (is == (void *)-1) { IPFERROR(100029); - return(ESRCH); + return (ESRCH); } error = 0; @@ -4813,7 +4813,7 @@ ipf_state_iter(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp, if (is != NULL) ipf_state_deref(softc, &is); - return(error); + return (error); } @@ -4836,11 +4836,11 @@ ipf_state_gettable(ipf_main_softc_t *softc, ipf_state_softc_t *softs, error = ipf_inobj(softc, data, NULL, &table, IPFOBJ_GTABLE); if (error != 0) - return(error); + return (error); if (table.ita_type != IPFTABLE_BUCKETS) { IPFERROR(100031); - return(EINVAL); + return (EINVAL); } error = COPYOUT(softs->ipf_state_stats.iss_bucketlen, table.ita_table, @@ -4849,7 +4849,7 @@ ipf_state_gettable(ipf_main_softc_t *softc, ipf_state_softc_t *softs, IPFERROR(100032); error = EFAULT; } - return(error); + return (error); } @@ -4908,7 +4908,7 @@ ipf_state_matchflush(ipf_main_softc_t *softc, caddr_t data) error = ipf_matcharray_load(softc, data, &obj, &array); if (error != 0) - return(error); + return (error); flushed = 0; @@ -4925,7 +4925,7 @@ ipf_state_matchflush(ipf_main_softc_t *softc, caddr_t data) KFREES(array, array[0] * sizeof(*array)); - return(error); + return (error); } @@ -5083,7 +5083,7 @@ ipf_state_matcharray(ipstate_t *state, int *array, u_long ticks) break; } - return(rv); + return (rv); } @@ -5109,10 +5109,10 @@ ipf_state_settimeout(struct ipf_main_softc_s *softc, ipftuneable_t *t, * In case there is nothing to do... */ if (*t->ipft_pint == p->ipftu_int) - return(0); + return (0); if (!strncmp(t->ipft_name, "tcp_", 4)) - return(ipf_settimeout_tcp(t, p, softs->ipf_state_tcptq)); + return (ipf_settimeout_tcp(t, p, softs->ipf_state_tcptq)); if (!strcmp(t->ipft_name, "udp_timeout")) { ipf_apply_timeout(&softs->ipf_state_udptq, p->ipftu_int); @@ -5126,7 +5126,7 @@ ipf_state_settimeout(struct ipf_main_softc_s *softc, ipftuneable_t *t, ipf_apply_timeout(&softs->ipf_state_iptq, p->ipftu_int); } else { IPFERROR(100034); - return(ESRCH); + return (ESRCH); } /* @@ -5134,7 +5134,7 @@ ipf_state_settimeout(struct ipf_main_softc_s *softc, ipftuneable_t *t, */ *t->ipft_pint = p->ipftu_int; - return(0); + return (0); } @@ -5166,19 +5166,19 @@ ipf_state_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, ipftuneval_t *p) * In case there is nothing to do... */ if (newsize == softs->ipf_state_size) - return(0); + return (0); KMALLOCS(newtab, ipstate_t **, newsize * sizeof(ipstate_t *)); if (newtab == NULL) { IPFERROR(100035); - return(ENOMEM); + return (ENOMEM); } KMALLOCS(bucketlens, u_int *, newsize * sizeof(u_int)); if (bucketlens == NULL) { KFREES(newtab, newsize * sizeof(*softs->ipf_state_table)); IPFERROR(100036); - return(ENOMEM); + return (ENOMEM); } newseed = ipf_state_seed_alloc(newsize, softs->ipf_state_max); @@ -5186,7 +5186,7 @@ ipf_state_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, ipftuneval_t *p) KFREES(bucketlens, newsize * sizeof(*bucketlens)); KFREES(newtab, newsize * sizeof(*newtab)); IPFERROR(100037); - return(ENOMEM); + return (ENOMEM); } for (maxbucket = 0, i = newsize; i > 0; i >>= 1) @@ -5240,7 +5240,7 @@ ipf_state_rehash(ipf_main_softc_t *softc, ipftuneable_t *t, ipftuneval_t *p) } RWLOCK_EXIT(&softc->ipf_state); - return(0); + return (0); } @@ -5260,7 +5260,7 @@ ipf_state_add_tq(ipf_main_softc_t *softc, int ttl) { ipf_state_softc_t *softs = softc->ipf_state_soft; - return(ipf_addtimeoutqueue(softc, &softs->ipf_state_usertq, ttl)); + return (ipf_addtimeoutqueue(softc, &softs->ipf_state_usertq, ttl)); } diff --git a/sys/netpfil/ipfilter/netinet/ip_sync.c b/sys/netpfil/ipfilter/netinet/ip_sync.c index 1d61f4618fb9..b6172342656f 100644 --- a/sys/netpfil/ipfilter/netinet/ip_sync.c +++ b/sys/netpfil/ipfilter/netinet/ip_sync.c @@ -147,7 +147,7 @@ ipf_sync_soft_create(ipf_main_softc_t *softc) KMALLOC(softs, ipf_sync_softc_t *); if (softs == NULL) { IPFERROR(110024); - return(NULL); + return (NULL); } bzero((char *)softs, sizeof(*softs)); @@ -158,7 +158,7 @@ ipf_sync_soft_create(ipf_main_softc_t *softc) softs->ipf_sync_event_high_wm = SYNCLOG_SZ * 100 / 90; /* 90% */ softs->ipf_sync_queue_high_wm = SYNCLOG_SZ * 100 / 90; /* 90% */ - return(softs); + return (softs); } @@ -178,28 +178,28 @@ ipf_sync_soft_init(ipf_main_softc_t *softc, void *arg) KMALLOCS(softs->synclog, synclogent_t *, softs->ipf_sync_log_sz * sizeof(*softs->synclog)); if (softs->synclog == NULL) - return(-1); + return (-1); bzero((char *)softs->synclog, softs->ipf_sync_log_sz * sizeof(*softs->synclog)); KMALLOCS(softs->syncupd, syncupdent_t *, softs->ipf_sync_log_sz * sizeof(*softs->syncupd)); if (softs->syncupd == NULL) - return(-2); + return (-2); bzero((char *)softs->syncupd, softs->ipf_sync_log_sz * sizeof(*softs->syncupd)); KMALLOCS(softs->syncstatetab, synclist_t **, softs->ipf_sync_state_tab_sz * sizeof(*softs->syncstatetab)); if (softs->syncstatetab == NULL) - return(-3); + return (-3); bzero((char *)softs->syncstatetab, softs->ipf_sync_state_tab_sz * sizeof(*softs->syncstatetab)); KMALLOCS(softs->syncnattab, synclist_t **, softs->ipf_sync_nat_tab_sz * sizeof(*softs->syncnattab)); if (softs->syncnattab == NULL) - return(-3); + return (-3); bzero((char *)softs->syncnattab, softs->ipf_sync_nat_tab_sz * sizeof(*softs->syncnattab)); @@ -223,7 +223,7 @@ ipf_sync_soft_init(ipf_main_softc_t *softc, void *arg) softs->ipf_sync_inited = 1; - return(0); + return (0); } @@ -277,7 +277,7 @@ ipf_sync_soft_fini(ipf_main_softc_t *softc, void *arg) softs->ipf_sync_inited = 0; } - return(0); + return (0); } void @@ -437,7 +437,7 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) if (softs->ipf_sync_debug > 2) printf("uiomove(header) failed: %d\n", err); - return(err); + return (err); } /* convert to host order */ @@ -456,7 +456,7 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) printf("uiomove(header) invalid %s\n", "magic"); IPFERROR(110001); - return(EINVAL); + return (EINVAL); } if (sh.sm_v != 4 && sh.sm_v != 6) { @@ -464,7 +464,7 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) printf("uiomove(header) invalid %s\n", "protocol"); IPFERROR(110002); - return(EINVAL); + return (EINVAL); } if (sh.sm_cmd > SMC_MAXCMD) { @@ -472,7 +472,7 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) printf("uiomove(header) invalid %s\n", "command"); IPFERROR(110003); - return(EINVAL); + return (EINVAL); } @@ -481,7 +481,7 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) printf("uiomove(header) invalid %s\n", "table"); IPFERROR(110004); - return(EINVAL); + return (EINVAL); } } else { @@ -489,7 +489,7 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) if (softs->ipf_sync_debug > 2) printf("uiomove(header) insufficient data"); IPFERROR(110005); - return(EAGAIN); + return (EAGAIN); } @@ -504,7 +504,7 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) printf("uiomove(data zero length %s\n", "not supported"); IPFERROR(110006); - return(EINVAL); + return (EINVAL); } if (uio->uio_resid >= sh.sm_len) { @@ -515,7 +515,7 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) if (softs->ipf_sync_debug > 2) printf("uiomove(data) failed: %d\n", err); - return(err); + return (err); } if (softs->ipf_sync_debug > 7) @@ -537,12 +537,12 @@ ipf_sync_write(ipf_main_softc_t *softc, struct uio *uio) "insufficient data, need", sh.sm_len, (int)uio->uio_resid); IPFERROR(110007); - return(EAGAIN); + return (EAGAIN); } } /* no more data */ - return(0); + return (0); } @@ -565,7 +565,7 @@ ipf_sync_read(ipf_main_softc_t *softc, struct uio *uio) if ((uio->uio_resid & 3) || (uio->uio_resid < 8)) { IPFERROR(110008); - return(EINVAL); + return (EINVAL); } # if defined(__NetBSD__) || defined(__FreeBSD__) @@ -580,14 +580,14 @@ ipf_sync_read(ipf_main_softc_t *softc, struct uio *uio) if (!cv_wait_sig(&softs->ipslwait, &softs->ipsl_mutex.ipf_lk)) { MUTEX_EXIT(&softs->ipsl_mutex); IPFERROR(110009); - return(EINTR); + return (EINTR); } # else MUTEX_EXIT(&softs->ipsl_mutex); err = SLEEP(&softs->sl_tail, "ipl sleep"); if (err) { IPFERROR(110012); - return(EINTR); + return (EINTR); } MUTEX_ENTER(&softs->ipsl_mutex); # endif /* SOLARIS */ @@ -622,7 +622,7 @@ ipf_sync_read(ipf_main_softc_t *softc, struct uio *uio) softs->su_tail = softs->su_idx = 0; MUTEX_EXIT(&softs->ipsl_mutex); goterror: - return(err); + return (err); } @@ -794,7 +794,7 @@ ipf_sync_state(ipf_main_softc_t *softc, synchdr_t *sp, void *data) printf("[%d] Update completed with error %d\n", sp->sm_num, err); - return(err); + return (err); } @@ -951,7 +951,7 @@ ipf_sync_nat(ipf_main_softc_t *softc, synchdr_t *sp, void *data) } RWLOCK_EXIT(&softs->ipf_syncnat); - return(err); + return (err); } @@ -975,10 +975,10 @@ ipf_sync_new(ipf_main_softc_t *softc, int tab, fr_info_t *fin, void *ptr) u_int hv, sz; if (softs->sl_idx == softs->ipf_sync_log_sz) - return(NULL); + return (NULL); KMALLOC(sl, synclist_t *); if (sl == NULL) - return(NULL); + return (NULL); MUTEX_ENTER(&softs->ipf_syncadd); /* @@ -1083,7 +1083,7 @@ ipf_sync_new(ipf_main_softc_t *softc, int tab, fr_info_t *fin, void *ptr) MUTEX_EXIT(&softs->ipf_syncadd); ipf_sync_wakeup(softc); - return(sl); + return (sl); } @@ -1210,7 +1210,7 @@ ipf_sync_flush_table(ipf_sync_softc_t *softs, int tabsize, synclist_t **table) } } - return(items); + return (items); } @@ -1289,7 +1289,7 @@ ipf_sync_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, break; } - return(error); + return (error); } @@ -1322,7 +1322,7 @@ ipf_sync_canread(void *arg) int ipf_sync_canwrite(void *arg) { - return(1); + return (1); } diff --git a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c index a6e4b3616e67..d81de100120b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c @@ -89,7 +89,7 @@ ipf_p_tftp_soft_create(ipf_main_softc_t *softc) KMALLOC(softt, ipf_tftp_softc_t *); if (softt == NULL) - return(NULL); + return (NULL); bzero((char *)softt, sizeof(*softt)); @@ -98,16 +98,16 @@ ipf_p_tftp_soft_create(ipf_main_softc_t *softc) ipf_tftp_tuneables); if (softt->ipf_p_tftp_tune == NULL) { ipf_p_tftp_soft_destroy(softc, softt); - return(NULL); + return (NULL); } if (ipf_tune_array_link(softc, softt->ipf_p_tftp_tune) == -1) { ipf_p_tftp_soft_destroy(softc, softt); - return(NULL); + return (NULL); } softt->ipf_p_tftp_readonly = 1; - return(softt); + return (softt); } @@ -133,8 +133,8 @@ ipf_p_tftp_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) fin->fin_flx |= FI_NOWILD; if (nat->nat_dir == NAT_OUTBOUND) - return(ipf_p_tftp_client(softt, fin, aps, nat)); - return(ipf_p_tftp_server(softt, fin, aps, nat)); + return (ipf_p_tftp_client(softt, fin, aps, nat)); + return (ipf_p_tftp_server(softt, fin, aps, nat)); } @@ -145,8 +145,8 @@ ipf_p_tftp_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) fin->fin_flx |= FI_NOWILD; if (nat->nat_dir == NAT_INBOUND) - return(ipf_p_tftp_client(softt, fin, aps, nat)); - return(ipf_p_tftp_server(softt, fin, aps, nat)); + return (ipf_p_tftp_client(softt, fin, aps, nat)); + return (ipf_p_tftp_server(softt, fin, aps, nat)); } @@ -166,11 +166,11 @@ ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) KMALLOC(ti, tftpinfo_t *); if (ti == NULL) - return(-1); + return (-1); KMALLOCS(ipn, ipnat_t *, size); if (ipn == NULL) { KFREE(ti); - return(-1); + return (-1); } aps->aps_data = ti; @@ -242,7 +242,7 @@ ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ti->ti_lastcmd = 0; - return(0); + return (0); } @@ -394,7 +394,7 @@ ipf_p_tftp_backchannel(fr_info_t *fin, ap_session_t *aps, nat_t *nat) ip6->ip6_dst = sw2ip6.in6; #endif } - return(0); + return (0); } @@ -409,7 +409,7 @@ ipf_p_tftp_client(ipf_tftp_softc_t *softt, fr_info_t *fin, ap_session_t *aps, int len; if (fin->fin_dlen < 4) - return(0); + return (0); ti = aps->aps_data; msg = fin->fin_dp; @@ -436,12 +436,12 @@ ipf_p_tftp_client(ipf_tftp_softc_t *softt, fr_info_t *fin, ap_session_t *aps, ipf_p_tftp_backchannel(fin, aps, nat); break; default : - return(-1); + return (-1); } ti = aps->aps_data; ti->ti_lastcmd = opcode; - return(0); + return (0); } @@ -455,7 +455,7 @@ ipf_p_tftp_server(ipf_tftp_softc_t *softt, fr_info_t *fin, ap_session_t *aps, u_char *msg; if (fin->fin_dlen < 4) - return(0); + return (0); ti = aps->aps_data; msg = fin->fin_dp; @@ -474,9 +474,9 @@ ipf_p_tftp_server(ipf_tftp_softc_t *softt, fr_info_t *fin, ap_session_t *aps, break; default : - return(-1); + return (-1); } ti->ti_lastcmd = opcode; - return(0); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/ipf_rb.h b/sys/netpfil/ipfilter/netinet/ipf_rb.h index 477c6eaf01cb..e047c7f44a4a 100644 --- a/sys/netpfil/ipfilter/netinet/ipf_rb.h +++ b/sys/netpfil/ipfilter/netinet/ipf_rb.h @@ -283,7 +283,7 @@ colour: \ if (color == C_BLACK) \ deleteblack(head, parent, node); \ head->count--; \ - return(old); \ + return (old); \ } \ \ void \ @@ -350,8 +350,8 @@ _n##_rb_search(struct _n##_rb_head *head, void *key) \ node = node->_f.right; \ } \ if (node == &_n##_rb_zero || match != 0) \ - return(NULL); \ - return(node); \ + return (NULL); \ + return (node); \ } #define RBI_DELETE(_n, _h, _v) _n##_rb_delete(_h, _v) diff --git a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c index 610280b6bef4..872471bac38b 100644 --- a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c +++ b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c @@ -197,7 +197,7 @@ ipfilter_modevent(module_t mod, int type, void *unused) error = EINVAL; break; } - return(error); + return (error); } @@ -252,10 +252,10 @@ ipf_modload(void) int i, j, error; if (ipf_load_all() != 0) - return(EIO); + return (EIO); if (ipf_fbsd_sysctl_create() != 0) { - return(EIO); + return (EIO); } for (i = 0; i < IPL_LOGSIZE; i++) @@ -274,10 +274,10 @@ ipf_modload(void) error = ipf_pfil_hook(); if (error != 0) - return(error); + return (error); ipf_event_reg(); - return(0); + return (0); } static void @@ -315,7 +315,7 @@ ipf_modunload(void) error = ipf_pfil_unhook(); if (error != 0) - return(error); + return (error); for (i = 0; ipf_devfiles[i]; i++) { if (ipf_devs[i] != NULL) @@ -326,7 +326,7 @@ ipf_modunload(void) printf("%s unloaded\n", ipfilter_version); - return(0); + return (0); } @@ -367,7 +367,7 @@ sysctl_ipf_int ( SYSCTL_HANDLER_ARGS ) } sysctl_error: - return(error); + return (error); } /* @@ -382,7 +382,7 @@ sysctl_ipf_int_nat ( SYSCTL_HANDLER_ARGS ) nat_softc = V_ipfmain.ipf_nat_soft; arg1 = (void *)((uintptr_t)nat_softc + arg2); - return(sysctl_ipf_int(oidp, arg1, 0, req)); + return (sysctl_ipf_int(oidp, arg1, 0, req)); } static int @@ -393,7 +393,7 @@ sysctl_ipf_int_state ( SYSCTL_HANDLER_ARGS ) state_softc = V_ipfmain.ipf_state_soft; arg1 = (void *)((uintptr_t)state_softc + arg2); - return(sysctl_ipf_int(oidp, arg1, 0, req)); + return (sysctl_ipf_int(oidp, arg1, 0, req)); } static int @@ -404,7 +404,7 @@ sysctl_ipf_int_auth ( SYSCTL_HANDLER_ARGS ) auth_softc = V_ipfmain.ipf_auth_soft; arg1 = (void *)((uintptr_t)auth_softc + arg2); - return(sysctl_ipf_int(oidp, arg1, 0, req)); + return (sysctl_ipf_int(oidp, arg1, 0, req)); } static int @@ -415,7 +415,7 @@ sysctl_ipf_int_frag ( SYSCTL_HANDLER_ARGS ) frag_softc = V_ipfmain.ipf_frag_soft; arg1 = (void *)((uintptr_t)frag_softc + arg2); - return(sysctl_ipf_int(oidp, arg1, 0, req)); + return (sysctl_ipf_int(oidp, arg1, 0, req)); } #endif @@ -431,7 +431,7 @@ ipfpoll(dev_t dev, int events, struct proc *td) int revents; if (unit < 0 || unit > IPL_LOGMAX) - return(0); + return (0); revents = 0; @@ -466,7 +466,7 @@ ipfpoll(dev_t dev, int events, struct proc *td) selrecord(td, &V_ipfmain.ipf_selwait[unit]); CURVNET_RESTORE(); - return(revents); + return (revents); } @@ -504,7 +504,7 @@ ipfopen(dev_t dev, int flags) break; } } - return(error); + return (error); } @@ -521,7 +521,7 @@ ipfclose(dev_t dev, int flags) unit = ENXIO; else unit = 0; - return(unit); + return (unit); } /* @@ -543,18 +543,18 @@ static int ipfread(dev, uio, ioflag) int unit = GET_MINOR(dev); if (unit < 0) - return(ENXIO); + return (ENXIO); CURVNET_SET(TD_TO_VNET(curthread)); if (V_ipfmain.ipf_running < 1) { CURVNET_RESTORE(); - return(EIO); + return (EIO); } if (unit == IPL_LOGSYNC) { error = ipf_sync_read(&V_ipfmain, uio); CURVNET_RESTORE(); - return(error); + return (error); } #ifdef IPFILTER_LOG @@ -563,7 +563,7 @@ static int ipfread(dev, uio, ioflag) error = ENXIO; #endif CURVNET_RESTORE(); - return(error); + return (error); } @@ -587,15 +587,15 @@ static int ipfwrite(dev, uio, ioflag) CURVNET_SET(TD_TO_VNET(curthread)); if (V_ipfmain.ipf_running < 1) { CURVNET_RESTORE(); - return(EIO); + return (EIO); } if (GET_MINOR(dev) == IPL_LOGSYNC) { error = ipf_sync_write(&V_ipfmain, uio); CURVNET_RESTORE(); - return(error); + return (error); } - return(ENXIO); + return (ENXIO); } static int @@ -628,7 +628,7 @@ ipf_fbsd_sysctl_create(void) NULL, offsetof(ipf_auth_softc_t, ipf_auth_defaultage), ""); SYSCTL_DYN_IPF_FRAG(_net_inet_ipf, OID_AUTO, "fr_ipfrttl", CTLFLAG_RW, NULL, offsetof(ipf_frag_softc_t, ipfr_ttl), ""); - return(0); + return (0); } static int @@ -636,7 +636,7 @@ ipf_fbsd_sysctl_destroy(void) { if (sysctl_ctx_free(&ipf_clist)) { printf("sysctl_ctx_free failed"); - return(ENOTEMPTY); + return (ENOTEMPTY); } - return(0); + return (0); } diff --git a/sys/netpfil/ipfilter/netinet/radix_ipf.c b/sys/netpfil/ipfilter/netinet/radix_ipf.c index 6f129dd15de1..95daee99ec42 100644 --- a/sys/netpfil/ipfilter/netinet/radix_ipf.c +++ b/sys/netpfil/ipfilter/netinet/radix_ipf.c @@ -78,7 +78,7 @@ count_mask_bits(addrfamily_t *mask, u_32_t **lastp) count++; } - return(count); + return (count); } @@ -155,7 +155,7 @@ ipf_rx_find_addr(ipf_rdx_node_t *tree, u_32_t *addr) } } - return(cur); + return (cur); } @@ -201,7 +201,7 @@ ipf_rx_match(ipf_rdx_head_t *head, addrfamily_t *addr) if ((*key & *mask) != *data) break; if ((end == key) && (cur->root == 0)) - return(cur); /* Equal keys */ + return (cur); /* Equal keys */ } prev = node->parent; key = (u_32_t *)addr; @@ -220,12 +220,12 @@ ipf_rx_match(ipf_rdx_head_t *head, addrfamily_t *addr) for (i = ADF_OFF >> 2; i <= node->offset; i++) { if ((key[i] & masknode->mask[i]) == cur->addrkey[i]) - return(cur); + return (cur); } } } - return(NULL); + return (NULL); } @@ -250,7 +250,7 @@ ipf_rx_lookup(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask) found = ipf_rx_find_addr(head->root, (u_32_t *)addr); if (found->root == 1) - return(NULL); + return (NULL); /* * It is possible to find a matching address in the tree but for the @@ -259,22 +259,22 @@ ipf_rx_lookup(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask) */ count = count_mask_bits(mask, NULL); if (count != found->maskbitcount && found->dupkey == NULL) - return(NULL); + return (NULL); akey = (u_32_t *)addr; if ((found->addrkey[found->offset] & found->maskkey[found->offset]) != akey[found->offset]) - return(NULL); + return (NULL); if (found->dupkey != NULL) { node = found; while (node != NULL && node->maskbitcount != count) node = node->dupkey; if (node == NULL) - return(NULL); + return (NULL); found = node; } - return(found); + return (found); } @@ -347,7 +347,7 @@ ipf_rx_insert(ipf_rdx_head_t *head, ipf_rdx_node_t *nodes, int *dup) break; if (end == data) { *dup = 1; - return(node); /* Equal keys */ + return (node); /* Equal keys */ } *dup = 0; @@ -416,7 +416,7 @@ ipf_rx_insert(ipf_rdx_head_t *head, ipf_rdx_node_t *nodes, int *dup) KMALLOC(mask, ipf_rdx_mask_t *); if (mask == NULL) - return(NULL); + return (NULL); bzero(mask, sizeof(*mask)); mask->next = NULL; mask->node = &nodes[0]; @@ -467,7 +467,7 @@ ipf_rx_insert(ipf_rdx_head_t *head, ipf_rdx_node_t *nodes, int *dup) } } } - return(&nodes[0]); + return (&nodes[0]); } /* ------------------------------------------------------------------------ */ @@ -504,7 +504,7 @@ ipf_rx_addroute(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask, buildnodes(addr, mask, nodes); x = ipf_rx_insert(head, nodes, &dup); if (x == NULL) - return(NULL); + return (NULL); if (dup == 1) { node = &nodes[0]; @@ -526,7 +526,7 @@ ipf_rx_addroute(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask, * of netmasks active for this key. */ if ((x != NULL) && (x->maskbitcount == node->maskbitcount)) - return(NULL); + return (NULL); if (prev != NULL) { nodes[0].dupkey = x; @@ -546,7 +546,7 @@ ipf_rx_addroute(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask, } } - return(&nodes[0]); + return (&nodes[0]); } @@ -577,9 +577,9 @@ ipf_rx_delete(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask) found = ipf_rx_find_addr(head->root, (u_32_t *)addr); if (found == NULL) - return(NULL); + return (NULL); if (found->root == 1) - return(NULL); + return (NULL); count = count_mask_bits(mask, NULL); parent = found->parent; if (found->dupkey != NULL) { @@ -587,7 +587,7 @@ ipf_rx_delete(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask) while (node != NULL && node->maskbitcount != count) node = node->dupkey; if (node == NULL) - return(NULL); + return (NULL); if (node != found) { /* * Remove from the dupkey list. Here, "parent" is @@ -617,7 +617,7 @@ ipf_rx_delete(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask) } } else { if (count != found->maskbitcount) - return(NULL); + return (NULL); /* * Remove the node from the tree and reconnect the subtree * below. @@ -724,7 +724,7 @@ ipf_rx_delete(ipf_rdx_head_t *head, addrfamily_t *addr, addrfamily_t *mask) } } - return(found); + return (found); } @@ -795,7 +795,7 @@ ipf_rx_inithead(radix_softc_t *softr, ipf_rdx_head_t **headp) KMALLOC(ptr, ipf_rdx_head_t *); *headp = ptr; if (ptr == NULL) - return(-1); + return (-1); bzero(ptr, sizeof(*ptr)); node = ptr->nodes; ptr->root = node + 1; @@ -828,7 +828,7 @@ ipf_rx_inithead(radix_softc_t *softr, ipf_rdx_head_t **headp) ptr->lookup = ipf_rx_lookup; ptr->matchaddr = ipf_rx_match; ptr->walktree = ipf_rx_walktree; - return(0); + return (0); } @@ -859,17 +859,17 @@ ipf_rx_create(void) KMALLOC(softr, radix_softc_t *); if (softr == NULL) - return(NULL); + return (NULL); bzero((char *)softr, sizeof(*softr)); KMALLOCS(softr->zeros, u_char *, 3 * sizeof(addrfamily_t)); if (softr->zeros == NULL) { KFREE(softr); - return(NULL); + return (NULL); } softr->ones = softr->zeros + sizeof(addrfamily_t); - return(softr); + return (softr); } @@ -886,7 +886,7 @@ ipf_rx_init(void *ctx) memset(softr->zeros, 0, 3 * sizeof(addrfamily_t)); memset(softr->ones, 0xff, sizeof(addrfamily_t)); - return(0); + return (0); } @@ -1026,7 +1026,7 @@ addrname(addrfamily_t *ap) bzero((char *)name, sizeof(name)); txt = inet_ntop(ap->adf_family, &ap->adf_addr, name, sizeof(name)); - return(txt); + return (txt); } @@ -1261,7 +1261,7 @@ main(int argc, char *argv[]) ipf_rx_walktree(rnh, ipf_rx_freenode, rnh); - return(0); + return (0); } @@ -1442,7 +1442,7 @@ randomize(int *pnitems) order[i] = choice; } - return(order); + return (order); }