>Number: 6432
>Category: system
>Synopsis: bgpd parsers line number count is off when multiline macros
>are used
>Confidential: yes
>Severity: serious
>Priority: medium
>Responsible: bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Mon Jul 19 02:10:01 GMT 2010
>Closed-Date:
>Last-Modified:
>Originator:
>Release:
>Organization:
>Environment:
System : OpenBSD 4.7
Details : OpenBSD 4.7-stable (GENERIC.MP) #12: Sun Jul 11 23:10:41
CEST 2010
[email protected]:/usr/src/sys/arch/i386/compile/GENERIC.MP
Architecture: OpenBSD.i386
Machine : i386
>Description:
When bgpd.conf contains a multiline macro, e.g.
announcements = "{ 192.168.0.0/24, \
172.16.0.0/23, \
10.0.0.0/20 \
}"
then the line number will be off by 3 in error outputs of the
bgpd.conf parser.
>How-To-Repeat:
insert above macro, cause syntax error in bgpd.conf after the macro.
check the line number where the error is reported.
>Fix:
this patch:
Index: bgpd/parse.y
===================================================================
RCS file: /opt/OpenBSD-CVS//src/usr.sbin/bgpd/parse.y,v
retrieving revision 1.249
diff -u -p -r1.249 parse.y
--- bgpd/parse.y 5 Mar 2010 15:25:00 -0000 1.249
+++ bgpd/parse.y 19 Jul 2010 00:26:16 -0000
@@ -2163,9 +2163,10 @@ top:
return (0);
if (next == quotec || c == ' ' || c == '\t')
c = next;
- else if (next == '\n')
+ else if (next == '\n') {
+ file->lineno++;
continue;
- else
+ } else
lungetc(next);
} else if (c == quotec) {
*p = '\0';
dmesg:
OpenBSD 4.7-stable (GENERIC.MP) #12: Sun Jul 11 23:10:41 CEST 2010
[email protected]:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Xeon(R) CPU 5110 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,TM2,CX16,xTPR
real mem = 3757395968 (3583MB)
avail mem = 3657089024 (3487MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 05/09/08, BIOS32 rev. 0 @ 0xf0010, SMBIOS
rev. 2.5 @ 0xfcc20 (81 entries)
bios0: vendor American Megatrends Inc. version "'V1.02.B10'" date 05/09/2008
bios0: empty empty
acpi0 at bios0: rev 2
acpi0: tables DSDT FACP APIC MCFG OEMB
acpi0: wakeup devices GPE_(S4) P0P1(S4) PS2K(S4) PS2M(S4) USB0(S4) USB1(S4)
USB2(S4) USB5(S4) EUSB(S4) USB3(S4) USB4(S4) USBE(S4) P0P4(S4) P0P5(S4)
P0P6(S4) P0P7(S4) P0P8(S4) P0P9(S4) GBE_(S4) SLPB(S4) PWRB(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 266MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Xeon(R) CPU 5110 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
cpu1:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,TM2,CX16,xTPR
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 7 (NPE2)
acpiprt2 at acpi0: bus 5 (NPE4)
acpiprt3 at acpi0: bus 1 (P0P1)
acpicpu0 at acpi0
acpicpu1 at acpi0
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: PWRB
bios0: ROM list: 0xc0000/0x8000 0xc8000/0x1000 0xc9000/0x1000 0xca000/0x1000
ipmi at mainbus0 not configured
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 5100 Host" rev 0x80
ppb0 at pci0 dev 2 function 0 "Intel 5100 PCIE" rev 0x80
pci1 at ppb0 bus 7
em0 at pci1 dev 0 function 0 "Intel PRO/1000 PT (82571EB)" rev 0x06: apic 2 int
16 (irq 11), address 00:e0:81:b1:46:38
em1 at pci1 dev 0 function 1 "Intel PRO/1000 PT (82571EB)" rev 0x06: apic 2 int
17 (irq 5), address 00:e0:81:b1:46:39
ppb1 at pci0 dev 3 function 0 "Intel 5100 PCIE" rev 0x80
pci2 at ppb1 bus 6
ppb2 at pci0 dev 4 function 0 "Intel 5100 PCIE" rev 0x80
pci3 at ppb2 bus 5
ppb3 at pci0 dev 5 function 0 "Intel 5100 PCIE" rev 0x80
pci4 at ppb3 bus 4
ppb4 at pci0 dev 6 function 0 "Intel 5100 PCIE" rev 0x80
pci5 at ppb4 bus 3
ppb5 at pci0 dev 7 function 0 "Intel 5100 PCIE" rev 0x80
pci6 at ppb5 bus 2
"Intel I/OAT SCNB" rev 0x80 at pci0 dev 8 function 0 not configured
pchb1 at pci0 dev 16 function 0 "Intel 5100 FSB" rev 0x80
pchb2 at pci0 dev 16 function 1 "Intel 5100 FSB" rev 0x80
pchb3 at pci0 dev 16 function 2 "Intel 5100 FSB" rev 0x80
pchb4 at pci0 dev 17 function 0 "Intel 5100 Reserved" rev 0x80
pchb5 at pci0 dev 19 function 0 "Intel 5100 Reserved" rev 0x80
pchb6 at pci0 dev 21 function 0 "Intel 5100 DDR" rev 0x80
pchb7 at pci0 dev 22 function 0 "Intel 5100 DDR" rev 0x80
uhci0 at pci0 dev 26 function 0 "Intel 82801I USB" rev 0x02: apic 2 int 16 (irq
11)
uhci1 at pci0 dev 26 function 1 "Intel 82801I USB" rev 0x02: apic 2 int 21 (irq
3)
ehci0 at pci0 dev 26 function 7 "Intel 82801I USB" rev 0x02: apic 2 int 18 (irq
15)
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
uhci2 at pci0 dev 29 function 0 "Intel 82801I USB" rev 0x02: apic 2 int 23 (irq
14)
uhci3 at pci0 dev 29 function 1 "Intel 82801I USB" rev 0x02: apic 2 int 19 (irq
10)
uhci4 at pci0 dev 29 function 2 "Intel 82801I USB" rev 0x02: apic 2 int 18 (irq
15)
uhci5 at pci0 dev 29 function 3 "Intel 82801I USB" rev 0x02: apic 2 int 16 (irq
11)
ehci1 at pci0 dev 29 function 7 "Intel 82801I USB" rev 0x02: apic 2 int 23 (irq
14)
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb6 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0x92
pci7 at ppb6 bus 1
vga1 at pci7 dev 0 function 0 "XGI Technology Volari Z7" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
ichpcib0 at pci0 dev 31 function 0 "Intel 82801IR LPC" rev 0x02: PM disabled
pciide0 at pci0 dev 31 function 2 "Intel 82801I SATA" rev 0x02: DMA, channel 0
configured to native-PCI, channel 1 configured to native-PCI
pciide0: using apic 2 int 19 (irq 10) for native-PCI interrupt
wd0 at pciide0 channel 0 drive 0: <ST3250620NS>
wd0: 16-sector PIO, LBA48, 238475MB, 488397168 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 6
wd1 at pciide0 channel 1 drive 0: <ST3250310NS>
wd1: 16-sector PIO, LBA48, 238475MB, 488397168 sectors
wd1(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 6
ichiic0 at pci0 dev 31 function 3 "Intel 82801I SMBus" rev 0x02: apic 2 int 18
(irq 15)
iic0 at ichiic0
wbng0 at iic0 addr 0x2f: w83793g
iic0: addr 0x4b 00=12 01=00 03=64 04=12 05=00 07=64 08=12 09=00 0b=64 0c=12
0d=00 0f=64 10=12 11=00 13=64 14=12 15=00 17=64 18=12 19=00 1b=64 1c=12 1d=00
1f=64 20=12 21=00 23=64 24=12 25=00 27=64 28=12 29=00 2b=64 2c=12 2d=00 2f=64
30=12 31=00 33=64 34=12 35=00 37=64 38=12 39=00 3b=64 3c=12 3d=00 3f=64 40=12
41=00 43=64 44=12 45=00 47=64 48=12 49=00 4b=64 4c=12 4d=00 4f=64 50=12 51=00
53=64 54=12 55=00 57=64 58=12 59=00 5b=64 5c=12 5d=00 5f=64 60=12 61=00 63=64
64=12 65=00 67=64 68=12 69=00 6b=64 6c=12 6d=00 6f=64 70=12 71=00 73=64 74=12
75=00 77=64 78=12 79=00 7b=64 7c=12 7d=00 7f=64 80=12 81=00 83=64 84=12 85=00
87=64 88=12 89=00 8b=64 8c=12 8d=00 8f=64 90=12 91=00 93=64 94=12 95=00 97=64
98=12 99=00 9b=64 9c=12 9d=00 9f=64 a0=12 a1=00 a3=64 a4=12 a5=00 a7=64 a8=12
a9=00 ab=64 ac=12 ad=00 af=64 b0=12 b1=00 b3=64 b4=12 b5=00 b7=64 b8=12 b9=00
bb=64 bc=12 bd=00 bf=64 c0=12 c1=00 c3=64 c4=12 c5=00 c7=64 c8=13 c9=00 cb=64
cc=12 cd=00 cf=64 d0=13 d1=00 d3=64 d4=12 d5=00 d7=64 d!
8=13 d9=00 db=64 dc=12 dd=00 df=64 e0=13 e1=00 e3=64 e4=12 e5=00 e7=64 e8=12
e9=00 eb=64 ec=12 ed=00 ef=64 f0=12 f1=00 f3=64 f4=12 f5=00 f7=64 f8=12 f9=00
fb=64 fc=12 fd=00 ff=64 words 00=1300 01=00ff 02=5f00 03=6400 04=1300 05=00ff
06=5f00 07=6400
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb6 at uhci4: USB revision 1.0
uhub6 at usb6 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb7 at uhci5: USB revision 1.0
uhub7 at usb7 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: console
pckbc0 at isa0 port 0x60/5
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
wbsio0 at isa0 port 0x2e/2: W83627DHG rev 0x25
wbsio0 port 0xa10/2 not configured
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
mtrr: Pentium Pro MTRR support
vscsi0 at root
scsibus0 at vscsi0: 256 targets
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
WARNING: / was not properly unmounted
>Release-Note:
>Audit-Trail:
>Unformatted: