[NETFILTER]: Fix whitespace errors
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a3c941b08d
commit
601e68e100
43 changed files with 422 additions and 422 deletions
|
@ -141,14 +141,14 @@ unsigned int nf_iterate(struct list_head *head,
|
|||
continue;
|
||||
|
||||
/* Optimization: we don't need to hold module
|
||||
reference here, since function can't sleep. --RR */
|
||||
reference here, since function can't sleep. --RR */
|
||||
verdict = elem->hook(hook, skb, indev, outdev, okfn);
|
||||
if (verdict != NF_ACCEPT) {
|
||||
#ifdef CONFIG_NETFILTER_DEBUG
|
||||
if (unlikely((verdict & NF_VERDICT_MASK)
|
||||
> NF_MAX_VERDICT)) {
|
||||
NFDEBUG("Evil return from %p(%u).\n",
|
||||
elem->hook, hook);
|
||||
elem->hook, hook);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1066,7 +1066,7 @@ get_next_corpse(int (*iter)(struct nf_conn *i, void *data),
|
|||
if (iter(ct, data))
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
}
|
||||
list_for_each_entry(h, &unconfirmed, list) {
|
||||
ct = nf_ct_tuplehash_to_ctrack(h);
|
||||
if (iter(ct, data))
|
||||
|
@ -1286,9 +1286,9 @@ int __init nf_conntrack_init(void)
|
|||
|
||||
/* Don't NEED lock here, but good form anyway. */
|
||||
write_lock_bh(&nf_conntrack_lock);
|
||||
for (i = 0; i < AF_MAX; i++)
|
||||
for (i = 0; i < AF_MAX; i++)
|
||||
nf_ct_l3protos[i] = &nf_conntrack_l3proto_generic;
|
||||
write_unlock_bh(&nf_conntrack_lock);
|
||||
write_unlock_bh(&nf_conntrack_lock);
|
||||
|
||||
/* For use by REJECT target */
|
||||
rcu_assign_pointer(ip_ct_attach, __nf_conntrack_attach);
|
||||
|
|
|
@ -130,7 +130,7 @@ void nf_ct_remove_expectations(struct nf_conn *ct)
|
|||
if (i->master == ct && del_timer(&i->timeout)) {
|
||||
nf_ct_unlink_expect(i);
|
||||
nf_conntrack_expect_put(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nf_ct_remove_expectations);
|
||||
|
|
|
@ -126,7 +126,7 @@ get_ipv6_addr(const char *src, size_t dlen, struct in6_addr *dst, u_int8_t term)
|
|||
}
|
||||
|
||||
static int try_number(const char *data, size_t dlen, u_int32_t array[],
|
||||
int array_size, char sep, char term)
|
||||
int array_size, char sep, char term)
|
||||
{
|
||||
u_int32_t i, len;
|
||||
|
||||
|
@ -413,8 +413,8 @@ static int help(struct sk_buff **pskb,
|
|||
goto out_update_nl;
|
||||
}
|
||||
|
||||
/* Initialize IP/IPv6 addr to expected address (it's not mentioned
|
||||
in EPSV responses) */
|
||||
/* Initialize IP/IPv6 addr to expected address (it's not mentioned
|
||||
in EPSV responses) */
|
||||
cmd.l3num = ct->tuplehash[dir].tuple.src.l3num;
|
||||
memcpy(cmd.u3.all, &ct->tuplehash[dir].tuple.src.u3.all,
|
||||
sizeof(cmd.u3.all));
|
||||
|
@ -466,11 +466,11 @@ static int help(struct sk_buff **pskb,
|
|||
memcmp(&cmd.u3.all, &ct->tuplehash[dir].tuple.src.u3.all,
|
||||
sizeof(cmd.u3.all))) {
|
||||
/* Enrico Scholz's passive FTP to partially RNAT'd ftp
|
||||
server: it really wants us to connect to a
|
||||
different IP address. Simply don't record it for
|
||||
NAT. */
|
||||
server: it really wants us to connect to a
|
||||
different IP address. Simply don't record it for
|
||||
NAT. */
|
||||
if (cmd.l3num == PF_INET) {
|
||||
DEBUGP("conntrack_ftp: NOT RECORDING: " NIPQUAD_FMT " != " NIPQUAD_FMT "\n",
|
||||
DEBUGP("conntrack_ftp: NOT RECORDING: " NIPQUAD_FMT " != " NIPQUAD_FMT "\n",
|
||||
NIPQUAD(cmd.u3.ip),
|
||||
NIPQUAD(ct->tuplehash[dir].tuple.src.u3.ip));
|
||||
} else {
|
||||
|
|
|
@ -49,7 +49,7 @@ MODULE_PARM_DESC(gkrouted_only, "only accept calls from gatekeeper");
|
|||
static int callforward_filter __read_mostly = 1;
|
||||
module_param(callforward_filter, bool, 0600);
|
||||
MODULE_PARM_DESC(callforward_filter, "only create call forwarding expectations "
|
||||
"if both endpoints are on different sides "
|
||||
"if both endpoints are on different sides "
|
||||
"(determined by routing information)");
|
||||
|
||||
/* Hooks for NAT */
|
||||
|
@ -300,7 +300,7 @@ static int expect_rtp_rtcp(struct sk_buff **pskb, struct nf_conn *ct,
|
|||
IPPROTO_UDP, NULL, &rtcp_port);
|
||||
|
||||
if (memcmp(&ct->tuplehash[dir].tuple.src.u3,
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
sizeof(ct->tuplehash[dir].tuple.src.u3)) &&
|
||||
(nat_rtp_rtcp = rcu_dereference(nat_rtp_rtcp_hook)) &&
|
||||
ct->status & IPS_NAT_MASK) {
|
||||
|
@ -743,7 +743,7 @@ static int callforward_do_filter(union nf_conntrack_address *src,
|
|||
rt2 = (struct rt6_info *)ip6_route_output(NULL, &fl2);
|
||||
if (rt2) {
|
||||
if (!memcmp(&rt1->rt6i_gateway, &rt2->rt6i_gateway,
|
||||
sizeof(rt1->rt6i_gateway)) &&
|
||||
sizeof(rt1->rt6i_gateway)) &&
|
||||
rt1->u.dst.dev == rt2->u.dst.dev)
|
||||
ret = 1;
|
||||
dst_release(&rt2->u.dst);
|
||||
|
@ -780,7 +780,7 @@ static int expect_callforwarding(struct sk_buff **pskb,
|
|||
* we don't need to track the second call */
|
||||
if (callforward_filter &&
|
||||
callforward_do_filter(&addr, &ct->tuplehash[!dir].tuple.src.u3,
|
||||
ct->tuplehash[!dir].tuple.src.l3num)) {
|
||||
ct->tuplehash[!dir].tuple.src.l3num)) {
|
||||
DEBUGP("nf_ct_q931: Call Forwarding not tracked\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -840,7 +840,7 @@ static int process_setup(struct sk_buff **pskb, struct nf_conn *ct,
|
|||
if ((setup->options & eSetup_UUIE_destCallSignalAddress) &&
|
||||
(set_h225_addr) && ct->status && IPS_NAT_MASK &&
|
||||
get_h225_addr(ct, *data, &setup->destCallSignalAddress,
|
||||
&addr, &port) &&
|
||||
&addr, &port) &&
|
||||
memcmp(&addr, &ct->tuplehash[!dir].tuple.src.u3, sizeof(addr))) {
|
||||
DEBUGP("nf_ct_q931: set destCallSignalAddress "
|
||||
NIP6_FMT ":%hu->" NIP6_FMT ":%hu\n",
|
||||
|
@ -858,7 +858,7 @@ static int process_setup(struct sk_buff **pskb, struct nf_conn *ct,
|
|||
if ((setup->options & eSetup_UUIE_sourceCallSignalAddress) &&
|
||||
(set_h225_addr) && ct->status & IPS_NAT_MASK &&
|
||||
get_h225_addr(ct, *data, &setup->sourceCallSignalAddress,
|
||||
&addr, &port) &&
|
||||
&addr, &port) &&
|
||||
memcmp(&addr, &ct->tuplehash[!dir].tuple.dst.u3, sizeof(addr))) {
|
||||
DEBUGP("nf_ct_q931: set sourceCallSignalAddress "
|
||||
NIP6_FMT ":%hu->" NIP6_FMT ":%hu\n",
|
||||
|
@ -1282,7 +1282,7 @@ static int expect_q931(struct sk_buff **pskb, struct nf_conn *ct,
|
|||
for (i = 0; i < count; i++) {
|
||||
if (get_h225_addr(ct, *data, &taddr[i], &addr, &port) &&
|
||||
memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3,
|
||||
sizeof(addr)) == 0 && port != 0)
|
||||
sizeof(addr)) == 0 && port != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1294,7 +1294,7 @@ static int expect_q931(struct sk_buff **pskb, struct nf_conn *ct,
|
|||
return -1;
|
||||
nf_conntrack_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num,
|
||||
gkrouted_only ? /* only accept calls from GK? */
|
||||
&ct->tuplehash[!dir].tuple.src.u3 :
|
||||
&ct->tuplehash[!dir].tuple.src.u3 :
|
||||
NULL,
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
IPPROTO_TCP, NULL, &port);
|
||||
|
@ -1513,7 +1513,7 @@ static int process_arq(struct sk_buff **pskb, struct nf_conn *ct,
|
|||
set_h225_addr = rcu_dereference(set_h225_addr_hook);
|
||||
if ((arq->options & eAdmissionRequest_destCallSignalAddress) &&
|
||||
get_h225_addr(ct, *data, &arq->destCallSignalAddress,
|
||||
&addr, &port) &&
|
||||
&addr, &port) &&
|
||||
!memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3, sizeof(addr)) &&
|
||||
port == info->sig_port[dir] &&
|
||||
set_h225_addr && ct->status & IPS_NAT_MASK) {
|
||||
|
@ -1526,7 +1526,7 @@ static int process_arq(struct sk_buff **pskb, struct nf_conn *ct,
|
|||
|
||||
if ((arq->options & eAdmissionRequest_srcCallSignalAddress) &&
|
||||
get_h225_addr(ct, *data, &arq->srcCallSignalAddress,
|
||||
&addr, &port) &&
|
||||
&addr, &port) &&
|
||||
!memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3, sizeof(addr)) &&
|
||||
set_h225_addr && ct->status & IPS_NAT_MASK) {
|
||||
/* Calling ARQ */
|
||||
|
|
|
@ -57,7 +57,7 @@ static const char *dccprotos[] = {
|
|||
|
||||
#if 0
|
||||
#define DEBUGP(format, args...) printk(KERN_DEBUG "%s:%s:" format, \
|
||||
__FILE__, __FUNCTION__ , ## args)
|
||||
__FILE__, __FUNCTION__ , ## args)
|
||||
#else
|
||||
#define DEBUGP(format, args...)
|
||||
#endif
|
||||
|
|
|
@ -43,7 +43,7 @@ module_param(timeout, uint, 0400);
|
|||
MODULE_PARM_DESC(timeout, "timeout for master connection/replies in seconds");
|
||||
|
||||
static int help(struct sk_buff **pskb, unsigned int protoff,
|
||||
struct nf_conn *ct, enum ip_conntrack_info ctinfo)
|
||||
struct nf_conn *ct, enum ip_conntrack_info ctinfo)
|
||||
{
|
||||
struct nf_conntrack_expect *exp;
|
||||
struct iphdr *iph = (*pskb)->nh.iph;
|
||||
|
|
|
@ -314,7 +314,7 @@ nfattr_failure:
|
|||
|
||||
#ifdef CONFIG_NF_CONNTRACK_EVENTS
|
||||
static int ctnetlink_conntrack_event(struct notifier_block *this,
|
||||
unsigned long events, void *ptr)
|
||||
unsigned long events, void *ptr)
|
||||
{
|
||||
struct nlmsghdr *nlh;
|
||||
struct nfgenmsg *nfmsg;
|
||||
|
@ -383,16 +383,16 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
|
|||
|
||||
if (events & IPCT_PROTOINFO
|
||||
&& ctnetlink_dump_protoinfo(skb, ct) < 0)
|
||||
goto nfattr_failure;
|
||||
goto nfattr_failure;
|
||||
|
||||
if ((events & IPCT_HELPER || nfct_help(ct))
|
||||
&& ctnetlink_dump_helpinfo(skb, ct) < 0)
|
||||
goto nfattr_failure;
|
||||
goto nfattr_failure;
|
||||
|
||||
#ifdef CONFIG_NF_CONNTRACK_MARK
|
||||
if ((events & IPCT_MARK || ct->mark)
|
||||
&& ctnetlink_dump_mark(skb, ct) < 0)
|
||||
goto nfattr_failure;
|
||||
goto nfattr_failure;
|
||||
#endif
|
||||
|
||||
if (events & IPCT_COUNTER_FILLING &&
|
||||
|
@ -450,7 +450,7 @@ restart:
|
|||
cb->args[1] = 0;
|
||||
}
|
||||
if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid,
|
||||
cb->nlh->nlmsg_seq,
|
||||
cb->nlh->nlmsg_seq,
|
||||
IPCTNL_MSG_CT_NEW,
|
||||
1, ct) < 0) {
|
||||
nf_conntrack_get(&ct->ct_general);
|
||||
|
@ -1120,7 +1120,7 @@ nfattr_failure:
|
|||
|
||||
static inline int
|
||||
ctnetlink_exp_dump_expect(struct sk_buff *skb,
|
||||
const struct nf_conntrack_expect *exp)
|
||||
const struct nf_conntrack_expect *exp)
|
||||
{
|
||||
struct nf_conn *master = exp->master;
|
||||
__be32 timeout = htonl((exp->timeout.expires - jiffies) / HZ);
|
||||
|
@ -1279,7 +1279,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,
|
|||
u32 rlen;
|
||||
|
||||
if ((*errp = netlink_dump_start(ctnl, skb, nlh,
|
||||
ctnetlink_exp_dump_table,
|
||||
ctnetlink_exp_dump_table,
|
||||
ctnetlink_done)) != 0)
|
||||
return -EINVAL;
|
||||
rlen = NLMSG_ALIGN(nlh->nlmsg_len);
|
||||
|
|
|
@ -520,7 +520,7 @@ conntrack_pptp_help(struct sk_buff **pskb, unsigned int protoff,
|
|||
tcph = skb_header_pointer(*pskb, nexthdr_off, sizeof(_tcph), &_tcph);
|
||||
BUG_ON(!tcph);
|
||||
nexthdr_off += tcph->doff * 4;
|
||||
datalen = tcplen - tcph->doff * 4;
|
||||
datalen = tcplen - tcph->doff * 4;
|
||||
|
||||
pptph = skb_header_pointer(*pskb, nexthdr_off, sizeof(_pptph), &_pptph);
|
||||
if (!pptph) {
|
||||
|
|
|
@ -104,15 +104,15 @@ point. Please note the subtleties. -Kiran
|
|||
|
||||
NONE - Nothing so far.
|
||||
COOKIE WAIT - We have seen an INIT chunk in the original direction, or also
|
||||
an INIT_ACK chunk in the reply direction.
|
||||
an INIT_ACK chunk in the reply direction.
|
||||
COOKIE ECHOED - We have seen a COOKIE_ECHO chunk in the original direction.
|
||||
ESTABLISHED - We have seen a COOKIE_ACK in the reply direction.
|
||||
SHUTDOWN_SENT - We have seen a SHUTDOWN chunk in the original direction.
|
||||
SHUTDOWN_RECD - We have seen a SHUTDOWN chunk in the reply directoin.
|
||||
SHUTDOWN_ACK_SENT - We have seen a SHUTDOWN_ACK chunk in the direction opposite
|
||||
to that of the SHUTDOWN chunk.
|
||||
to that of the SHUTDOWN chunk.
|
||||
CLOSED - We have seen a SHUTDOWN_COMPLETE chunk in the direction of
|
||||
the SHUTDOWN chunk. Connection is closed.
|
||||
the SHUTDOWN chunk. Connection is closed.
|
||||
*/
|
||||
|
||||
/* TODO
|
||||
|
@ -407,7 +407,7 @@ static int sctp_packet(struct nf_conn *conntrack,
|
|||
sctp_inithdr_t _inithdr, *ih;
|
||||
|
||||
ih = skb_header_pointer(skb, offset + sizeof(sctp_chunkhdr_t),
|
||||
sizeof(_inithdr), &_inithdr);
|
||||
sizeof(_inithdr), &_inithdr);
|
||||
if (ih == NULL) {
|
||||
write_unlock_bh(&sctp_lock);
|
||||
return -1;
|
||||
|
@ -481,7 +481,7 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,
|
|||
sctp_inithdr_t _inithdr, *ih;
|
||||
|
||||
ih = skb_header_pointer(skb, offset + sizeof(sctp_chunkhdr_t),
|
||||
sizeof(_inithdr), &_inithdr);
|
||||
sizeof(_inithdr), &_inithdr);
|
||||
if (ih == NULL)
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ static enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = {
|
|||
/* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */
|
||||
/*rst*/ { sIV, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sIV },
|
||||
/*none*/ { sIV, sIV, sIV, sIV, sIV, sIV, sIV, sIV, sIV, sIV }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static int tcp_pkt_to_tuple(const struct sk_buff *skb,
|
||||
|
@ -361,7 +361,7 @@ static unsigned int get_conntrack_index(const struct tcphdr *tcph)
|
|||
after the right or before the left edge) and thus receivers may ACK
|
||||
segments after the right edge of the window.
|
||||
|
||||
td_maxend = max(sack + max(win,1)) seen in reply packets
|
||||
td_maxend = max(sack + max(win,1)) seen in reply packets
|
||||
td_maxwin = max(max(win, 1)) + (sack - ack) seen in sent packets
|
||||
td_maxwin += seq + len - sender.td_maxend
|
||||
if seq + len > sender.td_maxend
|
||||
|
@ -457,7 +457,7 @@ static void tcp_options(const struct sk_buff *skb,
|
|||
static void tcp_sack(const struct sk_buff *skb, unsigned int dataoff,
|
||||
struct tcphdr *tcph, __u32 *sack)
|
||||
{
|
||||
unsigned char buff[(15 * 4) - sizeof(struct tcphdr)];
|
||||
unsigned char buff[(15 * 4) - sizeof(struct tcphdr)];
|
||||
unsigned char *ptr;
|
||||
int length = (tcph->doff*4) - sizeof(struct tcphdr);
|
||||
__u32 tmp;
|
||||
|
@ -472,10 +472,10 @@ static void tcp_sack(const struct sk_buff *skb, unsigned int dataoff,
|
|||
/* Fast path for timestamp-only option */
|
||||
if (length == TCPOLEN_TSTAMP_ALIGNED*4
|
||||
&& *(__be32 *)ptr ==
|
||||
__constant_htonl((TCPOPT_NOP << 24)
|
||||
| (TCPOPT_NOP << 16)
|
||||
| (TCPOPT_TIMESTAMP << 8)
|
||||
| TCPOLEN_TIMESTAMP))
|
||||
__constant_htonl((TCPOPT_NOP << 24)
|
||||
| (TCPOPT_NOP << 16)
|
||||
| (TCPOPT_TIMESTAMP << 8)
|
||||
| TCPOLEN_TIMESTAMP))
|
||||
return;
|
||||
|
||||
while (length > 0) {
|
||||
|
@ -497,13 +497,13 @@ static void tcp_sack(const struct sk_buff *skb, unsigned int dataoff,
|
|||
|
||||
if (opcode == TCPOPT_SACK
|
||||
&& opsize >= (TCPOLEN_SACK_BASE
|
||||
+ TCPOLEN_SACK_PERBLOCK)
|
||||
+ TCPOLEN_SACK_PERBLOCK)
|
||||
&& !((opsize - TCPOLEN_SACK_BASE)
|
||||
% TCPOLEN_SACK_PERBLOCK)) {
|
||||
for (i = 0;
|
||||
i < (opsize - TCPOLEN_SACK_BASE);
|
||||
i += TCPOLEN_SACK_PERBLOCK) {
|
||||
tmp = ntohl(*((__be32 *)(ptr+i)+1));
|
||||
% TCPOLEN_SACK_PERBLOCK)) {
|
||||
for (i = 0;
|
||||
i < (opsize - TCPOLEN_SACK_BASE);
|
||||
i += TCPOLEN_SACK_PERBLOCK) {
|
||||
tmp = ntohl(*((__be32 *)(ptr+i)+1));
|
||||
|
||||
if (after(tmp, *sack))
|
||||
*sack = tmp;
|
||||
|
@ -517,11 +517,11 @@ static void tcp_sack(const struct sk_buff *skb, unsigned int dataoff,
|
|||
}
|
||||
|
||||
static int tcp_in_window(struct ip_ct_tcp *state,
|
||||
enum ip_conntrack_dir dir,
|
||||
unsigned int index,
|
||||
const struct sk_buff *skb,
|
||||
enum ip_conntrack_dir dir,
|
||||
unsigned int index,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
struct tcphdr *tcph,
|
||||
struct tcphdr *tcph,
|
||||
int pf)
|
||||
{
|
||||
struct ip_ct_tcp_state *sender = &state->seen[dir];
|
||||
|
@ -580,7 +580,7 @@ static int tcp_in_window(struct ip_ct_tcp *state,
|
|||
* We are in the middle of a connection,
|
||||
* its history is lost for us.
|
||||
* Let's try to use the data from the packet.
|
||||
*/
|
||||
*/
|
||||
sender->td_end = end;
|
||||
sender->td_maxwin = (win == 0 ? 1 : win);
|
||||
sender->td_maxend = end + sender->td_maxwin;
|
||||
|
@ -644,14 +644,14 @@ static int tcp_in_window(struct ip_ct_tcp *state,
|
|||
DEBUGP("tcp_in_window: I=%i II=%i III=%i IV=%i\n",
|
||||
before(seq, sender->td_maxend + 1),
|
||||
after(end, sender->td_end - receiver->td_maxwin - 1),
|
||||
before(sack, receiver->td_end + 1),
|
||||
after(ack, receiver->td_end - MAXACKWINDOW(sender)));
|
||||
before(sack, receiver->td_end + 1),
|
||||
after(ack, receiver->td_end - MAXACKWINDOW(sender)));
|
||||
|
||||
if (before(seq, sender->td_maxend + 1) &&
|
||||
after(end, sender->td_end - receiver->td_maxwin - 1) &&
|
||||
before(sack, receiver->td_end + 1) &&
|
||||
after(ack, receiver->td_end - MAXACKWINDOW(sender))) {
|
||||
/*
|
||||
/*
|
||||
* Take into account window scaling (RFC 1323).
|
||||
*/
|
||||
if (!tcph->syn)
|
||||
|
@ -712,7 +712,7 @@ static int tcp_in_window(struct ip_ct_tcp *state,
|
|||
: "ACK is over the upper bound (ACKed data not seen yet)"
|
||||
: "SEQ is under the lower bound (already ACKed data retransmitted)"
|
||||
: "SEQ is over the upper bound (over the window of the receiver)");
|
||||
}
|
||||
}
|
||||
|
||||
DEBUGP("tcp_in_window: res=%i sender end=%u maxend=%u maxwin=%u "
|
||||
"receiver end=%u maxend=%u maxwin=%u\n",
|
||||
|
@ -804,7 +804,7 @@ static int tcp_error(struct sk_buff *skb,
|
|||
nf_log_packet(pf, 0, skb, NULL, NULL, NULL,
|
||||
"nf_ct_tcp: short packet ");
|
||||
return -NF_ACCEPT;
|
||||
}
|
||||
}
|
||||
|
||||
/* Not whole TCP header or malformed packet */
|
||||
if (th->doff*4 < sizeof(struct tcphdr) || tcplen < th->doff*4) {
|
||||
|
@ -876,7 +876,7 @@ static int tcp_packet(struct nf_conn *conntrack,
|
|||
&& conntrack->proto.tcp.last_index == TCP_SYN_SET
|
||||
&& conntrack->proto.tcp.last_dir != dir
|
||||
&& ntohl(th->ack_seq) ==
|
||||
conntrack->proto.tcp.last_end) {
|
||||
conntrack->proto.tcp.last_end) {
|
||||
/* This SYN/ACK acknowledges a SYN that we earlier
|
||||
* ignored as invalid. This means that the client and
|
||||
* the server are both in sync, while the firewall is
|
||||
|
@ -884,14 +884,14 @@ static int tcp_packet(struct nf_conn *conntrack,
|
|||
* that the client cannot but retransmit its SYN and
|
||||
* thus initiate a clean new session.
|
||||
*/
|
||||
write_unlock_bh(&tcp_lock);
|
||||
write_unlock_bh(&tcp_lock);
|
||||
if (LOG_INVALID(IPPROTO_TCP))
|
||||
nf_log_packet(pf, 0, skb, NULL, NULL, NULL,
|
||||
"nf_ct_tcp: killing out of sync session ");
|
||||
if (del_timer(&conntrack->timeout))
|
||||
conntrack->timeout.function((unsigned long)
|
||||
conntrack);
|
||||
return -NF_DROP;
|
||||
if (del_timer(&conntrack->timeout))
|
||||
conntrack->timeout.function((unsigned long)
|
||||
conntrack);
|
||||
return -NF_DROP;
|
||||
}
|
||||
conntrack->proto.tcp.last_index = index;
|
||||
conntrack->proto.tcp.last_dir = dir;
|
||||
|
@ -921,13 +921,13 @@ static int tcp_packet(struct nf_conn *conntrack,
|
|||
IP_CT_TCP_FLAG_CLOSE_INIT)
|
||||
|| after(ntohl(th->seq),
|
||||
conntrack->proto.tcp.seen[dir].td_end)) {
|
||||
/* Attempt to reopen a closed connection.
|
||||
* Delete this connection and look up again. */
|
||||
write_unlock_bh(&tcp_lock);
|
||||
if (del_timer(&conntrack->timeout))
|
||||
conntrack->timeout.function((unsigned long)
|
||||
conntrack);
|
||||
return -NF_REPEAT;
|
||||
/* Attempt to reopen a closed connection.
|
||||
* Delete this connection and look up again. */
|
||||
write_unlock_bh(&tcp_lock);
|
||||
if (del_timer(&conntrack->timeout))
|
||||
conntrack->timeout.function((unsigned long)
|
||||
conntrack);
|
||||
return -NF_REPEAT;
|
||||
} else {
|
||||
write_unlock_bh(&tcp_lock);
|
||||
if (LOG_INVALID(IPPROTO_TCP))
|
||||
|
@ -938,9 +938,9 @@ static int tcp_packet(struct nf_conn *conntrack,
|
|||
case TCP_CONNTRACK_CLOSE:
|
||||
if (index == TCP_RST_SET
|
||||
&& ((test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)
|
||||
&& conntrack->proto.tcp.last_index == TCP_SYN_SET)
|
||||
|| (!test_bit(IPS_ASSURED_BIT, &conntrack->status)
|
||||
&& conntrack->proto.tcp.last_index == TCP_ACK_SET))
|
||||
&& conntrack->proto.tcp.last_index == TCP_SYN_SET)
|
||||
|| (!test_bit(IPS_ASSURED_BIT, &conntrack->status)
|
||||
&& conntrack->proto.tcp.last_index == TCP_ACK_SET))
|
||||
&& ntohl(th->ack_seq) == conntrack->proto.tcp.last_end) {
|
||||
/* RST sent to invalid SYN or ACK we had let through
|
||||
* at a) and c) above:
|
||||
|
@ -1140,7 +1140,7 @@ static int nfattr_to_tcp(struct nfattr *cda[], struct nf_conn *ct)
|
|||
if (!attr)
|
||||
return 0;
|
||||
|
||||
nfattr_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr);
|
||||
nfattr_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr);
|
||||
|
||||
if (nfattr_bad_size(tb, CTA_PROTOINFO_TCP_MAX, cta_min_tcp))
|
||||
return -EINVAL;
|
||||
|
|
|
@ -341,7 +341,7 @@ int ct_sip_get_info(struct nf_conn *ct,
|
|||
continue;
|
||||
}
|
||||
aux = ct_sip_search(hnfo->ln_str, dptr, hnfo->ln_strlen,
|
||||
ct_sip_lnlen(dptr, limit),
|
||||
ct_sip_lnlen(dptr, limit),
|
||||
hnfo->case_sensitive);
|
||||
if (!aux) {
|
||||
DEBUGP("'%s' not found in '%s'.\n", hnfo->ln_str,
|
||||
|
@ -451,12 +451,12 @@ static int sip_help(struct sk_buff **pskb,
|
|||
|
||||
/* We'll drop only if there are parse problems. */
|
||||
if (!parse_addr(ct, dptr + matchoff, NULL, &addr,
|
||||
dptr + datalen)) {
|
||||
dptr + datalen)) {
|
||||
ret = NF_DROP;
|
||||
goto out;
|
||||
}
|
||||
if (ct_sip_get_info(ct, dptr, datalen, &matchoff, &matchlen,
|
||||
POS_MEDIA) > 0) {
|
||||
POS_MEDIA) > 0) {
|
||||
|
||||
port = simple_strtoul(dptr + matchoff, NULL, 10);
|
||||
if (port < 1024) {
|
||||
|
|
|
@ -472,7 +472,7 @@ static int __init nf_conntrack_standalone_init(void)
|
|||
static void __exit nf_conntrack_standalone_fini(void)
|
||||
{
|
||||
#ifdef CONFIG_SYSCTL
|
||||
unregister_sysctl_table(nf_ct_sysctl_header);
|
||||
unregister_sysctl_table(nf_ct_sysctl_header);
|
||||
#endif
|
||||
#ifdef CONFIG_PROC_FS
|
||||
remove_proc_entry("nf_conntrack", proc_net_stat);
|
||||
|
|
|
@ -31,7 +31,7 @@ MODULE_PARM_DESC(ports, "Port numbers of TFTP servers");
|
|||
|
||||
#if 0
|
||||
#define DEBUGP(format, args...) printk("%s:%s:" format, \
|
||||
__FILE__, __FUNCTION__ , ## args)
|
||||
__FILE__, __FUNCTION__ , ## args)
|
||||
#else
|
||||
#define DEBUGP(format, args...)
|
||||
#endif
|
||||
|
|
|
@ -227,8 +227,8 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info,
|
|||
|
||||
list_for_each_rcu(i, &nf_hooks[info->pf][info->hook]) {
|
||||
if (i == elem)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == &nf_hooks[info->pf][info->hook]) {
|
||||
/* The module which sent it to userspace is gone. */
|
||||
|
|
|
@ -187,7 +187,7 @@ nfnetlink_check_attributes(struct nfnetlink_subsystem *subsys,
|
|||
/* implicit: if nlmsg_len == min_len, we return 0, and an empty
|
||||
* (zeroed) cda[] array. The message is valid, but empty. */
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nfnetlink_has_listeners(unsigned int group)
|
||||
|
@ -357,7 +357,7 @@ static int __init nfnetlink_init(void)
|
|||
printk("Netfilter messages via NETLINK v%s.\n", nfversion);
|
||||
|
||||
nfnl = netlink_kernel_create(NETLINK_NETFILTER, NFNLGRP_MAX,
|
||||
nfnetlink_rcv, THIS_MODULE);
|
||||
nfnetlink_rcv, THIS_MODULE);
|
||||
if (!nfnl) {
|
||||
printk(KERN_ERR "cannot initialize nfnetlink!\n");
|
||||
return -1;
|
||||
|
|
|
@ -490,7 +490,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
|
|||
struct nfqnl_msg_packet_hw phw;
|
||||
|
||||
int len = entskb->dev->hard_header_parse(entskb,
|
||||
phw.hw_addr);
|
||||
phw.hw_addr);
|
||||
phw.hw_addrlen = htons(len);
|
||||
NFA_PUT(skb, NFQA_HWADDR, sizeof(phw), &phw);
|
||||
}
|
||||
|
@ -580,10 +580,10 @@ nfqnl_enqueue_packet(struct sk_buff *skb, struct nf_info *info,
|
|||
goto err_out_free_nskb;
|
||||
|
||||
if (queue->queue_total >= queue->queue_maxlen) {
|
||||
queue->queue_dropped++;
|
||||
queue->queue_dropped++;
|
||||
status = -ENOSPC;
|
||||
if (net_ratelimit())
|
||||
printk(KERN_WARNING "nf_queue: full at %d entries, "
|
||||
printk(KERN_WARNING "nf_queue: full at %d entries, "
|
||||
"dropping packets(s). Dropped: %d\n",
|
||||
queue->queue_total, queue->queue_dropped);
|
||||
goto err_out_free_nskb;
|
||||
|
@ -592,7 +592,7 @@ nfqnl_enqueue_packet(struct sk_buff *skb, struct nf_info *info,
|
|||
/* nfnetlink_unicast will either free the nskb or add it to a socket */
|
||||
status = nfnetlink_unicast(nskb, queue->peer_pid, MSG_DONTWAIT);
|
||||
if (status < 0) {
|
||||
queue->queue_user_dropped++;
|
||||
queue->queue_user_dropped++;
|
||||
goto err_out_unlock;
|
||||
}
|
||||
|
||||
|
@ -631,9 +631,9 @@ nfqnl_mangle(void *data, int data_len, struct nfqnl_queue_entry *e)
|
|||
struct sk_buff *newskb;
|
||||
|
||||
newskb = skb_copy_expand(e->skb,
|
||||
skb_headroom(e->skb),
|
||||
diff,
|
||||
GFP_ATOMIC);
|
||||
skb_headroom(e->skb),
|
||||
diff,
|
||||
GFP_ATOMIC);
|
||||
if (newskb == NULL) {
|
||||
printk(KERN_WARNING "nf_queue: OOM "
|
||||
"in mangle, dropping packet\n");
|
||||
|
@ -835,7 +835,7 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,
|
|||
|
||||
if (nfqa[NFQA_MARK-1])
|
||||
entry->skb->mark = ntohl(*(__be32 *)
|
||||
NFA_DATA(nfqa[NFQA_MARK-1]));
|
||||
NFA_DATA(nfqa[NFQA_MARK-1]));
|
||||
|
||||
issue_verdict(entry, verdict);
|
||||
instance_put(queue);
|
||||
|
|
|
@ -305,7 +305,7 @@ int xt_find_revision(int af, const char *name, u8 revision, int target,
|
|||
EXPORT_SYMBOL_GPL(xt_find_revision);
|
||||
|
||||
int xt_check_match(const struct xt_match *match, unsigned short family,
|
||||
unsigned int size, const char *table, unsigned int hook_mask,
|
||||
unsigned int size, const char *table, unsigned int hook_mask,
|
||||
unsigned short proto, int inv_proto)
|
||||
{
|
||||
if (XT_ALIGN(match->matchsize) != size) {
|
||||
|
@ -377,7 +377,7 @@ int xt_compat_match_to_user(struct xt_entry_match *m, void __user **dstptr,
|
|||
|
||||
if (copy_to_user(cm, m, sizeof(*cm)) ||
|
||||
put_user(msize, &cm->u.user.match_size))
|
||||
return -EFAULT;
|
||||
return -EFAULT;
|
||||
|
||||
if (match->compat_to_user) {
|
||||
if (match->compat_to_user((void __user *)cm->data, m->data))
|
||||
|
@ -432,7 +432,7 @@ int xt_compat_target_offset(struct xt_target *target)
|
|||
EXPORT_SYMBOL_GPL(xt_compat_target_offset);
|
||||
|
||||
void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr,
|
||||
int *size)
|
||||
int *size)
|
||||
{
|
||||
struct xt_target *target = t->u.kernel.target;
|
||||
struct compat_xt_entry_target *ct = (struct compat_xt_entry_target *)t;
|
||||
|
@ -467,7 +467,7 @@ int xt_compat_target_to_user(struct xt_entry_target *t, void __user **dstptr,
|
|||
|
||||
if (copy_to_user(ct, t, sizeof(*ct)) ||
|
||||
put_user(tsize, &ct->u.user.target_size))
|
||||
return -EFAULT;
|
||||
return -EFAULT;
|
||||
|
||||
if (target->compat_to_user) {
|
||||
if (target->compat_to_user((void __user *)ct->data, t->data))
|
||||
|
|
|
@ -48,7 +48,7 @@ static struct xt_target xt_classify_target[] = {
|
|||
.table = "mangle",
|
||||
.hooks = (1 << NF_IP_LOCAL_OUT) |
|
||||
(1 << NF_IP_FORWARD) |
|
||||
(1 << NF_IP_POST_ROUTING),
|
||||
(1 << NF_IP_POST_ROUTING),
|
||||
.me = THIS_MODULE,
|
||||
},
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ static struct xt_target xt_classify_target[] = {
|
|||
.table = "mangle",
|
||||
.hooks = (1 << NF_IP6_LOCAL_OUT) |
|
||||
(1 << NF_IP6_FORWARD) |
|
||||
(1 << NF_IP6_POST_ROUTING),
|
||||
(1 << NF_IP6_POST_ROUTING),
|
||||
.me = THIS_MODULE,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -51,9 +51,9 @@ match(const struct sk_buff *skb,
|
|||
if (ct == &ip_conntrack_untracked)
|
||||
statebit = XT_CONNTRACK_STATE_UNTRACKED;
|
||||
else if (ct)
|
||||
statebit = XT_CONNTRACK_STATE_BIT(ctinfo);
|
||||
else
|
||||
statebit = XT_CONNTRACK_STATE_INVALID;
|
||||
statebit = XT_CONNTRACK_STATE_BIT(ctinfo);
|
||||
else
|
||||
statebit = XT_CONNTRACK_STATE_INVALID;
|
||||
|
||||
if (sinfo->flags & XT_CONNTRACK_STATE) {
|
||||
if (ct) {
|
||||
|
@ -77,7 +77,7 @@ match(const struct sk_buff *skb,
|
|||
FWINV(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum !=
|
||||
sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum,
|
||||
XT_CONNTRACK_PROTO))
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
if (sinfo->flags & XT_CONNTRACK_ORIGSRC &&
|
||||
FWINV((ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip &
|
||||
|
@ -147,9 +147,9 @@ match(const struct sk_buff *skb,
|
|||
if (ct == &nf_conntrack_untracked)
|
||||
statebit = XT_CONNTRACK_STATE_UNTRACKED;
|
||||
else if (ct)
|
||||
statebit = XT_CONNTRACK_STATE_BIT(ctinfo);
|
||||
else
|
||||
statebit = XT_CONNTRACK_STATE_INVALID;
|
||||
statebit = XT_CONNTRACK_STATE_BIT(ctinfo);
|
||||
else
|
||||
statebit = XT_CONNTRACK_STATE_INVALID;
|
||||
|
||||
if (sinfo->flags & XT_CONNTRACK_STATE) {
|
||||
if (ct) {
|
||||
|
@ -171,41 +171,41 @@ match(const struct sk_buff *skb,
|
|||
|
||||
if (sinfo->flags & XT_CONNTRACK_PROTO &&
|
||||
FWINV(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum !=
|
||||
sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum,
|
||||
sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum,
|
||||
XT_CONNTRACK_PROTO))
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
if (sinfo->flags & XT_CONNTRACK_ORIGSRC &&
|
||||
FWINV((ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip &
|
||||
sinfo->sipmsk[IP_CT_DIR_ORIGINAL].s_addr) !=
|
||||
sinfo->sipmsk[IP_CT_DIR_ORIGINAL].s_addr) !=
|
||||
sinfo->tuple[IP_CT_DIR_ORIGINAL].src.ip,
|
||||
XT_CONNTRACK_ORIGSRC))
|
||||
return 0;
|
||||
|
||||
if (sinfo->flags & XT_CONNTRACK_ORIGDST &&
|
||||
FWINV((ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip &
|
||||
sinfo->dipmsk[IP_CT_DIR_ORIGINAL].s_addr) !=
|
||||
sinfo->dipmsk[IP_CT_DIR_ORIGINAL].s_addr) !=
|
||||
sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.ip,
|
||||
XT_CONNTRACK_ORIGDST))
|
||||
return 0;
|
||||
|
||||
if (sinfo->flags & XT_CONNTRACK_REPLSRC &&
|
||||
FWINV((ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip &
|
||||
sinfo->sipmsk[IP_CT_DIR_REPLY].s_addr) !=
|
||||
sinfo->sipmsk[IP_CT_DIR_REPLY].s_addr) !=
|
||||
sinfo->tuple[IP_CT_DIR_REPLY].src.ip,
|
||||
XT_CONNTRACK_REPLSRC))
|
||||
return 0;
|
||||
|
||||
if (sinfo->flags & XT_CONNTRACK_REPLDST &&
|
||||
FWINV((ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip &
|
||||
sinfo->dipmsk[IP_CT_DIR_REPLY].s_addr) !=
|
||||
sinfo->dipmsk[IP_CT_DIR_REPLY].s_addr) !=
|
||||
sinfo->tuple[IP_CT_DIR_REPLY].dst.ip,
|
||||
XT_CONNTRACK_REPLDST))
|
||||
return 0;
|
||||
|
||||
if (sinfo->flags & XT_CONNTRACK_STATUS &&
|
||||
FWINV((ct->status & sinfo->statusmask) == 0,
|
||||
XT_CONNTRACK_STATUS))
|
||||
XT_CONNTRACK_STATUS))
|
||||
return 0;
|
||||
|
||||
if(sinfo->flags & XT_CONNTRACK_EXPIRES) {
|
||||
|
|
|
@ -26,7 +26,7 @@ MODULE_DESCRIPTION("Match for DCCP protocol packets");
|
|||
MODULE_ALIAS("ipt_dccp");
|
||||
|
||||
#define DCCHECK(cond, option, flag, invflag) (!((flag) & (option)) \
|
||||
|| (!!((invflag) & (option)) ^ (cond)))
|
||||
|| (!!((invflag) & (option)) ^ (cond)))
|
||||
|
||||
static unsigned char *dccp_optbuf;
|
||||
static DEFINE_SPINLOCK(dccp_buflock);
|
||||
|
@ -111,11 +111,11 @@ match(const struct sk_buff *skb,
|
|||
if (dh == NULL) {
|
||||
*hotdrop = 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return DCCHECK(((ntohs(dh->dccph_sport) >= info->spts[0])
|
||||
&& (ntohs(dh->dccph_sport) <= info->spts[1])),
|
||||
XT_DCCP_SRC_PORTS, info->flags, info->invflags)
|
||||
XT_DCCP_SRC_PORTS, info->flags, info->invflags)
|
||||
&& DCCHECK(((ntohs(dh->dccph_dport) >= info->dpts[0])
|
||||
&& (ntohs(dh->dccph_dport) <= info->dpts[1])),
|
||||
XT_DCCP_DEST_PORTS, info->flags, info->invflags)
|
||||
|
|
|
@ -208,7 +208,7 @@ static int htable_create(struct xt_hashlimit_info *minfo, int family)
|
|||
spin_lock_init(&hinfo->lock);
|
||||
hinfo->pde = create_proc_entry(minfo->name, 0,
|
||||
family == AF_INET ? hashlimit_procdir4 :
|
||||
hashlimit_procdir6);
|
||||
hashlimit_procdir6);
|
||||
if (!hinfo->pde) {
|
||||
vfree(hinfo);
|
||||
return -1;
|
||||
|
@ -240,7 +240,7 @@ static int select_gc(struct xt_hashlimit_htable *ht, struct dsthash_ent *he)
|
|||
}
|
||||
|
||||
static void htable_selective_cleanup(struct xt_hashlimit_htable *ht,
|
||||
int (*select)(struct xt_hashlimit_htable *ht,
|
||||
int (*select)(struct xt_hashlimit_htable *ht,
|
||||
struct dsthash_ent *he))
|
||||
{
|
||||
unsigned int i;
|
||||
|
@ -279,7 +279,7 @@ static void htable_destroy(struct xt_hashlimit_htable *hinfo)
|
|||
/* remove proc entry */
|
||||
remove_proc_entry(hinfo->pde->name,
|
||||
hinfo->family == AF_INET ? hashlimit_procdir4 :
|
||||
hashlimit_procdir6);
|
||||
hashlimit_procdir6);
|
||||
htable_selective_cleanup(hinfo, select_all);
|
||||
vfree(hinfo);
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ hashlimit_match(const struct sk_buff *skb,
|
|||
return 1;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&hinfo->lock);
|
||||
spin_unlock_bh(&hinfo->lock);
|
||||
|
||||
/* default case: we're overlimit, thus don't match */
|
||||
return 0;
|
||||
|
|
|
@ -79,7 +79,7 @@ match(const struct sk_buff *skb,
|
|||
ret ^= 1;
|
||||
else
|
||||
ret ^= !strncmp(ct->master->helper->name, info->name,
|
||||
strlen(ct->master->helper->name));
|
||||
strlen(ct->master->helper->name));
|
||||
out_unlock:
|
||||
read_unlock_bh(&ip_conntrack_lock);
|
||||
return ret;
|
||||
|
@ -129,7 +129,7 @@ match(const struct sk_buff *skb,
|
|||
ret ^= 1;
|
||||
else
|
||||
ret ^= !strncmp(master_help->helper->name, info->name,
|
||||
strlen(master_help->helper->name));
|
||||
strlen(master_help->helper->name));
|
||||
out_unlock:
|
||||
read_unlock_bh(&nf_conntrack_lock);
|
||||
return ret;
|
||||
|
|
|
@ -89,7 +89,7 @@ ipt_limit_match(const struct sk_buff *skb,
|
|||
return 1;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&limit_lock);
|
||||
spin_unlock_bh(&limit_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,10 +36,10 @@ match(const struct sk_buff *skb,
|
|||
|
||||
static int
|
||||
checkentry(const char *tablename,
|
||||
const void *entry,
|
||||
const void *entry,
|
||||
const struct xt_match *match,
|
||||
void *matchinfo,
|
||||
unsigned int hook_mask)
|
||||
void *matchinfo,
|
||||
unsigned int hook_mask)
|
||||
{
|
||||
const struct xt_mark_info *minfo = matchinfo;
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,
|
|||
}
|
||||
}
|
||||
|
||||
return minfo->invert;
|
||||
return minfo->invert;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -117,7 +117,7 @@ checkentry(const char *tablename,
|
|||
(!(info->bitmask & XT_PHYSDEV_OP_BRIDGED) ||
|
||||
info->invert & XT_PHYSDEV_OP_BRIDGED) &&
|
||||
hook_mask & ((1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD) |
|
||||
(1 << NF_IP_POST_ROUTING))) {
|
||||
(1 << NF_IP_POST_ROUTING))) {
|
||||
printk(KERN_WARNING "physdev match: using --physdev-out in the "
|
||||
"OUTPUT, FORWARD and POSTROUTING chains for non-bridged "
|
||||
"traffic is not supported anymore.\n");
|
||||
|
|
|
@ -109,13 +109,13 @@ match_policy_out(const struct sk_buff *skb, const struct xt_policy_info *info,
|
|||
}
|
||||
|
||||
static int match(const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
const struct xt_match *match,
|
||||
const void *matchinfo,
|
||||
int offset,
|
||||
unsigned int protoff,
|
||||
int *hotdrop)
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
const struct xt_match *match,
|
||||
const void *matchinfo,
|
||||
int offset,
|
||||
unsigned int protoff,
|
||||
int *hotdrop)
|
||||
{
|
||||
const struct xt_policy_info *info = matchinfo;
|
||||
int ret;
|
||||
|
@ -134,27 +134,27 @@ static int match(const struct sk_buff *skb,
|
|||
}
|
||||
|
||||
static int checkentry(const char *tablename, const void *ip_void,
|
||||
const struct xt_match *match,
|
||||
void *matchinfo, unsigned int hook_mask)
|
||||
const struct xt_match *match,
|
||||
void *matchinfo, unsigned int hook_mask)
|
||||
{
|
||||
struct xt_policy_info *info = matchinfo;
|
||||
|
||||
if (!(info->flags & (XT_POLICY_MATCH_IN|XT_POLICY_MATCH_OUT))) {
|
||||
printk(KERN_ERR "xt_policy: neither incoming nor "
|
||||
"outgoing policy selected\n");
|
||||
"outgoing policy selected\n");
|
||||
return 0;
|
||||
}
|
||||
/* hook values are equal for IPv4 and IPv6 */
|
||||
if (hook_mask & (1 << NF_IP_PRE_ROUTING | 1 << NF_IP_LOCAL_IN)
|
||||
&& info->flags & XT_POLICY_MATCH_OUT) {
|
||||
printk(KERN_ERR "xt_policy: output policy not valid in "
|
||||
"PRE_ROUTING and INPUT\n");
|
||||
"PRE_ROUTING and INPUT\n");
|
||||
return 0;
|
||||
}
|
||||
if (hook_mask & (1 << NF_IP_POST_ROUTING | 1 << NF_IP_LOCAL_OUT)
|
||||
&& info->flags & XT_POLICY_MATCH_IN) {
|
||||
printk(KERN_ERR "xt_policy: input policy not valid in "
|
||||
"POST_ROUTING and OUTPUT\n");
|
||||
"POST_ROUTING and OUTPUT\n");
|
||||
return 0;
|
||||
}
|
||||
if (info->len > XT_POLICY_MAX_ELEM) {
|
||||
|
|
|
@ -30,8 +30,8 @@ match(const struct sk_buff *skb,
|
|||
q->quota -= skb->len;
|
||||
ret ^= 1;
|
||||
} else {
|
||||
/* we do not allow even small packets from now on */
|
||||
q->quota = 0;
|
||||
/* we do not allow even small packets from now on */
|
||||
q->quota = 0;
|
||||
}
|
||||
spin_unlock_bh("a_lock);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ match_packet(const struct sk_buff *skb,
|
|||
duprintf("Dropping invalid SCTP packet.\n");
|
||||
*hotdrop = 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
duprintf("Chunk num: %d\toffset: %d\ttype: %d\tlength: %d\tflags: %x\n",
|
||||
++i, offset, sch->type, htons(sch->length), sch->flags);
|
||||
|
@ -142,18 +142,18 @@ match(const struct sk_buff *skb,
|
|||
duprintf("Dropping evil TCP offset=0 tinygram.\n");
|
||||
*hotdrop = 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
duprintf("spt: %d\tdpt: %d\n", ntohs(sh->source), ntohs(sh->dest));
|
||||
|
||||
return SCCHECK(((ntohs(sh->source) >= info->spts[0])
|
||||
&& (ntohs(sh->source) <= info->spts[1])),
|
||||
XT_SCTP_SRC_PORTS, info->flags, info->invflags)
|
||||
XT_SCTP_SRC_PORTS, info->flags, info->invflags)
|
||||
&& SCCHECK(((ntohs(sh->dest) >= info->dpts[0])
|
||||
&& (ntohs(sh->dest) <= info->dpts[1])),
|
||||
XT_SCTP_DEST_PORTS, info->flags, info->invflags)
|
||||
&& SCCHECK(match_packet(skb, protoff + sizeof (sctp_sctphdr_t),
|
||||
info->chunkmap, info->chunk_match_type,
|
||||
info->flag_info, info->flag_count,
|
||||
info->flag_info, info->flag_count,
|
||||
hotdrop),
|
||||
XT_SCTP_CHUNK_TYPES, info->flags, info->invflags);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ static int checkentry(const char *tablename,
|
|||
if (conf->from_offset > conf->to_offset)
|
||||
return 0;
|
||||
if (conf->algo[XT_STRING_MAX_ALGO_NAME_SIZE - 1] != '\0')
|
||||
return 0;
|
||||
return 0;
|
||||
if (conf->patlen > XT_STRING_MAX_PATTERN_SIZE)
|
||||
return 0;
|
||||
ts_conf = textsearch_prepare(conf->algo, conf->pattern, conf->patlen,
|
||||
|
|
|
@ -66,7 +66,7 @@ match(const struct sk_buff *skb,
|
|||
mssval = (op[i+2] << 8) | op[i+3];
|
||||
|
||||
return (mssval >= info->mss_min &&
|
||||
mssval <= info->mss_max) ^ info->invert;
|
||||
mssval <= info->mss_max) ^ info->invert;
|
||||
}
|
||||
if (op[i] < 2)
|
||||
i++;
|
||||
|
|
Loading…
Add table
Reference in a new issue