Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
ef53d702
Commit
ef53d702
authored
Jul 09, 2009
by
Jan Engelhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netfilter: xtables: dissolve do_match function
Signed-off-by:
Jan Engelhardt
<
jengelh@medozas.de
>
parent
c29c9492
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
34 deletions
+10
-34
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ip_tables.c
+5
-17
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/ip6_tables.c
+5
-17
No files found.
net/ipv4/netfilter/ip_tables.c
View file @
ef53d702
...
...
@@ -173,21 +173,6 @@ ipt_error(struct sk_buff *skb, const struct xt_target_param *par)
return
NF_DROP
;
}
/* Performance critical - called for every packet */
static
inline
bool
do_match
(
const
struct
ipt_entry_match
*
m
,
const
struct
sk_buff
*
skb
,
struct
xt_match_param
*
par
)
{
par
->
match
=
m
->
u
.
kernel
.
match
;
par
->
matchinfo
=
m
->
data
;
/* Stop iteration if it doesn't match */
if
(
!
m
->
u
.
kernel
.
match
->
match
(
skb
,
par
))
return
true
;
else
return
false
;
}
/* Performance critical */
static
inline
struct
ipt_entry
*
get_entry
(
const
void
*
base
,
unsigned
int
offset
)
...
...
@@ -379,9 +364,12 @@ ipt_do_table(struct sk_buff *skb,
continue
;
}
xt_ematch_foreach
(
ematch
,
e
)
if
(
do_match
(
ematch
,
skb
,
&
mtpar
)
!=
0
)
xt_ematch_foreach
(
ematch
,
e
)
{
mtpar
.
match
=
ematch
->
u
.
kernel
.
match
;
mtpar
.
matchinfo
=
ematch
->
data
;
if
(
!
mtpar
.
match
->
match
(
skb
,
&
mtpar
))
goto
no_match
;
}
ADD_COUNTER
(
e
->
counters
,
ntohs
(
ip
->
tot_len
),
1
);
...
...
net/ipv6/netfilter/ip6_tables.c
View file @
ef53d702
...
...
@@ -205,21 +205,6 @@ ip6t_error(struct sk_buff *skb, const struct xt_target_param *par)
return
NF_DROP
;
}
/* Performance critical - called for every packet */
static
inline
bool
do_match
(
const
struct
ip6t_entry_match
*
m
,
const
struct
sk_buff
*
skb
,
struct
xt_match_param
*
par
)
{
par
->
match
=
m
->
u
.
kernel
.
match
;
par
->
matchinfo
=
m
->
data
;
/* Stop iteration if it doesn't match */
if
(
!
m
->
u
.
kernel
.
match
->
match
(
skb
,
par
))
return
true
;
else
return
false
;
}
static
inline
struct
ip6t_entry
*
get_entry
(
const
void
*
base
,
unsigned
int
offset
)
{
...
...
@@ -402,9 +387,12 @@ ip6t_do_table(struct sk_buff *skb,
continue
;
}
xt_ematch_foreach
(
ematch
,
e
)
if
(
do_match
(
ematch
,
skb
,
&
mtpar
)
!=
0
)
xt_ematch_foreach
(
ematch
,
e
)
{
mtpar
.
match
=
ematch
->
u
.
kernel
.
match
;
mtpar
.
matchinfo
=
ematch
->
data
;
if
(
!
mtpar
.
match
->
match
(
skb
,
&
mtpar
))
goto
no_match
;
}
ADD_COUNTER
(
e
->
counters
,
ntohs
(
ipv6_hdr
(
skb
)
->
payload_len
)
+
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment