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
This commit is contained in:
Aleksandr Fedorov 2022-02-09 22:00:50 +03:00
parent a0aeb1cef5
commit b27e6e91d0

View File

@ -2031,6 +2031,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);
@ -2061,8 +2062,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)