No Ping Response

classic Classic list List threaded Threaded
6 messages Options
UV
Reply | Threaded
Open this post in threaded view
|

No Ping Response

UV
Hi

I'm using lwIP 1.4.1 on STM32F207. For some reason I cannot ping the device from my PC.
I've modified icmp.c based on the bug# 38803 and it still does not work.
I've attached a screen shot form  Wireshark and CMD.
Please help.

UV
WinShark_ScreenShot.PNG
CMD_ScreenShot.PNG
Reply | Threaded
Open this post in threaded view
|

Re: No Ping Response

vincent cui
You need modify some definition and open HW checksum .
I



Vincent Cui
Firmware Engineer Leader
Shanghai Enlogic Electric Technology Co., Ltd.
Room1106, Building A, New Caohejing Business Centre, No.391, Guiping Road, Xuhui District, Shanghai, P.R.China
T: +86 21 34612525, M: +86 13482482211
www.enlogic.com
------------------------------------------------------------------------
Please consider the environment before printing this email.
------------------------------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed.  If you have received this e-mail in error, please notify the sender immediately and then delete it.  If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message.  We cannot accept liability for any loss or damage caused by software viruses.  Any views and/or opinions expressed in this e-mail are of the author only and do not necessarily represent the views of Enlogic.
------------------------------------------------------------------------
-----Original Message-----
From: lwip-users-bounces+vincent.cui=[hidden email] [mailto:lwip-users-bounces+vincent.cui=[hidden email]] On Behalf Of UV
Sent: 2013年7月10日 PM 2:53
To: [hidden email]
Subject: [lwip-users] No Ping Response

Hi

I'm using lwIP 1.4.1 on STM32F207. For some reason I cannot ping the device
from my PC.
I've modified icmp.c based on the bug# 38803 and it still does not work.
I've attached a screen shot form  Wireshark and CMD.
Please help.

UV
WinShark_ScreenShot.PNG
<http://lwip.100.n7.nabble.com/file/n21717/WinShark_ScreenShot.PNG>
CMD_ScreenShot.PNG
<http://lwip.100.n7.nabble.com/file/n21717/CMD_ScreenShot.PNG>



--
View this message in context: http://lwip.100.n7.nabble.com/No-Ping-Response-tp21717.html
Sent from the lwip-users mailing list archive at Nabble.com.

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: No Ping Response

Noam weissman
In reply to this post by UV
Hi,

Have you enabled ICMP ?

#define LWIP_ICMP               1

#define LWIP_UDP                1

I closed CS by hardware as it caused my system not to response to ping.

/* CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.*/
  #define CHECKSUM_GEN_IP                 1
  /* CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.*/
  #define CHECKSUM_GEN_UDP                1
  /* CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.*/
  #define CHECKSUM_GEN_TCP                1
  /* CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.*/
  #define CHECKSUM_CHECK_IP               1
  /* CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.*/
  #define CHECKSUM_CHECK_UDP              1
  /* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/
  #define CHECKSUM_CHECK_TCP              1


Noam.



-----Original Message-----
From: lwip-users-bounces+noam=[hidden email] [mailto:lwip-users-bounces+noam=[hidden email]] On Behalf Of UV
Sent: ד 10 יולי 2013 09:53
To: [hidden email]
Subject: [lwip-users] No Ping Response

Hi

I'm using lwIP 1.4.1 on STM32F207. For some reason I cannot ping the device from my PC.
I've modified icmp.c based on the bug# 38803 and it still does not work.
I've attached a screen shot form  Wireshark and CMD.
Please help.

UV
WinShark_ScreenShot.PNG
<http://lwip.100.n7.nabble.com/file/n21717/WinShark_ScreenShot.PNG>
CMD_ScreenShot.PNG
<http://lwip.100.n7.nabble.com/file/n21717/CMD_ScreenShot.PNG>  



--
View this message in context: http://lwip.100.n7.nabble.com/No-Ping-Response-tp21717.html
Sent from the lwip-users mailing list archive at Nabble.com.

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

 
 
************************************************************************************
This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************




 
 
************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************




_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: No Ping Response

seba.segura
you must add these line into your icmp_input() function :

#endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */
    /* At this point, all checks are OK. */
    /* We generate an answer by switching the dest and src ip addresses,
     * setting the icmp type to ECHO_RESPONSE and updating the checksum. */
    iecho = (struct icmp_echo_hdr *)p->payload;
    ip_addr_copy(iphdr->src, *ip_current_dest_addr());
    ip_addr_copy(iphdr->dest, *ip_current_src_addr());
    ICMPH_TYPE_SET(iecho, ICMP_ER);
   
/* This part of code has been modified by ST's MCD Application Team */
/* To use the Checksum Offload Engine for the putgoing ICMP packets,
   the ICMP checksum field should be set to 0, this is required only for Tx ICMP*/
#ifdef CHECKSUM_BY_HARDWARE
    iecho->chksum = 0;
#else
        /* adjust the checksum */
    if (iecho->chksum >= htons(0xffff - (ICMP_ECHO << 8))) {
      iecho->chksum += htons(ICMP_ECHO << 8) + 1;
    } else {
      iecho->chksum += htons(ICMP_ECHO << 8);
    }
