Rework second part of r357558. Unroll the macro and allocate memory in
sleepable manner before entering the epoch for the send.
This commit is contained in:
parent
be3d57e69b
commit
039eb22c0a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358194
@ -410,6 +410,7 @@ ngd_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
|
||||
struct sockaddr_ng *const sap = (struct sockaddr_ng *) addr;
|
||||
int len, error;
|
||||
hook_p hook = NULL;
|
||||
item_p item;
|
||||
char hookname[NG_HOOKSIZ];
|
||||
|
||||
if ((pcbp == NULL) || (control != NULL)) {
|
||||
@ -462,8 +463,10 @@ ngd_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
|
||||
}
|
||||
|
||||
/* Send data. */
|
||||
item = ng_package_data(m, NG_WAITOK);
|
||||
m = NULL;
|
||||
NET_EPOCH_ENTER(et);
|
||||
NG_SEND_DATA_FLAGS(error, hook, m, NG_WAITOK);
|
||||
NG_FWD_ITEM_HOOK(error, item, hook);
|
||||
NET_EPOCH_EXIT(et);
|
||||
|
||||
release:
|
||||
|
Loading…
Reference in New Issue
Block a user