buglwIP - A Lightweight TCP/IP stack - Bugs: bug #28917, ICMP STATS improvement

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #28917: ICMP STATS improvement

Submitted by:  Martin Persich <persich>
Submitted on:  Tue 16 Feb 2010 08:23:03 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Feature RequestStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Fri 19 Feb 2010 04:28:51 PM UTC, comment #4:

Partly fixed, the other half: "won't do"

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 16 Feb 2010 09:31:00 PM UTC, comment #3:

That's true, but modifying the ICMP stats from th RAW module seems a bit hacky: after all, you cannot be sure at all if the ICMP message sent by RAW is correct - and increasing xmit (to me) rather should be used for correctly sent packets (like for all other protocols), which cannot be ensured from the RAW module.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 16 Feb 2010 09:16:46 PM UTC, comment #2:

Thank you for quick reply. Point 1 - yes, your solution looks better. It is not important modification, but LwIP STATS is very useful to find my bugs ... :-)

Martin Persich <persich>
Tue 16 Feb 2010 08:38:44 PM UTC, comment #1:

Point 2 is OK for me - although I'd leave away the "not supported" message: if an echo reply is received, this means an echo request has been sent. This can only be done using a raw PCB, so the echo reply will be parsed by that raw PCB, too -> no need to issue a warning.
-> checked in - thanks for reporting

Point 1 is a different thing though: I'd prefer to not include that: raw should not modify the ICMP stats. Instead, I'd rather add a function icmp_send() to icmp.c that can send echo requests and increases the xmit stats counter.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 16 Feb 2010 08:23:03 PM UTC, original submission:

During working on PING command in my application I found two small improvement for LwIP STATS module:

1. Transmited ICMP_ECHO packet via RAW.C module isn't calculated in ICMP xmit packets.
Is it possible to add this code in RAW.C (V1.28) - line #267 ?

#if ICMP_STATS
if(pcb->protocol==IP_PROTO_ICMP) {
ICMP_STATS_INC(icmp.xmit);
/* increase number of messages attempted to send */
snmp_inc_icmpoutmsgs();
}
#endif
err = ip_output_if (q, src_ip, ipaddr, pcb->ttl, pcb->tos, pcb->protocol, netif);
...

2. Received ICMP_ER packet in module ICMP.C cause error counting.
Adding "case" in file ICMP.C (V1.50) - line #222 - solve this:

case ICMP_ER:
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP Echo reply - type %"S16_F" code %"S16_F" not supported.\n",
(s16_t)type, (s16_t)code));
break;
default:
...

Martin Persich

Martin Persich <persich>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by persich (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 19 Feb 2010 04:28:51 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1