#endif
    /* adjust the checksum
    if (iecho->chksum >= PP_HTONS(0xffffU - (ICMP_ECHO << 8))) {
      iecho->chksum += PP_HTONS(ICMP_ECHO << 8) + 1;
    } else {
      iecho->chksum += PP_HTONS(ICMP_ECHO << 8);
    }*/

    /* Set the correct TTL and recalculate the header checksum. */
    IPH_TTL_SET(iphdr, ICMP_TTL);
    IPH_CHKSUM_SET(iphdr, 0);




----- Mail original -----
De: "Noam weissman" <[hidden email]>
À: "Mailing list for lwIP users" <[hidden email]>
Envoyé: Mercredi 10 Juillet 2013 12:14:50
Objet: Re: [lwip-users] No Ping Response

Hi,

Have you enabled ICMP ?

#define LWIP_ICMP               1

#define LWIP_UDP                1

I closed CS by hardware as it caused my system not to response to ping.

/* CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.*/
  #define CHECKSUM_GEN_IP                 1
  /* CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.*/
  #define CHECKSUM_GEN_UDP                1
  /* CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.*/
  #define CHECKSUM_GEN_TCP                1
  /* CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.*/
  #define CHECKSUM_CHECK_IP               1
  /* CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.*/
  #define CHECKSUM_CHECK_UDP              1
  /* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/
  #define CHECKSUM_CHECK_TCP              1


Noam.



-----Original Message-----
From: lwip-users-bounces+noam=[hidden email] [mailto:lwip-users-bounces+noam=[hidden email]] On Behalf Of UV
Sent: ד 10 יולי 2013 09:53
To: [hidden email]
Subject: [lwip-users] No Ping Response

Hi

I'm using lwIP 1.4.1 on STM32F207. For some reason I cannot ping the device from my PC.
I've modified icmp.c based on the bug# 38803 and it still does not work.
I've attached a screen shot form  Wireshark and CMD.
Please help.

UV
WinShark_ScreenShot.PNG
<http://lwip.100.n7.nabble.com/file/n21717/WinShark_ScreenShot.PNG>
CMD_ScreenShot.PNG
<http://lwip.100.n7.nabble.com/file/n21717/CMD_ScreenShot.PNG>  



--
View this message in context: http://lwip.100.n7.nabble.com/No-Ping-Response-tp21717.html
Sent from the lwip-users mailing list archive at Nabble.com.

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

 
 
************************************************************************************
This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************




 
 
************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************




_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
UV
Reply | Threaded
Open this post in threaded view
|

Re: No Ping Response

UV
In reply to this post by Noam weissman
Thanks Noam, that solved the problem.
Reply | Threaded
Open this post in threaded view
|

Re: No Ping Response

kerem
In reply to this post by UV
Hello,

The reasons is your previous working version of icmp.c has been modified by ST. So to make the ping work in your new version:

1) modify lwipopts.h

#ifdef CHECKSUM_BY_HARDWARE
  /* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/
  #define CHECKSUM_GEN_IP                 0
  /* CHECKSUM_GEN_UDP==0: Generate checksums by hardware for outgoing UDP packets.*/
  #define CHECKSUM_GEN_UDP                0
  /* CHECKSUM_GEN_TCP==0: Generate checksums by hardware for outgoing TCP packets.*/
  #define CHECKSUM_GEN_TCP                0
  /* CHECKSUM_CHECK_IP==0: Check checksums by hardware for incoming IP packets.*/
  #define CHECKSUM_CHECK_IP               0
  /* CHECKSUM_CHECK_UDP==0: Check checksums by hardware for incoming UDP packets.*/
  #define CHECKSUM_CHECK_UDP              0
  /* CHECKSUM_CHECK_TCP==0: Check checksums by hardware for incoming TCP packets.*/
  #define CHECKSUM_CHECK_TCP              0
  /* CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets.*/
  #define CHECKSUM_GEN_ICMP               0
#else
  /* CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.*/
  #define CHECKSUM_GEN_IP                 1
  /* CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.*/
  #define CHECKSUM_GEN_UDP                1
  /* CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.*/
  #define CHECKSUM_GEN_TCP                1
  /* CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.*/
  #define CHECKSUM_CHECK_IP               1
  /* CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.*/
  #define CHECKSUM_CHECK_UDP              1
  /* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/
  #define CHECKSUM_CHECK_TCP              1
  /* CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets.*/
  #define CHECKSUM_GEN_ICMP               1
#endif

2) arrange icmp.c "icmp_input" function (somewhere around line 190)

#if CHECKSUM_GEN_ICMP
    /* adjust the checksum */
    if (iecho->chksum >= PP_HTONS(0xffffU - (ICMP_ECHO << 8))) {
      iecho->chksum += PP_HTONS(ICMP_ECHO << 8) + 1;
    } else {
      iecho->chksum += PP_HTONS(ICMP_ECHO << 8);
    }
#else /* CHECKSUM_GEN_ICMP */
    iecho->chksum = 0;
#endif /* CHECKSUM_GEN_ICMP */


Kerem