Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG-RAN
Commits
cb8dedc4
Commit
cb8dedc4
authored
May 09, 2023
by
Rúben Soares da Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary if related to TLV padding
parent
25075344
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
nfapi/open-nFAPI/nfapi/src/nfapi.c
nfapi/open-nFAPI/nfapi/src/nfapi.c
+4
-10
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
+2
-6
No files found.
nfapi/open-nFAPI/nfapi/src/nfapi.c
View file @
cb8dedc4
...
...
@@ -652,9 +652,7 @@ int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPa
}
// Remove padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1)
int
padding
=
get_tlv_padding
(
tl
->
length
);
if
(
padding
!=
0
)
{
(
*
ppReadPackedMsg
)
+=
padding
;
}
(
*
ppReadPackedMsg
)
+=
padding
;
}
}
...
...
@@ -739,9 +737,7 @@ int unpack_p7_tlv_list(unpack_p7_tlv_t unpack_fns[], uint16_t size, uint8_t **pp
}
// Remove padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1)
int
padding
=
get_tlv_padding
(
tl
->
length
);
if
(
padding
!=
0
)
{
(
*
ppReadPackedMsg
)
+=
padding
;
}
(
*
ppReadPackedMsg
)
+=
padding
;
}
}
...
...
@@ -822,10 +818,8 @@ uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *e
// Add padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1)
int
padding
=
get_tlv_padding
(
tl
->
length
);
NFAPI_TRACE
(
NFAPI_TRACE_DEBUG
,
"TLV 0x%x with padding of %d bytes
\n
"
,
tl
->
tag
,
padding
);
if
(
padding
!=
0
)
{
memset
(
*
ppWritePackedMsg
,
0
,
padding
);
(
*
ppWritePackedMsg
)
+=
padding
;
}
memset
(
*
ppWritePackedMsg
,
0
,
padding
);
(
*
ppWritePackedMsg
)
+=
padding
;
}
else
{
if
(
tl
->
tag
!=
0
)
{
NFAPI_TRACE
(
NFAPI_TRACE_WARN
,
"Warning pack_tlv tag 0x%x does not match expected 0x%x
\n
"
,
tl
->
tag
,
tag
);
...
...
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
View file @
cb8dedc4
...
...
@@ -2089,9 +2089,7 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end,
// Advance past the unknown TLV
(
*
ppReadPackedMsg
)
+=
generic_tl
.
length
;
int
padding
=
get_tlv_padding
(
generic_tl
.
length
);
if
(
padding
!=
0
)
{
(
*
ppReadPackedMsg
)
+=
padding
;
}
(
*
ppReadPackedMsg
)
+=
padding
;
}
else
{
// go to the end
return
0
;
...
...
@@ -2108,9 +2106,7 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end,
// Advance past the unknown TLV
(
*
ppReadPackedMsg
)
+=
generic_tl
.
length
;
int
padding
=
get_tlv_padding
(
generic_tl
.
length
);
if
(
padding
!=
0
)
{
(
*
ppReadPackedMsg
)
+=
padding
;
}
(
*
ppReadPackedMsg
)
+=
padding
;
}
else
{
// go to the end
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