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

Submitter:  Martin Persich <persich>
Submitted:  Tue 16 Feb 2010 08:23:03 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Feature Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned 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>
Group administrator
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>
Group administrator
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>
Group administrator
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-02-19 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code