Date: Sat, 10 Dec 2016 16:41:56 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r309820 - projects/ipsec/sys/netipsec Message-ID: <201612101641.uBAGfu7S044889@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Sat Dec 10 16:41:55 2016 New Revision: 309820 URL: https://svnweb.freebsd.org/changeset/base/309820 Log: Replace sav->tdb_xform == NULL check with ASSERT. All key_allocsa* functions return SA with alive state. There is no way to have SA without initialized tdb_xform in the savtree_alive list. Modified: projects/ipsec/sys/netipsec/ipsec_output.c Modified: projects/ipsec/sys/netipsec/ipsec_output.c ============================================================================== --- projects/ipsec/sys/netipsec/ipsec_output.c Sat Dec 10 16:21:09 2016 (r309819) +++ projects/ipsec/sys/netipsec/ipsec_output.c Sat Dec 10 16:41:55 2016 (r309820) @@ -171,17 +171,7 @@ next: } return (NULL); } - /* - * Sanity check the SA content for the caller - * before they invoke the xform output method. - */ - if (sav->tdb_xform == NULL) { - DPRINTF(("%s: no transform for SA\n", __func__)); - IPSEC_OSTAT_INC(isr->saidx.proto, noxform); - key_freesav(&sav); - *error = EHOSTUNREACH; - return (NULL); - } + IPSEC_ASSERT(sav->tdb_xform != NULL, ("SA with NULL tdb_xform")); return (sav); } @@ -403,17 +393,7 @@ next: } return (NULL); } - /* - * Sanity check the SA content for the caller - * before they invoke the xform output method. - */ - if (sav->tdb_xform == NULL) { - DPRINTF(("%s: no transform for SA\n", __func__)); - IPSEC_OSTAT_INC(isr->saidx.proto, noxform); - key_freesav(&sav); - *error = EHOSTUNREACH; - return (NULL); - } + IPSEC_ASSERT(sav->tdb_xform != NULL, ("SA with NULL tdb_xform")); return (sav); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612101641.uBAGfu7S044889>