+
+ //check that host is not set to all 0's or 1's
+ long hostAddress = BitBufferHelper.getLong(this.getIPAddress().getAddress()) - prefix;
+ if (hostAddress == 0 || hostAddress == Math.pow(2, 32-this.getIPMaskLen()) - 1) {
+ return new Status(StatusCode.BADREQUEST, String.format("Invalid subnet gateway address: /%s", subnet));
+ }
+