-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug with interface.json changes not working. Changed actions to verdicts on nfpacket object. Minor other undocumented changes.
- Loading branch information
Dustyn Blackmore
committed
May 17, 2018
1 parent
1a6441d
commit ea9d750
Showing
3 changed files
with
26 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,35 @@ | ||
const actions = (dependencies) => (state) => ({ | ||
accept: (mark) => { | ||
module.exports = (dependencies) => (state) => ({ | ||
accept: () => { | ||
state.nfpacket | ||
? state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_ACCEPT, mark) | ||
? state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_ACCEPT, state.mark) | ||
: false | ||
}, | ||
reject: (mark) => { | ||
reject: () => { | ||
// This allows us to admin-prohibit and immediately reject outgoing, intead of droop (timeout). | ||
if (state.direction === 'outgoing') { | ||
state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_REPEAT, 777) | ||
} else { | ||
state.nfpacket | ||
? state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_DROP, mark) | ||
? state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_DROP, state.mark) | ||
: false | ||
} | ||
}, | ||
requeue: (mark) => { | ||
requeue: () => { | ||
state.nfpacket | ||
? state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_REPEAT, mark) | ||
? state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_REPEAT, state.mark) | ||
: false | ||
}, | ||
verdict: (verdict, mark) => { | ||
switch (verdict) { | ||
getVerdict: () => { | ||
switch (state.verdict) { | ||
case state.enums.netfilterVerdict.NF_ACCEPT: | ||
return state.actions.accept; | ||
return state.verdicts.accept; | ||
break; | ||
case state.enums.netfilterVerdict.NF_REPEAT: | ||
return state.actions.requeue; | ||
return state.verdicts.requeue; | ||
break; | ||
default: | ||
return state.actions.reject; | ||
return state.verdicts.reject; | ||
break; | ||
} | ||
} | ||
}) | ||
|
||
module.exports = actions; |