svn commit: r358194 - head/sys/netgraph

Gleb Smirnoff glebius at FreeBSD.org
Fri Feb 21 04:18:16 UTC 2020


Author: glebius
Date: Fri Feb 21 04:18:15 2020
New Revision: 358194
URL: https://svnweb.freebsd.org/changeset/base/358194

Log:
  Rework second part of r357558.  Unroll the macro and allocate memory in
  sleepable manner before entering the epoch for the send.

Modified:
  head/sys/netgraph/ng_socket.c

Modified: head/sys/netgraph/ng_socket.c
==============================================================================
--- head/sys/netgraph/ng_socket.c	Fri Feb 21 04:10:41 2020	(r358193)
+++ head/sys/netgraph/ng_socket.c	Fri Feb 21 04:18:15 2020	(r358194)
@@ -410,6 +410,7 @@ ngd_send(struct socket *so, int flags, struct mbuf *m,
 	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,
 	}
 
 	/* 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:


More information about the svn-src-all mailing list