diff options
author | Aleksandr Fedorov <afedorov@FreeBSD.org> | 2022-02-09 19:00:50 +0000 |
---|---|---|
committer | Aleksandr Fedorov <afedorov@FreeBSD.org> | 2022-02-13 12:05:45 +0000 |
commit | 85cd9f7e989bab02aee32a5f25d517567a0cc928 (patch) | |
tree | af53887df3022039b30acc55f7e2878c3e5f5ce9 /sys/netgraph | |
parent | b425101ab6d5eb705ba41edf706dbaf27a55b3c7 (diff) | |
download | src-85cd9f7e989bab02aee32a5f25d517567a0cc928.tar.gz src-85cd9f7e989bab02aee32a5f25d517567a0cc928.zip |
ng pppoe(4): Add the required NET_EPOCH section to the hook
disconnection function.
Disconnecting hooks are called outside of NET_EPOCH, but
ng_pppoe_disconnect() calls NG_SEND_DATA_ONLY() which should be called
in NET_EPOCH.
PR: 257067
Reported by: niels=freebsd@bakker.net
Reviewed by: vmaffione (mentor), glebius, donner
Approved by: vmaffione (mentor), glebius, donner
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D34185
(cherry picked from commit b27e6e91d0ad1f87b296f7583d4f5d938d7a997c)
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_pppoe.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c index 295a136cc554..e07f77b9d541 100644 --- a/sys/netgraph/ng_pppoe.c +++ b/sys/netgraph/ng_pppoe.c @@ -2037,6 +2037,7 @@ ng_pppoe_disconnect(hook_p hook) log(LOG_NOTICE, "ng_pppoe[%x]: session out of " "mbufs\n", node->nd_ID); else { + struct epoch_tracker et; struct pppoe_full_hdr *wh; struct pppoe_tag *tag; int msglen = strlen(SIGNOFF); @@ -2067,8 +2068,11 @@ ng_pppoe_disconnect(hook_p hook) m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) + msglen; wh->ph.length = htons(sizeof(*tag) + msglen); + + NET_EPOCH_ENTER(et); NG_SEND_DATA_ONLY(error, privp->ethernet_hook, m); + NET_EPOCH_EXIT(et); } } if (sp->state == PPPOE_LISTENING) |