diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-12-28 18:38:47 +0100 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-12-28 10:03:38 -0800 |
commit | e46b70205e25412d31edec28742210d77a8543a8 (patch) | |
tree | f937ab082de3917c7f4bfe123d7891c1be6d2be9 /ovn/utilities | |
parent | 10b9890f33bf9dd483ccfc612e0e5b677268a5ca (diff) | |
download | openvswitch-e46b70205e25412d31edec28742210d77a8543a8.tar.gz |
OVN: add static IP support to IPAM
Add the capability to IPAM/MACAM framework to specify a static ip address
and get the L2 one allocated dynamically using the following syntax:
$ovn-nbctl lsp-set-addresses <port> "dynamic <IP>"
The static ip address needs to belong to the subnet configured for the
logical switch
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn/utilities')
-rw-r--r-- | ovn/utilities/ovn-nbctl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 9d1b22089..2fa0b3389 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -1529,11 +1529,14 @@ nbctl_lsp_set_addresses(struct ctl_context *ctx) int i; for (i = 2; i < ctx->argc; i++) { struct eth_addr ea; + ovs_be32 ip; if (strcmp(ctx->argv[i], "unknown") && strcmp(ctx->argv[i], "dynamic") && strcmp(ctx->argv[i], "router") && !ovs_scan(ctx->argv[i], ETH_ADDR_SCAN_FMT, - ETH_ADDR_SCAN_ARGS(ea))) { + ETH_ADDR_SCAN_ARGS(ea)) + && !ovs_scan(ctx->argv[i], "dynamic "IP_SCAN_FMT, + IP_SCAN_ARGS(&ip))) { ctl_error(ctx, "%s: Invalid address format. See ovn-nb(5). " "Hint: An Ethernet address must be " "listed before an IP address, together as a single " |