Skip to content

Commit 94f17d3

Browse files
committed
solved bug deleting port of a router with no Ip address
1 parent 735f4ee commit 94f17d3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ void Router::delPorts(const std::string &name) {
149149
// routing table)
150150
port->delSecondaryipList();
151151

152-
remove_local_route(port->getIp(), name);
152+
//if getIP is empty it means that you have a port with no IP address
153+
//so you do not need to call remove_local_route
154+
if(port->getIp().empty() == false)
155+
remove_local_route(port->getIp(), name);
153156

154157
auto router_port = get_hash_table<uint16_t, r_port>("router_port");
155158

0 commit comments

Comments
 (0)