Date: Mon, 28 Jan 2019 09:18:28 +0000 (UTC) From: Vincenzo Maffione <vmaffione@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343521 - stable/12/sys/dev/netmap Message-ID: <201901280918.x0S9IS9O037504@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vmaffione Date: Mon Jan 28 09:18:28 2019 New Revision: 343521 URL: https://svnweb.freebsd.org/changeset/base/343521 Log: MFC r343413 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. Modified: stable/12/sys/dev/netmap/netmap_monitor.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/netmap_monitor.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_monitor.c Mon Jan 28 08:36:10 2019 (r343520) +++ stable/12/sys/dev/netmap/netmap_monitor.c Mon Jan 28 09:18:28 2019 (r343521) @@ -259,11 +259,20 @@ static int netmap_monitor_parent_txsync(struct netmap_ 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901280918.x0S9IS9O037504>