Author: ae
Date: Sun Mar 11 18:46:40 2018
New Revision: 330777
URL: https://svnweb.freebsd.org/changeset/base/330777

Log:
  Add KASSERT to check that proper targed was used.
  
  MFC after:    2 weeks

Modified:
  head/sys/netipsec/keysock.c

Modified: head/sys/netipsec/keysock.c
==============================================================================
--- head/sys/netipsec/keysock.c Sun Mar 11 18:43:36 2018        (r330776)
+++ head/sys/netipsec/keysock.c Sun Mar 11 18:46:40 2018        (r330777)
@@ -185,6 +185,8 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int
        KASSERT(m != NULL, ("NULL mbuf pointer was passed."));
        KASSERT(so != NULL || target != KEY_SENDUP_ONE,
            ("NULL socket pointer was passed."));
+       KASSERT(target == KEY_SENDUP_ONE || target == KEY_SENDUP_ALL ||
+           target == KEY_SENDUP_REGISTERED, ("Wrong target %d", target));
 
        PFKEYSTAT_INC(in_total);
        PFKEYSTAT_ADD(in_bytes, m->m_pkthdr.len);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to