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
99
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
f333b913
Commit
f333b913
authored
11 months ago
by
Adam Wujek
Browse files
Options
Downloads
Patches
Plain Diff
snmp: make sure that rtud's shmem is oppened before accessing it
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
8f2d1ed6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
userspace/snmpd/snmp_shmem.c
+15
-3
15 additions, 3 deletions
userspace/snmpd/snmp_shmem.c
with
15 additions
and
3 deletions
userspace/snmpd/snmp_shmem.c
+
15
−
3
View file @
f333b913
#include
"wrsSnmp.h"
#include
"snmp_shmem.h"
/* HAL */
struct
wrs_shm_head
*
hal_head
;
struct
hal_shmem_header
*
hal_shmem
;
...
...
@@ -19,9 +20,10 @@ int *ppsi_ppi_nlinks=NULL;
/* RTUd */
struct
wrs_shm_head
*
rtud_head
;
int
shmem_open_hald
;
int
shmem_open_ppsi
;
int
shmem_open_rtud
;
int
shmem_open_hald
=
0
;
int
shmem_open_ppsi
=
0
;
int
shmem_open_rtud
=
0
;
static
int
init_shm_hald
(
void
)
{
...
...
@@ -263,6 +265,9 @@ int shmem_rtu_read_vlans(struct rtu_vlan_table_entry *vlan_tab_local)
struct
rtu_vlan_table_entry
*
vlan_tab_shm
;
struct
rtu_shmem_header
*
rtu_hdr
;
if
(
!
shmem_ready_rtud
())
return
-
2
;
rtu_hdr
=
(
void
*
)
rtud_head
+
rtud_head
->
data_off
;
vlan_tab_shm
=
wrs_shm_follow
(
rtud_head
,
rtu_hdr
->
vlans
);
if
(
!
vlan_tab_shm
)
...
...
@@ -292,6 +297,9 @@ int shmem_rtu_read_htab(struct rtu_filtering_entry *rtu_htab_local, int *read_en
struct
rtu_shmem_header
*
rtu_hdr
;
struct
rtu_filtering_entry
*
empty
;
if
(
!
shmem_ready_rtud
())
return
-
2
;
rtu_hdr
=
(
void
*
)
rtud_head
+
rtud_head
->
data_off
;
htab_shm
=
wrs_shm_follow
(
rtud_head
,
rtu_hdr
->
filters
);
if
(
!
htab_shm
)
...
...
@@ -332,6 +340,9 @@ int shmem_rtu_read_ports(struct rtu_port_entry *ports_tab_local, int *nports)
struct
rtu_port_entry
*
rtu_ports_shm
;
struct
rtu_shmem_header
*
rtu_hdr
;
if
(
!
shmem_ready_rtud
())
return
-
2
;
rtu_hdr
=
(
void
*
)
rtud_head
+
rtud_head
->
data_off
;
rtu_ports_shm
=
wrs_shm_follow
(
rtud_head
,
rtu_hdr
->
rtu_ports
);
if
(
!
rtu_ports_shm
)
...
...
@@ -356,6 +367,7 @@ int shmem_rtu_read_ports(struct rtu_port_entry *ports_tab_local, int *nports)
return
0
;
}
/* Compare entries by by MAC */
int
cmp_rtu_entries_mac
(
const
void
*
p1
,
const
void
*
p2
)
{
...
...
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