Skip to content

Commit

Permalink
mon: check 'nonce' validity for cidr ranges
Browse files Browse the repository at this point in the history
Signed-off-by: Greg Farnum <[email protected]>
  • Loading branch information
gregsfortytwo committed Apr 13, 2022
1 parent 4b08448 commit 5c903e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12710,6 +12710,12 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
if (err) {
goto reply;
}
if ((addr.is_ipv4() && addr.get_nonce() > 32) ||
(addr.is_ipv6() && addr.get_nonce() > 128)) {
ss << "Too many bits in range for that protocol!";
err = -EINVAL;
goto reply;
}
} else {
if (osdmap.require_osd_release >= ceph_release_t::nautilus) {
// always blocklist type ANY
Expand Down

0 comments on commit 5c903e5

Please sign in to comment.