diff options
author | Sage Weil <sage@redhat.com> | 2018-08-03 22:20:16 +0200 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2018-08-13 00:01:05 +0200 |
commit | 6651b498639a45289ca98aaea6d08c7ea2279ce0 (patch) | |
tree | eea45726201de195aa9906db65847036507a69ed /src/mds/MDSAuthCaps.h | |
parent | mds/MDSAuthCaps: pass addr to is_capable (diff) | |
download | ceph-6651b498639a45289ca98aaea6d08c7ea2279ce0.tar.xz ceph-6651b498639a45289ca98aaea6d08c7ea2279ce0.zip |
mds/MDSAuthCaps: parse and enforce network restriction
Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src/mds/MDSAuthCaps.h')
-rw-r--r-- | src/mds/MDSAuthCaps.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mds/MDSAuthCaps.h b/src/mds/MDSAuthCaps.h index 6297a456be6..c21df082137 100644 --- a/src/mds/MDSAuthCaps.h +++ b/src/mds/MDSAuthCaps.h @@ -132,9 +132,23 @@ struct MDSCapGrant { MDSCapSpec spec; MDSCapMatch match; - MDSCapGrant(const MDSCapSpec &spec_, const MDSCapMatch &match_) - : spec(spec_), match(match_) {} + std::string network; + + entity_addr_t network_parsed; + unsigned network_prefix = 0; + bool network_valid = true; + + MDSCapGrant(const MDSCapSpec &spec_, const MDSCapMatch &match_, + boost::optional<std::string> n) + : spec(spec_), match(match_) { + if (n) { + network = *n; + parse_network(); + } + } MDSCapGrant() {} + + void parse_network(); }; class MDSAuthCaps |