Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
Software for White Rabbit PTP Core
Commits
ebf0aa97
Commit
ebf0aa97
authored
Aug 03, 2016
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'adam-check_ip' into proposed_master
parents
69f53c93
31552ac8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
ipv4.c
lib/ipv4.c
+8
-0
ipv4.h
lib/ipv4.h
+1
-0
snmp.c
lib/snmp.c
+8
-0
No files found.
lib/ipv4.c
View file @
ebf0aa97
...
...
@@ -205,3 +205,11 @@ void setIP(unsigned char *IP)
ip_status
=
IP_TRAINING
;
bootp_retry
=
0
;
}
/* Check the destination IP of the incoming packet */
int
check_dest_ip
(
unsigned
char
*
buf
)
{
if
(
!
buf
)
return
-
1
;
return
memcmp
(
buf
+
IP_DEST
,
myIP
,
4
);
}
lib/ipv4.h
View file @
ebf0aa97
...
...
@@ -61,6 +61,7 @@ struct wr_udp_addr {
};
void
fill_udp
(
uint8_t
*
buf
,
int
len
,
struct
wr_udp_addr
*
uaddr
);
int
check_dest_ip
(
unsigned
char
*
buf
);
void
syslog_init
(
void
);
int
syslog_poll
(
void
);
...
...
lib/snmp.c
View file @
ebf0aa97
...
...
@@ -1403,6 +1403,14 @@ static int snmp_poll(void)
if
(
len
<=
UDP_END
+
sizeof
(
match_array
))
return
0
;
/* Check the destination IP of SNMP packets. IP version, protocol and
* port are checked in the function update_rx_queues, so no need to
* check it again */
if
(
check_dest_ip
(
buf
))
{
snmp_verbose
(
"wrong destination IP
\n
"
);
return
0
;
}
len
=
snmp_respond
(
buf
+
UDP_END
);
if
(
len
<
0
)
return
0
;
...
...
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