Source-Changes-HG archive

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

[src/trunk]: src/crypto/dist/ipsec-tools/src/racoon PR/50815: David Binderman...



details:   https://anonhg.NetBSD.org/src/rev/6a48b2de7f05
branches:  trunk
changeset: 813779:6a48b2de7f05
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 17 20:11:17 2016 +0000

description:
PR/50815: David Binderman: Remove dup test

diffstat:

 crypto/dist/ipsec-tools/src/racoon/cfparse.y |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 85d566432edc -r 6a48b2de7f05 crypto/dist/ipsec-tools/src/racoon/cfparse.y
--- a/crypto/dist/ipsec-tools/src/racoon/cfparse.y      Wed Feb 17 20:05:45 2016 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/cfparse.y      Wed Feb 17 20:11:17 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cfparse.y,v 1.48 2012/11/29 15:31:24 vanhu Exp $       */
+/*     $NetBSD: cfparse.y,v 1.49 2016/02/17 20:11:17 christos Exp $    */
 
 /* Id: cfparse.y,v 1.66 2006/08/22 18:17:17 manubsd Exp */
 
@@ -1490,10 +1490,15 @@
                        char portbuf[10];
                        struct sockaddr *saddr;
 
-                       if (($5 == IPPROTO_ICMP || $5 == IPPROTO_ICMPV6)
-                        && ($4 != IPSEC_PORT_ANY || $4 != IPSEC_PORT_ANY)) {
-                               yyerror("port number must be \"any\".");
+                       switch ($5) {
+                       case IPPROTO_ICMP:
+                       case IPPROTO_ICMPV6:
+                               if ($4 == IPSEC_PORT_ANY)
+                                       break;
+                               yyerror("port must be \"any\" for icmp{,6}.");
                                return -1;
+                       default:
+                               break;
                        }
 
                        snprintf(portbuf, sizeof(portbuf), "%lu", $4);



Home | Main Index | Thread Index | Old Index