diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-08-12 18:31:36 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-08-12 18:31:36 +0000 |
commit | 411d86faa7ab7d1260f311ed09b8f64327bb1bfd (patch) | |
tree | df17ede19934a41fa386dbbb2796bb4485297f3d | |
parent | 874318f896fe5914a4a5abf339191cd6cf785132 (diff) | |
download | FreeBSD-src-411d86faa7ab7d1260f311ed09b8f64327bb1bfd.zip FreeBSD-src-411d86faa7ab7d1260f311ed09b8f64327bb1bfd.tar.gz |
When allocating the IPv6 header to stick in front of raw packet being
sent via a raw IPv6 socket, use M_DONTWAIT not M_TRYWAIT, as we're
holding the raw pcb mutex.
Reported, tested by: kuriyama
-rw-r--r-- | sys/netinet6/raw_ip6.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 204ec29..202cdd6 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -377,7 +377,11 @@ rip6_output(m, va_alist) code = icmp6->icmp6_code; } - M_PREPEND(m, sizeof(*ip6), M_TRYWAIT); + M_PREPEND(m, sizeof(*ip6), M_DONTWAIT); + if (m == NULL) { + error = ENOBUFS; + goto bad; + } ip6 = mtod(m, struct ip6_hdr *); /* |