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 From Wolfgang Schmieder <...



details:   https://anonhg.NetBSD.org/src/rev/e08e878b694b
branches:  trunk
changeset: 772389:e08e878b694b
user:      tteras <tteras%NetBSD.org@localhost>
date:      Sun Jan 01 16:14:11 2012 +0000

description:
>From Wolfgang Schmieder <wolfgang%die-schmieders.de@localhost>: Fix default NAT-T
port for listen { isakmp_natt } config directive.

diffstat:

 crypto/dist/ipsec-tools/src/racoon/cfparse.y |  33 +++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 3 deletions(-)

diffs (65 lines):

diff -r 22d7758ea02c -r e08e878b694b crypto/dist/ipsec-tools/src/racoon/cfparse.y
--- a/crypto/dist/ipsec-tools/src/racoon/cfparse.y      Sun Jan 01 15:57:31 2012 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/cfparse.y      Sun Jan 01 16:14:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cfparse.y,v 1.46 2012/01/01 15:44:06 tteras Exp $      */
+/*     $NetBSD: cfparse.y,v 1.47 2012/01/01 16:14:11 tteras Exp $      */
 
 /* Id: cfparse.y,v 1.66 2006/08/22 18:17:17 manubsd Exp */
 
@@ -359,6 +359,8 @@
 %type <val> identifierstring
 %type <saddr> remote_index ike_addrinfo_port
 %type <alg> algorithm
+%type <saddr> ike_addrinfo_port_natt
+%type <num> ike_port_natt
 
 %%
 
@@ -536,7 +538,7 @@
                        racoon_free($2);
                }
                EOS
-       |       X_ISAKMP_NATT ike_addrinfo_port
+       |       X_ISAKMP_NATT ike_addrinfo_port_natt
                {
 #ifdef ENABLE_NATT
                        myaddr_listen($2, TRUE);
@@ -591,11 +593,36 @@
                                ABORT();
                }
        ;
+ike_addrinfo_port_natt
+       :       ADDRSTRING ike_port_natt
+               {
+                       char portbuf[10];
+
+                       snprintf(portbuf, sizeof(portbuf), "%ld", $2);
+                       $$ = str2saddr($1->v, portbuf);
+                       
+                       vfree($1);
+                       if (!$$)
+                               ABORT();
+               }
+       ;
 ike_port
        :       /* nothing */   {       $$ = lcconf->port_isakmp; }
        |       PORT            { $$ = $1; } 
        ;
-
+ike_port_natt
+       :       /* nothing */ 
+               { 
+                       $$ = lcconf->port_isakmp_natt;  
+               }
+       |       PORT 
+               { 
+                       $$ = $1; 
+#ifndef ENABLE_NATT
+                       yywarn(error_message_natt_not_compiled_in);
+#endif                  
+               }
+       ;
        /* radius configuration */
 radcfg_statement
        :       RADCFG {



Home | Main Index | Thread Index | Old Index