Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/dhcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ Server.prototype = {
} else if (_static[clientMAC]) {
return _static[clientMAC];
}


const _ignoreRange = this.config('ignoreRange');
if(_ignoreRange)
return false;

const randIP = this.config('randomIP');
const _tmp = this.config('range');
Expand Down Expand Up @@ -363,7 +366,9 @@ Server.prototype = {
lease.server = this.config('server');
lease.state = 'OFFERED';

this.sendOffer(req);
if(lease.address) {
this.sendOffer(req);
}
},
sendOffer: function(req) {

Expand Down Expand Up @@ -408,7 +413,9 @@ Server.prototype = {
lease.state = 'BOUND';
lease.bindTime = new Date;

this.sendAck(req);
if(lease.address) {
this.sendAck(req);
}
},
sendAck: function(req) {
//console.log('Send ACK');
Expand Down
6 changes: 6 additions & 0 deletions lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,12 @@ const opts = {
type: 'Bool',
config: 'randomIP',
default: true
},
9999: {
name: 'Ignore Range',
type: 'Bool',
config: 'ignoreRange',
default: false
}
};

Expand Down