diff options
author | ume <ume@FreeBSD.org> | 2003-11-05 09:41:23 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-11-05 09:41:23 +0000 |
commit | 1b0d2b237ef5dc12f3fb211efc7b75ca8569ceea (patch) | |
tree | 1ea09163a35ae85d875bf32809246ad32e65bf53 /lib/libipsec/policy_token.l | |
parent | 0206145b43bc58420bb652c29f4f7a986f05117b (diff) | |
download | FreeBSD-src-1b0d2b237ef5dc12f3fb211efc7b75ca8569ceea.zip FreeBSD-src-1b0d2b237ef5dc12f3fb211efc7b75ca8569ceea.tar.gz |
- plug memory leak.
- fixed a length of the sadb extension in the case of pfkey_send_x5().
- used getprotobynumber() for printing a upper layer protocol name.
- modified the output format against the change of the setkey syntax
about a icmp6 type/code.
- don't enumerate reserved fields. use memset.
Obtained from: KAME
Diffstat (limited to 'lib/libipsec/policy_token.l')
-rw-r--r-- | lib/libipsec/policy_token.l | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/libipsec/policy_token.l b/lib/libipsec/policy_token.l index 11e0c06..ced57b3 100644 --- a/lib/libipsec/policy_token.l +++ b/lib/libipsec/policy_token.l @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $KAME: policy_token.l,v 1.11 2000/12/01 10:08:29 sakane Exp $ */ +/* $KAME: policy_token.l,v 1.13 2003/05/09 05:19:55 sakane Exp $ */ /* * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. @@ -46,11 +46,7 @@ #include <unistd.h> #include <errno.h> -#ifndef __NetBSD__ #include "y.tab.h" -#else -#include "policy_parse.h" -#endif #define yylval __libipsecyylval /* XXX */ int yylex(void); @@ -133,16 +129,26 @@ unique { yylval.num = IPSEC_LEVEL_UNIQUE; return(LEVEL); } %% void __policy__strbuffer__init__(char *); +void __policy__strbuffer__free__(void); + +static YY_BUFFER_STATE strbuffer; void __policy__strbuffer__init__(msg) char *msg; { - YY_BUFFER_STATE yyb; - - yyb = (YY_BUFFER_STATE)yy_scan_string(msg); - yy_switch_to_buffer(yyb); + if (yy_current_buffer) + yy_delete_buffer(yy_current_buffer); + strbuffer = (YY_BUFFER_STATE)yy_scan_string(msg); + yy_switch_to_buffer(strbuffer); return; } +void +__policy__strbuffer__free__() +{ + yy_delete_buffer(strbuffer); + + return; +} |