summaryrefslogtreecommitdiffstats
path: root/src/mds/MDSAuthCaps.h
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2018-08-03 22:20:16 +0200
committerSage Weil <sage@redhat.com>2018-08-13 00:01:05 +0200
commit6651b498639a45289ca98aaea6d08c7ea2279ce0 (patch)
treeeea45726201de195aa9906db65847036507a69ed /src/mds/MDSAuthCaps.h
parentmds/MDSAuthCaps: pass addr to is_capable (diff)
downloadceph-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.h18
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