Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B #2607: No way to use Floating IP with BRIDGE interfaces #2664

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/VirtualMachineTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ class VirtualMachineTemplate : public Template
Template::parse_restricted(ra, restricted);
}

const static std::set<std::string>& get_element(string name)
{
return restricted.at(name);
}

private:
/**
* Restricted attribute list for VirtualMachineTemplates
Expand Down
10 changes: 9 additions & 1 deletion src/vrouter/VirtualRouter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "Nebula.h"
#include "VirtualMachine.h"
#include "Request.h"
#include "VirtualMachineTemplate.h"
/* -------------------------------------------------------------------------- */

static void vrouter_prefix(VectorAttribute* nic, const string& attr)
Expand Down Expand Up @@ -46,8 +47,15 @@ static void prepare_nic_vm(VectorAttribute * nic)
vrouter_prefix(nic, "IP6_LINK");
vrouter_prefix(nic, "IP6_ULA");
vrouter_prefix(nic, "IP6_GLOBAL");
vrouter_prefix(nic, "VLAN_ID");

// TODO: remove all other attrs, such as AR, BRIDGE, etc?
std::set<std::string> restricted = VirtualMachineTemplate::get_element("NIC");
std::set<std::string>::iterator it;

for (it = restricted.begin(); it != restricted.end(); ++it)
{
nic->remove(*it);
}
}
}

Expand Down