Date: Fri, 20 Jan 2017 17:21:00 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r312545 - projects/ipsec/sys/netipsec Message-ID: <201701201721.v0KHL0ov040229@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Fri Jan 20 17:20:59 2017 New Revision: 312545 URL: https://svnweb.freebsd.org/changeset/base/312545 Log: Count more malloc fails in the PFKEY statistics. Modified: projects/ipsec/sys/netipsec/key.c Modified: projects/ipsec/sys/netipsec/key.c ============================================================================== --- projects/ipsec/sys/netipsec/key.c Fri Jan 20 17:16:48 2017 (r312544) +++ projects/ipsec/sys/netipsec/key.c Fri Jan 20 17:20:59 2017 (r312545) @@ -2659,8 +2659,10 @@ key_newsah(struct secasindex *saidx) sah = malloc(sizeof(struct secashead), M_IPSEC_SAH, M_NOWAIT | M_ZERO); - if (sah == NULL) + if (sah == NULL) { + PFKEYSTAT_INC(in_nomem); return (NULL); + } TAILQ_INIT(&sah->savtree_larval); TAILQ_INIT(&sah->savtree_alive); sah->saidx = *saidx; @@ -2746,12 +2748,14 @@ key_newsav(const struct sadb_msghdr *mhp sav = malloc(sizeof(struct secasvar), M_IPSEC_SA, M_NOWAIT | M_ZERO); if (sav == NULL) { + PFKEYSTAT_INC(in_nomem); ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); *errp = ENOBUFS; goto done; } sav->lft_c = uma_zalloc(V_key_lft_zone, M_NOWAIT); if (sav->lft_c == NULL) { + PFKEYSTAT_INC(in_nomem); ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); free(sav, M_IPSEC_SA), sav = NULL; *errp = ENOBUFS;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701201721.v0KHL0ov040229>