Don't Drop() denied packets, just set a Mark on them

pull/16/head
brl 9 years ago
parent a90827e88d
commit f8b331a987

@ -50,7 +50,8 @@ func (p *Policy) processPacket(pkt *nfqueue.Packet, proc *ProcInfo) {
result := p.rules.filter(pkt, proc, name) result := p.rules.filter(pkt, proc, name)
switch result { switch result {
case FILTER_DENY: case FILTER_DENY:
pkt.Drop() pkt.Mark = 1
pkt.Accept()
case FILTER_ALLOW: case FILTER_ALLOW:
pkt.Accept() pkt.Accept()
case FILTER_PROMPT: case FILTER_PROMPT:
@ -116,7 +117,8 @@ func (p *Policy) filterPending(rule *Rule) {
if rule.rtype == RULE_ALLOW { if rule.rtype == RULE_ALLOW {
pp.pkt.Accept() pp.pkt.Accept()
} else { } else {
pp.pkt.Drop() pp.pkt.Mark = 1
pp.pkt.Accept()
} }
} else { } else {
remaining = append(remaining, pp) remaining = append(remaining, pp)

@ -98,7 +98,9 @@ func (p *prompter) processPacket(pp *pendingPkt) {
if err != nil { if err != nil {
log.Warning("Error sending dbus RequestPrompt message: %v", err) log.Warning("Error sending dbus RequestPrompt message: %v", err)
pp.policy.removePending(pp) pp.policy.removePending(pp)
pp.pkt.Drop() pp.pkt.Mark = 1
pp.pkt.Accept()
//pp.pkt.Drop()
return return
} }
log.Debug("Received prompt response: %s [%s]", printScope(scope), rule) log.Debug("Received prompt response: %s [%s]", printScope(scope), rule)
@ -107,7 +109,9 @@ func (p *prompter) processPacket(pp *pendingPkt) {
if err != nil { if err != nil {
log.Warning("Error parsing rule string returned from dbus RequestPrompt: %v", err) log.Warning("Error parsing rule string returned from dbus RequestPrompt: %v", err)
pp.policy.removePending(pp) pp.policy.removePending(pp)
pp.pkt.Drop() pp.pkt.Mark = 1
pp.pkt.Accept()
//pp.pkt.Drop()
return return
} }
if scope == APPLY_SESSION { if scope == APPLY_SESSION {

Loading…
Cancel
Save