This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1001656] FreeBSD: add AF_PACKET socket familiy


Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001656

--- Comment #22 from Bernd Edlinger <bernd.edlinger@hotmail.de> ---
Created attachment 2598
  --> http://bugs.ecos.sourceware.org/attachment.cgi?id=2598&action=edit
Bug-Fixes for Achilles Test

Hi,

I have been doing some Testing with an Achilles System here
on an eCos / eCosPro Target recently.  See http://www.wurldtech.com

I was able to fix a few anomalies that were found in these tests.

The attached patch file is meant to be applied in addition to the
previous patches.

Here are some explanations, what this patch does:

* src/sys/netinet/ip_icmp.c:

- fix crash in Achilles UDP Fuzzer test.

This test sent an UDP packet with maximum size IP header.
The bsd stack tried to send an ICMP unreachable response.

But it triggered this panic, in the icmp_error handler:

        if (m->m_data - sizeof(struct ip) < m->m_pktdat)
                panic("icmp len");

That is because the maximum payload of a MBUF with m_hdr and
pkthdr is MHLEN = 128-20-24 = 84 bytes, but the ICMP response should
contain an 8 bytes ICMP header, plus the original IP header
and up to 8 bytes of the original UDP header, and of course
the minimum IP header in front:
That can be up to 20 + 8 + 60 + 8 = 96 bytes.

This patch throws this packet away, instead of crashing.


* src/sys/netinet/tcp_input.c:

- fix the Achilles test cases:
- TCP SYN Storm from Broadcast (L2)
- TCP Data Grammar (L2)

  M_BCAST/M_MCAST is only set if ethernet header is a BCAST address
ff:ff:ff:ff:ff:ff.
  but Achilles sends UNICAST ethernet header with network local broad cast
172.17.255.255
  addresses in the IP header source address field, and the bsd_stack sent
  back to the unicast ethernet address with IP bcast address in IP destination
field.

This avoids sending SYN/ACK and RST packets to broadcast addresses.

I have no idea what do to about the "normal" TCP SYN Storm Test:
This is still failing, because we do not have tcp_syncookies.


* include/net/if.h, src/sys/netinet/if_ether.c:

- increase IFQ_MAXLEN to 1024
- and use it also for the ARP request queue

This is necessary to pass the UDP Data Grammar tests,
which send 64KB UDP packets (which has 46 fragments)
and if the IFQ_MAXLEN is at 50 this leaves too little
headroom for additional ICMP and UDP packets, which must
be handled to pass the test.

In order to pass the ICMP and ARP storm tests, you
have to allocate _many_ (>3000) MBUFs, and using a too
small IFQ_MAXLEN would throw away some important packets,
which may cause the test to fail.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]