From f99fe83a37241fe1c616ecb854b5196112985861 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 28 Sep 2017 17:47:17 -0400 Subject: [PATCH] common/pick_address: add {public,cluster}_network_interface option Add _interfaces option to constrain the choice of IPs in the network list to those on interfaces matching the provided list of interface names. The _interfaces options only work in concert with the _network options, so you must also specify a list of networks if you want to use a specific interface, e.g., by specifying a broad network like "::" or "0.0.0.0/0". Signed-off-by: Sage Weil (cherry picked from commit 95cc790acddb597d6fef2d9e444f0b6e0436f16f) --- src/common/options.cc | 16 +++++- src/common/pick_address.cc | 102 +++++++++++++++++++++++++++++-------- src/common/pick_address.h | 7 +++ src/test/test_ipaddr.cc | 51 +++++++++++++++++++ 4 files changed, 153 insertions(+), 23 deletions(-) diff --git a/src/common/options.cc b/src/common/options.cc index cb4aadb47cdf8..605cbc8d170e9 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -160,12 +160,24 @@ std::vector