Source-Changes-HG archive

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

[src/trunk]: src/dist/ipf/tools PR/25532: Geoff C. Wing: a bad icmp-type rule...



details:   https://anonhg.NetBSD.org/src/rev/82a69ef987e3
branches:  trunk
changeset: 566853:82a69ef987e3
user:      christos <christos%NetBSD.org@localhost>
date:      Sat May 22 17:19:25 2004 +0000

description:
PR/25532: Geoff C. Wing: a bad icmp-type rule in /etc/ipf.conf can cause ipf
to segv upon parsing.

diffstat:

 dist/ipf/tools/ipf_y.y |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 5577d4884bbb -r 82a69ef987e3 dist/ipf/tools/ipf_y.y
--- a/dist/ipf/tools/ipf_y.y    Sat May 22 16:04:58 2004 +0000
+++ b/dist/ipf/tools/ipf_y.y    Sat May 22 17:19:25 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipf_y.y,v 1.4 2004/05/09 03:53:23 christos Exp $       */
+/*     $NetBSD: ipf_y.y,v 1.5 2004/05/22 17:19:25 christos Exp $       */
 
 %{
 #include "ipf.h"
@@ -315,6 +315,9 @@
 settos:        IPFY_TOS                        { setipftype(); }
        ;
 
+seticmptype: IPFY_ICMPTYPE             { setipftype(); }
+       ;
+
 toslist:
        YY_NUMBER       { DOALL(fr->fr_tos = $1; fr->fr_mtos = 0xff;) }
        | YY_HEX        { DOREM(fr->fr_tos = $1; fr->fr_mtos = 0xff;) }
@@ -897,9 +900,9 @@
 icmp:  | itype icode
        ;
 
-itype: IPFY_ICMPTYPE icmptype
+itype: seticmptype icmptype
        { DOALL(fr->fr_icmp = htons($2 << 8); fr->fr_icmpm = htons(0xff00);) }
-       | IPFY_ICMPTYPE lstart typelist lend
+       | seticmptype lstart typelist lend
        ;
 
 icode: | IPFY_ICMPCODE icmpcode



Home | Main Index | Thread Index | Old Index