mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 13:58:30 -04:00
netmap: fix crash with monitors and VALE ports
Crash report described here:
https://github.com/luigirizzo/netmap/issues/583
Fixed by providing dummy sync callback in case it is missing.
This commit is contained in:
parent
b882e02bc4
commit
aa4dd64dfe
1 changed files with 10 additions and 1 deletions
|
|
@ -259,11 +259,20 @@ static int netmap_monitor_parent_txsync(struct netmap_kring *, int);
|
|||
static int netmap_monitor_parent_rxsync(struct netmap_kring *, int);
|
||||
static int netmap_monitor_parent_notify(struct netmap_kring *, int);
|
||||
|
||||
static int
|
||||
nm_monitor_dummycb(struct netmap_kring *kring, int flags)
|
||||
{
|
||||
(void)kring;
|
||||
(void)flags;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
nm_monitor_intercept_callbacks(struct netmap_kring *kring)
|
||||
{
|
||||
ND("intercept callbacks on %s", kring->name);
|
||||
kring->mon_sync = kring->nm_sync;
|
||||
kring->mon_sync = kring->nm_sync != NULL ?
|
||||
kring->nm_sync : nm_monitor_dummycb;
|
||||
kring->mon_notify = kring->nm_notify;
|
||||
if (kring->tx == NR_TX) {
|
||||
kring->nm_sync = netmap_monitor_parent_txsync;
|
||||
|
|
|
|||
Loading…
Reference in a new issue