ipfilter module: Fix whitespace errors
Replace leading spaces with a tabs on affected lines. MFC after: 1 month
This commit is contained in:
parent
27fc223414
commit
80030b6cc7
@ -4613,7 +4613,7 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data,
|
||||
ftail = NULL;
|
||||
fprev = NULL;
|
||||
if (unit == IPL_LOGAUTH) {
|
||||
if ((fp->fr_tifs[0].fd_ptr != NULL) ||
|
||||
if ((fp->fr_tifs[0].fd_ptr != NULL) ||
|
||||
(fp->fr_tifs[1].fd_ptr != NULL) ||
|
||||
(fp->fr_dif.fd_ptr != NULL) ||
|
||||
(fp->fr_flags & FR_FASTROUTE)) {
|
||||
|
@ -189,7 +189,7 @@ ipf_p_dns_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat)
|
||||
if (di == NULL) {
|
||||
printf("ipf_dns_new:KMALLOCS(%d) failed\n", sizeof(*di));
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
MUTEX_INIT(&di->dnsi_lock, "dns lock");
|
||||
|
||||
|
@ -174,7 +174,7 @@ ipf_timer_func(void *arg)
|
||||
SPL_NET(s);
|
||||
READ_ENTER(&softc->ipf_global);
|
||||
|
||||
if (softc->ipf_running > 0)
|
||||
if (softc->ipf_running > 0)
|
||||
ipf_slowtimer(softc);
|
||||
|
||||
if (softc->ipf_running == -1 || softc->ipf_running == 1) {
|
||||
@ -274,7 +274,7 @@ ipfioctl(struct cdev *dev, ioctlcmd_t cmd, caddr_t data,
|
||||
SPL_INT(s);
|
||||
|
||||
CURVNET_SET(TD_TO_VNET(p));
|
||||
if (securelevel_ge(p->p_cred, 3) && (mode & FWRITE))
|
||||
if (securelevel_ge(p->p_cred, 3) && (mode & FWRITE))
|
||||
{
|
||||
V_ipfmain.ipf_interror = 130001;
|
||||
CURVNET_RESTORE();
|
||||
|
@ -1207,14 +1207,14 @@ ipf_frag_next(ipf_main_softc_t *softc, ipftoken_t *token, ipfgeniter_t *itp,
|
||||
if (error != 0)
|
||||
IPFERROR(20002);
|
||||
|
||||
if (frag != NULL) {
|
||||
if (frag != NULL) {
|
||||
#ifdef USE_MUTEXES
|
||||
ipf_frag_deref(softc, &frag, lock);
|
||||
#else
|
||||
ipf_frag_deref(softc, &frag);
|
||||
#endif
|
||||
}
|
||||
return(error);
|
||||
}
|
||||
return(error);
|
||||
}
|
||||
|
||||
|
||||
|
@ -505,8 +505,8 @@ static int
|
||||
ipf_htable_node_del(ipf_main_softc_t *softc, void *arg, iplookupop_t *op,
|
||||
int uid)
|
||||
{
|
||||
iphtable_t *iph;
|
||||
iphtent_t hte, *ent;
|
||||
iphtable_t *iph;
|
||||
iphtent_t hte, *ent;
|
||||
int err;
|
||||
|
||||
if (op->iplo_size != sizeof(hte)) {
|
||||
|
@ -606,18 +606,18 @@ ipf_nat6_newmap(fr_info_t *fin, nat_t *nat, natinfo_t *ni)
|
||||
|
||||
} else if (((np->in_redir & NAT_MAPBLK) == 0) &&
|
||||
(flags & IPN_TCPUDPICMP) && (np->in_spnext != 0)) {
|
||||
/*
|
||||
* Standard port translation. Select next port.
|
||||
*/
|
||||
if (np->in_flags & IPN_SEQUENTIAL) {
|
||||
port = np->in_spnext;
|
||||
} else {
|
||||
/*
|
||||
* Standard port translation. Select next port.
|
||||
*/
|
||||
if (np->in_flags & IPN_SEQUENTIAL) {
|
||||
port = np->in_spnext;
|
||||
} else {
|
||||
port = ipf_random() % (np->in_spmax -
|
||||
np->in_spmin + 1);
|
||||
port += np->in_spmin;
|
||||
}
|
||||
port = htons(port);
|
||||
np->in_spnext++;
|
||||
port += np->in_spmin;
|
||||
}
|
||||
port = htons(port);
|
||||
np->in_spnext++;
|
||||
|
||||
if (np->in_spnext > np->in_spmax) {
|
||||
np->in_spnext = np->in_spmin;
|
||||
|
@ -490,9 +490,9 @@ ipf_proxy_soft_destroy(ipf_main_softc_t *softc, void *arg)
|
||||
}
|
||||
|
||||
if (softp->ipf_proxy_tune != NULL) {
|
||||
ipf_tune_array_unlink(softc, softp->ipf_proxy_tune);
|
||||
KFREES(softp->ipf_proxy_tune, sizeof(ipf_proxy_tuneables));
|
||||
softp->ipf_proxy_tune = NULL;
|
||||
ipf_tune_array_unlink(softc, softp->ipf_proxy_tune);
|
||||
KFREES(softp->ipf_proxy_tune, sizeof(ipf_proxy_tuneables));
|
||||
softp->ipf_proxy_tune = NULL;
|
||||
}
|
||||
|
||||
KFREE(softp);
|
||||
|
@ -216,7 +216,7 @@ typedef struct ircinfo {
|
||||
* For the DNS "proxy"
|
||||
*/
|
||||
typedef struct dnsinfo {
|
||||
ipfmutex_t dnsi_lock;
|
||||
ipfmutex_t dnsi_lock;
|
||||
u_short dnsi_id;
|
||||
char dnsi_buffer[512];
|
||||
} dnsinfo_t;
|
||||
@ -286,10 +286,10 @@ typedef struct msnrpcinfo {
|
||||
*/
|
||||
#define RPCB_BUF_END(r) (char *)((r)->rm_msgbuf + (r)->rm_buflen)
|
||||
#define RPCB_BUF_GEQ(r, p, l) \
|
||||
((RPCB_BUF_END((r)) > (char *)(p)) && \
|
||||
((RPCB_BUF_END((r)) - (char *)(p)) >= (l)))
|
||||
((RPCB_BUF_END((r)) > (char *)(p)) && \
|
||||
((RPCB_BUF_END((r)) - (char *)(p)) >= (l)))
|
||||
#define RPCB_BUF_EQ(r, p, l) \
|
||||
(RPCB_BUF_END((r)) == ((char *)(p) + (l)))
|
||||
(RPCB_BUF_END((r)) == ((char *)(p) + (l)))
|
||||
|
||||
/*
|
||||
* The following correspond to RPC(B) detailed in RFC183[13].
|
||||
@ -428,7 +428,7 @@ typedef struct rpcb_xact {
|
||||
} rpcb_xact_t;
|
||||
|
||||
typedef struct rpcb_session {
|
||||
ipfmutex_t rs_rxlock;
|
||||
ipfmutex_t rs_rxlock;
|
||||
rpcb_xact_t *rs_rxlist;
|
||||
} rpcb_session_t;
|
||||
|
||||
|
@ -307,11 +307,11 @@ ipf_p_rpcb_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat)
|
||||
switch(rv)
|
||||
{
|
||||
case -1: /* Bad packet */
|
||||
if (rx != NULL) {
|
||||
MUTEX_ENTER(&rs->rs_rxlock);
|
||||
ipf_p_rpcb_deref(rs, rx);
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
}
|
||||
if (rx != NULL) {
|
||||
MUTEX_ENTER(&rs->rs_rxlock);
|
||||
ipf_p_rpcb_deref(rs, rx);
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
}
|
||||
return(APR_ERR(1));
|
||||
/*NOTREACHED*/
|
||||
break;
|
||||
@ -338,16 +338,16 @@ ipf_p_rpcb_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat)
|
||||
}
|
||||
|
||||
if (rx != NULL) {
|
||||
MUTEX_ENTER(&rs->rs_rxlock);
|
||||
/* XXX Gross hack - I'm overloading the reference
|
||||
* counter to deal with both threads and retransmitted
|
||||
* requests. One deref signals that this thread is
|
||||
* finished with rx, and the other signals that we've
|
||||
* processed its reply.
|
||||
*/
|
||||
ipf_p_rpcb_deref(rs, rx);
|
||||
ipf_p_rpcb_deref(rs, rx);
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
MUTEX_ENTER(&rs->rs_rxlock);
|
||||
/* XXX Gross hack - I'm overloading the reference
|
||||
* counter to deal with both threads and retransmitted
|
||||
* requests. One deref signals that this thread is
|
||||
* finished with rx, and the other signals that we've
|
||||
* processed its reply.
|
||||
*/
|
||||
ipf_p_rpcb_deref(rs, rx);
|
||||
ipf_p_rpcb_deref(rs, rx);
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
}
|
||||
|
||||
return(diff);
|
||||
@ -492,12 +492,12 @@ ipf_p_rpcb_decodereq(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
MUTEX_ENTER(&rs->rs_rxlock);
|
||||
MUTEX_ENTER(&rs->rs_rxlock);
|
||||
if (ipf_p_rpcb_insert(rs, &rx) != 0) {
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
return(-1);
|
||||
}
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
|
||||
return(mod);
|
||||
}
|
||||
@ -556,9 +556,9 @@ 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;
|
||||
++rxp->rx_ref;
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (V_rpcbcnt == RPCB_MAXREQS)
|
||||
return(-1);
|
||||
@ -837,13 +837,13 @@ ipf_p_rpcb_decoderep(fr_info_t *fin, nat_t *nat, rpcb_session_t *rs,
|
||||
xdr = B(p++); /* Record this message's XID. */
|
||||
|
||||
/* Lookup XID */
|
||||
MUTEX_ENTER(&rs->rs_rxlock);
|
||||
MUTEX_ENTER(&rs->rs_rxlock);
|
||||
if ((rx = ipf_p_rpcb_lookup(rs, xdr)) == NULL) {
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
return(-1);
|
||||
}
|
||||
++rx->rx_ref; /* per thread reference */
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
}
|
||||
++rx->rx_ref; /* per thread reference */
|
||||
MUTEX_EXIT(&rs->rs_rxlock);
|
||||
|
||||
*rxp = rx;
|
||||
|
||||
@ -1392,13 +1392,13 @@ ipf_p_rpcb_modv4(fr_info_t *fin, nat_t *nat, rpc_msg_t *rm, mb_t *m,
|
||||
static void
|
||||
ipf_p_rpcb_fixlen(fr_info_t *fin, int len)
|
||||
{
|
||||
udphdr_t *udp;
|
||||
udphdr_t *udp;
|
||||
|
||||
udp = fin->fin_dp;
|
||||
udp->uh_ulen = htons(ntohs(udp->uh_ulen) + len);
|
||||
fin->fin_plen += len;
|
||||
fin->fin_ip->ip_len = htons(fin->fin_plen);
|
||||
fin->fin_dlen += len;
|
||||
udp = fin->fin_dp;
|
||||
udp->uh_ulen = htons(ntohs(udp->uh_ulen) + len);
|
||||
fin->fin_plen += len;
|
||||
fin->fin_ip->ip_len = htons(fin->fin_plen);
|
||||
fin->fin_dlen += len;
|
||||
}
|
||||
|
||||
#undef B
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1234,7 +1234,7 @@ ipf_sync_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd,
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case SIOCIPFFL:
|
||||
case SIOCIPFFL:
|
||||
error = BCOPYIN(data, &i, sizeof(i));
|
||||
if (error != 0) {
|
||||
IPFERROR(110023);
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define IPF_TFTP_PROXY
|
||||
|
||||
typedef struct ipf_tftp_softc_s {
|
||||
int ipf_p_tftp_readonly;
|
||||
int ipf_p_tftp_readonly;
|
||||
ipftuneable_t *ipf_p_tftp_tune;
|
||||
} ipf_tftp_softc_t;
|
||||
|
||||
|
@ -89,23 +89,23 @@ static int ipfwrite(dev_t, struct uio *, int);
|
||||
SYSCTL_DECL(_net_inet);
|
||||
#define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, \
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
|
||||
ptr, val, sysctl_ipf_int, "I", descr)
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
|
||||
ptr, val, sysctl_ipf_int, "I", descr)
|
||||
#define SYSCTL_DYN_IPF_NAT(parent, nbr, name, access,ptr, val, descr) \
|
||||
SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE |access, \
|
||||
ptr, val, sysctl_ipf_int_nat, "I", descr)
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE |access, \
|
||||
ptr, val, sysctl_ipf_int_nat, "I", descr)
|
||||
#define SYSCTL_DYN_IPF_STATE(parent, nbr, name, access,ptr, val, descr) \
|
||||
SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
|
||||
ptr, val, sysctl_ipf_int_state, "I", descr)
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
|
||||
ptr, val, sysctl_ipf_int_state, "I", descr)
|
||||
#define SYSCTL_DYN_IPF_FRAG(parent, nbr, name, access,ptr, val, descr) \
|
||||
SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
|
||||
ptr, val, sysctl_ipf_int_frag, "I", descr)
|
||||
#define SYSCTL_DYN_IPF_AUTH(parent, nbr, name, access,ptr, val, descr) \
|
||||
SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
|
||||
CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
|
||||
ptr, val, sysctl_ipf_int_auth, "I", descr)
|
||||
static struct sysctl_ctx_list ipf_clist;
|
||||
#define CTLFLAG_OFF 0x00800000 /* IPFilter must be disabled */
|
||||
|
Loading…
Reference in New Issue
Block a user