Date: Mon, 19 Jul 1999 17:25:46 +0200 From: Wim Livens <livensw@rc.bel.alcatel.be> To: freebsd-hackers@freebsd.org, freebsd-net@freebsd.org Subject: bug in ip_forward() ? Message-ID: <19990719172546.C1676@rc.bel.alcatel.be>
next in thread | raw e-mail | index | archive | help
I suspect a bug in IP forwarding. I'm using FreeBSD 2.2.8-RELEASE.
This is our network:
+------+ +------+ +------+ +------+
| |4.2 4.1| |2.1 2.2| |5.1 5.2| |
|btm22t|---------|btm22q|---------|btm22r|---------|btm22u|
| | | | | | | |
+------+ +------+ +------+ +------+
And this is what I do:
btm22t# ping 192.168.5.2
ok, it works...
btm22q# route delete -net 192.168.5.0 -netmask 255.255.255.252 192.168.2.2
ok, ping stops.
btm22q# route add -net 192.168.5.0 -netmask 255.255.255.252 192.168.2.2
ping doesn't work
btm22t# ^C
btm22t# ping 192.168.5.2
ping still doesn't work
btm22t# ping 192.168.5.1 (or 192.168.2.2)
this ping works and suddenly the ping to 192.168.5.2 works too !
Although:
btm22t# ping 192.168.5.2
ok, it works...
btm22t# ^C
btm22q# route delete -net 192.168.5.0 -netmask 255.255.255.252 192.168.2.2
btm22q# route add -net 192.168.5.0 -netmask 255.255.255.252 192.168.2.2
btm22t# ping 192.168.5.2
ping works!
After disabling the cache in ip_forward() (netinet/ip_input.c)
i.e.:
sin = (struct sockaddr_in *)&ipforward_rt.ro_dst;
< if ((rt = ipforward_rt.ro_rt) == 0 ||
< ip->ip_dst.s_addr != sin->sin_addr.s_addr )
> if (1)
{
...
the problem doesn't occur!
Anyone has a clue what's wrong here ?
Thanks a lot,
Wim.
-------
What follows is just some background info.
Relevant routes:
btm22t:
192.168/30 198.149.4.1 UGS1c 0 0 fxp0
192.168.1/30 198.149.4.1 UGS1c 0 0 fxp0
192.168.2/30 198.149.4.1 UGS1c 0 2 fxp0
192.168.4/30 link#2 UC 0 0
192.168.4.1 0:50:8b:7:50:12 UHLW 0 139
btm22q:
192.168/30 link#2 UC 0 0
192.168.0.1 link#2 UHLW 2 11
192.168.1/30 192.168.0.1 UGS1c 0 0 fxp1
192.168.2/30 link#3 UC 0 0
192.168.2.2 0:8:c7:b3:c8:c3 UHLW 1 44 fxp2 927
192.168.3/30 192.168.0.1 UGS1c 0 0 fxp1
192.168.4/30 link#1 UC 0 0
192.168.4.2 0:50:8b:7:54:2e UHLW 1 4534 fxp0 777
192.168.5/30 192.168.2.2 UGSc 0 2 fxp2
btm22r:
192.168/30 192.168.1.1 UGS1c 0 0 fxp2
192.168.1/30 link#3 UC 0 0
192.168.1.1 link#3 UHLW 1 103
192.168.2/30 link#2 UC 0 0
192.168.2.1 0:50:8b:7:49:17 UHLW 1 145 fxp1 895
192.168.4/30 192.168.2.1 UGS1c 1 21 fxp1
192.168.5/30 link#1 UC 0 0
192.168.5.2 0:50:8b:7:54:33 UHLW 0 275355 fxp0 505
btm22u:
192.168.2/30 192.168.5.1 UGS1c 0 16 fxp1
192.168.4/30 192.168.5.1 UGS1c 0 6 fxp1
192.168.5/30 link#2 UC 0 0
192.168.5.1 0:50:8b:7:49:7d UHLW 2 0 fxp1 489
dmesg on btm22q:
FreeBSD 2.2.8-RELEASE #0: Fri Jul 16 15:34:52 CEST 1999
root@btm22u.rc.bel.alcatel.be:/usr/src/sys-cvs/sys/compile/CUSTOM
CPU: Pentium II (quarter-micron) (348.49-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0x652 Stepping=2
Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,<b16>,<b17>,MMX,<
b24>>
real memory = 67108864 (65536K bytes)
avail memory = 63123456 (61644K bytes)
altq: major number is 96
Probing for devices on PCI bus 0:
chip0 <generic PCI bridge (vendor=8086 device=7190 subclass=0)> rev 2 on pci0:0:0
chip1 <generic PCI bridge (vendor=8086 device=7191 subclass=4)> rev 2 on pci0:1:0
fxp0 <Intel EtherExpress Pro 10/100B Ethernet> rev 5 int a irq 11 on pci0:13:0
fxp0: Ethernet address 00:50:8b:07:50:12
fxp1 <Intel EtherExpress Pro 10/100B Ethernet> rev 5 int a irq 11 on pci0:14:0
fxp1: Ethernet address 00:50:8b:07:4b:f6
fxp2 <Intel EtherExpress Pro 10/100B Ethernet> rev 5 int a irq 11 on pci0:15:0
fxp2: Ethernet address 00:50:8b:07:49:17
chip2 <generic PCI bridge (vendor=1011 device=0024 subclass=4)> rev 3 on pci0:16:0
chip3 <Intel 82371AB PCI-ISA bridge> rev 2 on pci0:20:0
chip4 <Intel 82371AB IDE interface> rev 1 on pci0:20:1
chip5 <Intel 82371AB USB interface> rev 1 int d irq 11 on pci0:20:2
chip6 <Intel 82371AB Power management controller> rev 2 on pci0:20:3
Probing for devices on PCI bus 1:
vga0 <VGA-compatible display device> rev 1 int a irq 11 on pci1:0:0
Probing for devices on PCI bus 2:
de0 <Digital 21140A Fast Ethernet> rev 34 int a irq 11 on pci2:4:0
de0: ZNYX ZX34X 21140A [10-100Mb/s] pass 2.2
de0: address 00:c0:95:e0:e3:70
de1 <Digital 21140A Fast Ethernet> rev 34 int a irq 11 on pci2:5:0
de1: ZNYX ZX34X 21140A [10-100Mb/s] pass 2.2
de1: address 00:c0:95:e0:e3:71
de2 <Digital 21140A Fast Ethernet> rev 34 int a irq 11 on pci2:6:0
de2: ZNYX ZX34X 21140A [10-100Mb/s] pass 2.2
de2: address 00:c0:95:e0:e3:72
de3 <Digital 21140A Fast Ethernet> rev 34 int a irq 11 on pci2:7:0
de3: ZNYX ZX34X 21140A [10-100Mb/s] pass 2.2
de3: address 00:c0:95:e0:e3:73
Probing for PnP devices:
No Plug-n-Play devices were found
Probing for devices on the ISA bus:
sc0 at 0x60-0x6f irq 1 on motherboard
sc0: VGA color <16 virtual consoles, flags=0x0>
ed0 not found at 0x300
psm0 not found at 0x60
sio0 at 0x3f8-0x3ff irq 4 on isa
sio0: type 16550A
sio1 at 0x2f8-0x2ff irq 3 on isa
sio1: type 16550A
pcm0 not found at 0xffffffff
wdc0 at 0x1f0-0x1f7 irq 14 on isa
wdc0: unit 0 (wd0): <FUJITSU MPB3043ATU>
wd0: 4112MB (8421840 sectors), 8912 cyls, 15 heads, 63 S/T, 512 B/S
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
fdc0: FIFO enabled, 8 bytes threshold
fd0: 1.44MB 3.5in
ep0 not found at 0x330
ep1 not found at 0x310
ep2 not found at 0x320
npx0 on motherboard
npx0: INT 16 interface
IP packet filtering initialized, divert enabled, default to accept, unlimited logging
de0: enabling 100baseTX port
de3: autosense failed: cable problem?
de1: autosense failed: cable problem?
de2: autosense failed: cable problem?
--
Wim Livens.
Alcatel - Corporate Research Center wim.livens@alcatel.be
Fr. Wellesplein 1 livensw@rc.bel.alcatel.be
B-2018 Antwerpen Tel: +32 3 240 7570
Belgium. Fax: +32 3 240 9932
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990719172546.C1676>
