From bfe3d78c55c8823550d48a7b9f7c2b50926a3142 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 10 Aug 2017 13:27:30 +0200 Subject: more testing with UDP --- README | 6 ++++++ src/Makefile | 4 ++-- src/drivers/net/rtl8139.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README b/README index 4ddff4c..28442ca 100644 --- a/README +++ b/README @@ -65,6 +65,12 @@ set disassemble-next-line on analyze network traffic: tcpdump -enr network.log +wireshark-gtk network.log + +issue a: +telnet 127.0.0.1 8080 +(starts ARP negitiation between Qemu host and guest in the user network) +echo -n "hello" | nc -4u -q1 127.0.0.1 8081 links ----- diff --git a/src/Makefile b/src/Makefile index feb7685..0817887 100644 --- a/src/Makefile +++ b/src/Makefile @@ -178,7 +178,7 @@ run-qemu-usb: image.bin run-qemu: image.bin qemu-system-i386 -cpu 486 -usb \ - -netdev user,id=net0,net=10.0.0.0/24,host=10.0.0.2,dhcpstart=10.0.0.16,hostfwd=tcp::8080-:80 \ + -netdev user,id=net0,net=10.0.0.0/24,host=10.0.0.2,dhcpstart=10.0.0.16,hostfwd=tcp::8080-:80,hostfwd=udp::8081-:81 \ -device rtl8139,netdev=net0 \ -object filter-dump,id=net0,netdev=net0,file=network.log \ -d guest_errors -m 32 -drive "file=image.bin,if=floppy,format=raw" \ @@ -186,7 +186,7 @@ run-qemu: image.bin run-qemu-debug: image.bin qemu-system-i386 -cpu 486 -usb \ - -netdev user,id=net0,net=10.0.0.0/24,host=10.0.0.2,dhcpstart=10.0.0.16,hostfwd=tcp::8080-:80 \ + -netdev user,id=net0,net=10.0.0.0/24,host=10.0.0.2,dhcpstart=10.0.0.16,hostfwd=tcp::8080-:80,hostfwd=udp::8081-:81 \ -device rtl8139,netdev=net0 \ -object filter-dump,id=net0,netdev=net0,file=network.log \ -S -s -d guest_errors -m 32 -drive "file=image.bin,if=floppy,format=raw" \ diff --git a/src/drivers/net/rtl8139.c b/src/drivers/net/rtl8139.c index 3dafaef..c500842 100644 --- a/src/drivers/net/rtl8139.c +++ b/src/drivers/net/rtl8139.c @@ -269,7 +269,7 @@ static void handle_receive_packet( rtl8139_t *rtl8139 ) uint16_t len = *( (uint16_t *)buffer ); buffer += sizeof( uint16_t ); #ifdef DEBUG - printf( "rtl8139: rcv len: %d\n", len ); + printf( "rtl8139: rcv len: %d\n", len - 4 ); #endif #ifdef DEBUG -- cgit v1.2.3-54-g00ecf