Paul Russell's libfw show_pings odd example does not work [Virus

Andreas.Rennen@ada.de
Fri, 10 Dec 1999 16:26:50 +0100


---------------------- Weitergeleitet von Andreas Rennen/ADA am 10.12.99
16:21 ---------------------------

Andreas Rennen
10.12.99 16:26

An: linux-ppp@vger.rutgers.edu
Kopie:
Thema: Paul Russell's libfw show_pings odd example does not work

Hi to all,
i'm testing the show_pings example from libfw-0.2 from Paul Russell on SuSE
Linux 6.2 with Kernel 2.2.12
First i created the monitor-device for ipchains with:
rennena:/ # mknod /dev/fwmonitor c 36 3

I created an ethertap with: (Support enabled in Kernel!)
rennena:/ # mknod /dev/tap0 c 36 16

and called:
ifconfig tap0 192.168.70.253 netmask 255.255.255.255 up arp

Then i called the example:
rennena:/usr/src/packages/SOURCES/ipchains-1.3.9/libfw-0.2 # show_pings
fw_raw_socket = 6.
mark = 228655105

This creates the following rule in ipchains:
Rennena:/usr/src/packages/SOURCES/ipchains-1.3.9/libfw-0.2 # ipchains -L -v
Chain input (policy ACCEPT: 172328 packets, 21794783 bytes):
pkts bytes target prot opt tosa tosx ifname mark outsize
source destination ports
0 0 DENY icmp -----o 0xFF 0x00 !tap0 0xdaa0001
anywhere anywhere echo-request
Chain forward (policy ACCEPT: 257 packets, 25020 bytes):
Chain output (policy ACCEPT: 125498 packets, 9991123 bytes):

Doing # ping -c -s 1 192.168.40.87 on the other computer produces the
following output:
Received packet of length 29 from `192.168.70.10' for `192.168.40.87'
through `eth1'. Replying...
(I can hear the ping sound)

After ^C it terminates with:
Packets done = 1.

On the pinging computer i get 100% packet loss - Why?
Why can i not reply the ping using the tap0?

Here is some more detail of my configuration:

Rennena:/diplom/libfw-0.2 # ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:DA:1C:9F:20
inet addr:192.168.40.87 Bcast:192.168.40.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:1268099 errors:0 dropped:0 overruns:0 frame:0
TX packets:131089 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:11 Base address:0x1400

eth1 Link encap:Ethernet HWaddr 00:E0:7D:02:76:46
inet addr:192.168.70.254 Bcast:192.168.70.255
Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:598 errors:0 dropped:0 overruns:0 frame:0
TX packets:391 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:10 Base address:0x1000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:85 errors:0 dropped:0 overruns:0 frame:0
TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

tap0 Link encap:Ethernet HWaddr FE:FD:00:00:00:00
inet addr:192.168.70.253 Bcast:192.168.70.255
Mask:255.255.255.255
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:126 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

Rennena:/diplom/libfw-0.2 # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.70.0 0.0.0.0 255.255.255.0 U 0 0 0
eth1
192.168.40.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.40.254 0.0.0.0 UG 0 0 0
eth0

In the source-code i found the following:
...
if (info->tap_inject) {
/* Ethertap */
memset(&data.hdr.eth.hdr, 0, sizeof(data.hdr.eth.hdr));
}

I thought it will destroy the adress-information and because this i tested
the
example without memset the header with zero. No success! Why do i have to
do this?

What am i doing wrong? Please help if you can.
Thank's

Andreas Rennen
rennena@ada.de or red_runner@t-online.de

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu