Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Don't sleep when handling ESP over UDP packets.



details:   https://anonhg.NetBSD.org/src/rev/ebf20a1172ab
branches:  trunk
changeset: 580494:ebf20a1172ab
user:      manu <manu%NetBSD.org@localhost>
date:      Mon Apr 25 20:37:06 2005 +0000

description:
Don't sleep when handling ESP over UDP packets.

diffstat:

 sys/netinet/udp_usrreq.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r af9f677b019b -r ebf20a1172ab sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c  Mon Apr 25 17:52:30 2005 +0000
+++ b/sys/netinet/udp_usrreq.c  Mon Apr 25 20:37:06 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: udp_usrreq.c,v 1.136 2005/04/23 14:05:28 manu Exp $    */
+/*     $NetBSD: udp_usrreq.c,v 1.137 2005/04/25 20:37:06 manu Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.136 2005/04/23 14:05:28 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.137 2005/04/25 20:37:06 manu Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -1456,8 +1456,11 @@
         * to select the right SPD for multiple hosts behind 
         * same NAT 
         */
-       tag = m_tag_get(PACKET_TAG_IPSEC_NAT_T_PORTS,
-           sizeof(sport) + sizeof(dport), M_WAITOK);
+       if ((tag = m_tag_get(PACKET_TAG_IPSEC_NAT_T_PORTS,
+           sizeof(sport) + sizeof(dport), M_DONTWAIT)) == NULL) {
+               printf("udp4_espinudp: m_tag_get failed\n");
+               return 0;
+       }
        ((u_int16_t *)(tag + 1))[0] = sport;
        ((u_int16_t *)(tag + 1))[1] = dport;
        m_tag_prepend(n, tag);



Home | Main Index | Thread Index | Old Index