Skip to content

Commit 8c5dfd6

Browse files
committed
router: align port parameters with interface upon port creation
1 parent 46b2848 commit 8c5dfd6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/services/pcn-router/src/Ports.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ Ports::Ports(polycube::service::Cube<Ports> &parent,
142142
};
143143

144144
if (!parent_.get_shadow()) {
145+
// Align parameters of the port with the ones of the interface if connected
146+
if (conf.macIsSet()) {
147+
set_peer_parameter("MAC", conf.getMac());
148+
}
149+
if (conf.ipIsSet()) {
150+
set_peer_parameter("IP", conf.getIp());
151+
}
152+
145153
/* Register the new port to IP and MAC notifications arriving from ExtIface
146154
* do not use define because strings are easier to manipulate
147155
* for future extensions */

0 commit comments

Comments
 (0)