Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
92
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
cc32dec6
Commit
cc32dec6
authored
1 month ago
by
Adam Wujek
Browse files
Options
Downloads
Patches
Plain Diff
[BUG:
#368
] userspace/snmpd/wrsSpllVersionGroup: fix unsupported version of spll_stats
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
e43be539
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
userspace/snmpd/wrsSpllStatusGroup.c
+2
-2
2 additions, 2 deletions
userspace/snmpd/wrsSpllStatusGroup.c
userspace/snmpd/wrsSpllVersionGroup.c
+4
-7
4 additions, 7 deletions
userspace/snmpd/wrsSpllVersionGroup.c
with
6 additions
and
9 deletions
userspace/snmpd/wrsSpllStatusGroup.c
+
2
−
2
View file @
cc32dec6
...
...
@@ -64,8 +64,8 @@ time_t wrsSpllStatus_data_fill(void)
{
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
"wrsSpllStatusGroup unsupported version of spll_stats "
"registers (reading ver %d, supported
1, 2 and 3
)
\n
"
,
spll_stats_p
->
ver
);
"registers (reading ver %d, supported
%d
)
\n
"
,
spll_stats_p
->
ver
,
SPLL_STATS_VER
);
}
/* there was an update, return current time */
return
time_update
;
...
...
This diff is collapsed.
Click to expand it.
userspace/snmpd/wrsSpllVersionGroup.c
+
4
−
7
View file @
cc32dec6
...
...
@@ -44,7 +44,7 @@ time_t wrsSpllVersion_data_fill(void)
}
/* check version of SPLL's stat structure, version fields are from
* version 2 */
if
(
spll_stats_p
->
ver
<
=
4
)
{
if
(
spll_stats_p
->
ver
=
=
SPLL_STATS_VER
)
{
int
len
;
strncpy
(
wrsSpllVersion_s
.
wrsSpllVersion
,
spll_stats_p
->
build_id
.
commit_id
,
32
);
/* concatenate date and time */
...
...
@@ -53,17 +53,14 @@ time_t wrsSpllVersion_data_fill(void)
wrsSpllVersion_s
.
wrsSpllBuildDate
[
len
]
=
' '
;
/* put space instead of null */
/* add time after added space at the end of string */
strncpy
(
&
wrsSpllVersion_s
.
wrsSpllBuildDate
[
len
+
1
],
spll_stats_p
->
build_id
.
build_time
,
16
-
1
);
strncpy
(
wrsSpllVersion_s
.
wrsSpllBuildBy
,
spll_stats_p
->
build_id
.
build_by
,
32
);
}
else
{
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
"wrsSpllVersionGroup unsupported version of spll_stats "
"registers (reading ver %d, supported 2 and 3)
\n
"
,
spll_stats_p
->
ver
);
}
/* buil_by was introduced in version 3 */
if
(
spll_stats_p
->
ver
>=
3
)
{
strncpy
(
wrsSpllVersion_s
.
wrsSpllBuildBy
,
spll_stats_p
->
build_id
.
build_by
,
32
);
"registers (reading ver %d, supported %d)
\n
"
,
spll_stats_p
->
ver
,
SPLL_STATS_VER
);
}
/* there was an update, return current time */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment