Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLASfpga
VILLASfpga
Commits
231dccb0
Commit
231dccb0
authored
Jun 04, 2018
by
Daniel Krebs
Browse files
ip-node: fix wrong cast and add more sanity checks
parent
f11a7a3f
Pipeline
#52940
passed with stages
in 1 minute and 29 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
lib/ip_node.cpp
View file @
231dccb0
...
@@ -96,6 +96,11 @@ IpNode::getLoopbackPorts() const
...
@@ -96,6 +96,11 @@ IpNode::getLoopbackPorts() const
bool
IpNode
::
connect
(
const
StreamVertex
&
from
,
const
StreamVertex
&
to
)
bool
IpNode
::
connect
(
const
StreamVertex
&
from
,
const
StreamVertex
&
to
)
{
{
if
(
from
.
nodeName
!=
getInstanceName
())
{
logger
->
error
(
"Cannot connect from a foreign StreamVertex: {}"
,
from
);
return
false
;
}
StreamGraph
::
Path
path
;
StreamGraph
::
Path
path
;
if
(
not
streamGraph
.
getPath
(
from
.
getIdentifier
(),
to
.
getIdentifier
(),
path
))
{
if
(
not
streamGraph
.
getPath
(
from
.
getIdentifier
(),
to
.
getIdentifier
(),
path
))
{
logger
->
error
(
"No path from {} to {}"
,
from
,
to
);
logger
->
error
(
"No path from {} to {}"
,
from
,
to
);
...
@@ -132,7 +137,7 @@ bool IpNode::connect(const StreamVertex& from, const StreamVertex& to)
...
@@ -132,7 +137,7 @@ bool IpNode::connect(const StreamVertex& from, const StreamVertex& to)
nextHopNode
=
secondHopNode
;
nextHopNode
=
secondHopNode
;
}
}
auto
nextHopNodeIp
=
reinterpret
_cast
<
IpNode
*>
auto
nextHopNodeIp
=
dynamic
_cast
<
IpNode
*>
(
card
->
lookupIp
(
nextHopNode
->
nodeName
));
(
card
->
lookupIp
(
nextHopNode
->
nodeName
));
if
(
nextHopNodeIp
==
nullptr
)
{
if
(
nextHopNodeIp
==
nullptr
)
{
...
...
Write
Preview
Supports
Markdown
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