summaryrefslogtreecommitdiff
path: root/sys/netatalk/aarp.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2003-06-06 09:47:22 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2003-06-06 09:47:22 +0000
commit51b6a0e9119991b56efd986ec24c1dcf2ef75d65 (patch)
treec86d678805555b7c3d288cda8e2f837f0009d35c /sys/netatalk/aarp.c
parentc662fdcd80468eec6516ab8620e0db48b9682f26 (diff)
avoid M_WAIT in network stack; netbsd revision 1.13
Diffstat (limited to 'sys/netatalk/aarp.c')
-rw-r--r--sys/netatalk/aarp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c
index 0e180775227..9d110728124 100644
--- a/sys/netatalk/aarp.c
+++ b/sys/netatalk/aarp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aarp.c,v 1.4 2002/03/14 01:27:10 millert Exp $ */
+/* $OpenBSD: aarp.c,v 1.5 2003/06/06 09:47:21 itojun Exp $ */
/*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -233,7 +233,10 @@ aarpwhohas( ac, sat )
bcopy((caddr_t)atmulticastaddr, (caddr_t)eh->ether_dhost,
sizeof( eh->ether_dhost ));
eh->ether_type = htons(AT_LLC_SIZE + sizeof(struct ether_aarp));
- M_PREPEND( m, AT_LLC_SIZE, M_WAIT );
+ M_PREPEND( m, AT_LLC_SIZE, M_DONTWAIT );
+ if (!m)
+ return;
+
llc = mtod( m, struct llc *);
llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
llc->llc_control = LLC_UI;
@@ -660,7 +663,10 @@ aarpprobe( arg )
sizeof( eh->ether_dhost ));
eh->ether_type = htons( AT_LLC_SIZE +
sizeof( struct ether_aarp ));
- M_PREPEND( m, AT_LLC_SIZE, M_WAIT );
+ M_PREPEND( m, AT_LLC_SIZE, M_DONTWAIT );
+ if (!m)
+ return;
+
llc = mtod( m, struct llc *);
llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
llc->llc_control = LLC_UI;