Author: ae
Date: Thu Dec 11 18:46:11 2014
New Revision: 275712
URL: https://svnweb.freebsd.org/changeset/base/275712

Log:
  Treat errors when retrieving security policy as policy violation.
  
  Obtained from:        Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sys/netipsec/ipsec.c

Modified: head/sys/netipsec/ipsec.c
==============================================================================
--- head/sys/netipsec/ipsec.c   Thu Dec 11 18:40:56 2014        (r275711)
+++ head/sys/netipsec/ipsec.c   Thu Dec 11 18:46:11 2014        (r275712)
@@ -1265,6 +1265,9 @@ ipsec_in_reject(struct secpolicy *sp, st
        return (0);             /* Valid. */
 }
 
+/*
+ * Non zero return value means security policy DISCARD or policy violation.
+ */
 static int
 ipsec46_in_reject(struct mbuf *m, struct inpcb *inp)
 {
@@ -1284,8 +1287,7 @@ ipsec46_in_reject(struct mbuf *m, struct
                result = ipsec_in_reject(sp, m);
                KEY_FREESP(&sp);
        } else {
-               result = 0;     /* XXX Should be panic?
-                                * -> No, there may be error. */
+               result = 1;     /* treat errors as policy violation */
        }
        return (result);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to