Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
e45473a3
Commit
e45473a3
authored
Oct 09, 2020
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rvlan: when sniffing, compare with all local addresses
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
955cf469
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
radiusvlan.c
userspace/tools/radiusvlan.c
+13
-3
No files found.
userspace/tools/radiusvlan.c
View file @
e45473a3
...
...
@@ -87,6 +87,17 @@ struct rvlan_binmac {
};
struct
rvlan_binmac
*
macs
;
/* Use the above */
int
rvlan_mac_is_local
(
uint8_t
*
address
)
{
struct
rvlan_binmac
*
mac
;
for
(
mac
=
macs
;
mac
;
mac
=
mac
->
next
)
if
(
!
memcmp
(
address
,
mac
->
mac
,
ETH_ALEN
))
return
1
;
return
0
;
}
/* Authentication of a port is a state machine */
int
rvlan_fsm
(
struct
rvlan_dev
*
dev
,
fd_set
*
rdset
)
{
...
...
@@ -181,9 +192,8 @@ int rvlan_fsm(struct rvlan_dev *dev, fd_set *rdset)
dev
->
mac
[
0
],
dev
->
mac
[
1
],
dev
->
mac
[
2
],
dev
->
mac
[
3
],
dev
->
mac
[
4
],
dev
->
mac
[
5
]);
}
/* FIXME: check with all local addresses or packet type */
if
(
!
memcmp
(
frame
+
ETH_ALEN
,
dev
->
mac
,
5
))
break
;
/* own sending, ignore */
if
(
rvlan_mac_is_local
(
frame
+
ETH_ALEN
))
break
;
/* success, it seems */
sprintf
(
dev
->
peer_mac
,
"%02x%02x%02x%02x%02x%02x"
,
...
...
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