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
Kirill Smelkov
linux
Commits
1d1c397d
Commit
1d1c397d
authored
Mar 16, 2010
by
Jan Engelhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netfilter: xtables: clean up xt_mac match routine
Signed-off-by:
Jan Engelhardt
<
jengelh@medozas.de
>
parent
7d5f7ed8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
net/netfilter/xt_mac.c
net/netfilter/xt_mac.c
+10
-8
No files found.
net/netfilter/xt_mac.c
View file @
1d1c397d
...
...
@@ -26,14 +26,16 @@ MODULE_ALIAS("ip6t_mac");
static
bool
mac_mt
(
const
struct
sk_buff
*
skb
,
const
struct
xt_match_param
*
par
)
{
const
struct
xt_mac_info
*
info
=
par
->
matchinfo
;
/* Is mac pointer valid? */
return
skb_mac_header
(
skb
)
>=
skb
->
head
&&
skb_mac_header
(
skb
)
+
ETH_HLEN
<=
skb
->
data
/* If so, compare... */
&&
((
!
compare_ether_addr
(
eth_hdr
(
skb
)
->
h_source
,
info
->
srcaddr
))
^
info
->
invert
);
const
struct
xt_mac_info
*
info
=
par
->
matchinfo
;
bool
ret
;
if
(
skb_mac_header
(
skb
)
<
skb
->
head
)
return
false
;
if
(
skb_mac_header
(
skb
)
+
ETH_HLEN
>
skb
->
data
)
return
false
;
ret
=
compare_ether_addr
(
eth_hdr
(
skb
)
->
h_source
,
info
->
srcaddr
)
==
0
;
ret
^=
info
->
invert
;
return
ret
;
}
static
struct
xt_match
mac_mt_reg
__read_mostly
=
{
...
...
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