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
c87ffcd3
Commit
c87ffcd3
authored
Nov 19, 2019
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snmp: don't generate errors for SFPs on ports that do not have SFPs
parent
40b0c7b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
wrsPortStatusTable.c
userspace/snmpd/wrsPortStatusTable.c
+11
-6
No files found.
userspace/snmpd/wrsPortStatusTable.c
View file @
c87ffcd3
...
...
@@ -111,17 +111,17 @@ time_t wrsPortStatusTable_data_fill(unsigned int *n_rows)
/* FIXME: get real peer_id */
memset
(
&
wrsPortStatusTable_array
[
i
].
wrsPortStatusPeer
,
0xff
,
sizeof
(
ClockIdentity
));
if
(
port_state
->
calib
.
sfp
.
flags
&
SFP_FLAG_IN_DB
)
{
if
(
port_state
->
sfpPresent
&&
port_state
->
calib
.
sfp
.
flags
&
SFP_FLAG_IN_DB
)
{
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpInDB
=
WRS_PORT_STATUS_SFP_IN_DB_IN_DATA_BASE
;
}
else
{
}
else
if
(
port_state
->
sfpPresent
)
{
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpInDB
=
WRS_PORT_STATUS_SFP_IN_DB_NOT_IN_DATA_BASE
;
}
if
(
port_state
->
calib
.
sfp
.
flags
&
SFP_FLAG_1GbE
)
{
if
(
port_state
->
sfpPresent
&&
port_state
->
calib
.
sfp
.
flags
&
SFP_FLAG_1GbE
)
{
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpGbE
=
WRS_PORT_STATUS_SFP_GBE_LINK_GBE
;
}
else
{
}
else
if
(
port_state
->
sfpPresent
)
{
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpGbE
=
WRS_PORT_STATUS_SFP_GBE_LINK_NOT_GBE
;
}
...
...
@@ -179,9 +179,14 @@ time_t wrsPortStatusTable_data_fill(unsigned int *n_rows)
* like:
* - wrsPortStatusSfpInDB
*/
if
(
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpGbE
==
0
)
{
/* if this is not filled, it means SFP is not plugged,
* so there is no error on that port */
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpError
=
WRS_PORT_STATUS_SFP_ERROR_SFP_OK
;
continue
;
}
/* Don't check if WRS_PORT_STATUS_SFP_ERROR_PORT_DOWN */
if
(
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpGbE
==
0
||
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpError
==
WRS_PORT_STATUS_SFP_ERROR_PORT_DOWN
)
{
if
(
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpError
==
WRS_PORT_STATUS_SFP_ERROR_PORT_DOWN
)
{
continue
;
}
...
...
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