mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
fix: Callback signature check
This commit is contained in:
parent
fa7e95c420
commit
5a6a5fbbdf
1 changed files with 2 additions and 4 deletions
|
@ -16,15 +16,13 @@ import (
|
||||||
"github.com/evilsocket/islazy/fs"
|
"github.com/evilsocket/islazy/fs"
|
||||||
)
|
)
|
||||||
|
|
||||||
type hookFunc func(q *nfqueue.Nfqueue, a nfqueue.Attribute) int
|
|
||||||
|
|
||||||
type PacketProxy struct {
|
type PacketProxy struct {
|
||||||
session.SessionModule
|
session.SessionModule
|
||||||
chainName string
|
chainName string
|
||||||
rule string
|
rule string
|
||||||
queue *nfqueue.Nfqueue
|
queue *nfqueue.Nfqueue
|
||||||
queueNum int
|
queueNum int
|
||||||
queueCb hookFunc
|
queueCb func(q *nfqueue.Nfqueue, a nfqueue.Attribute) int
|
||||||
pluginPath string
|
pluginPath string
|
||||||
plugin *plugin.Plugin
|
plugin *plugin.Plugin
|
||||||
}
|
}
|
||||||
|
@ -151,7 +149,7 @@ func (mod *PacketProxy) Configure() (err error) {
|
||||||
return
|
return
|
||||||
} else if sym, err = mod.plugin.Lookup("OnPacket"); err != nil {
|
} else if sym, err = mod.plugin.Lookup("OnPacket"); err != nil {
|
||||||
return
|
return
|
||||||
} else if mod.queueCb, ok = sym.(hookFunc); !ok {
|
} else if mod.queueCb, ok = sym.(func(q *nfqueue.Nfqueue, a nfqueue.Attribute) int); !ok {
|
||||||
return fmt.Errorf("Symbol OnPacket is not a valid callback function.")
|
return fmt.Errorf("Symbol OnPacket is not a valid callback function.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue