lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] No Ping Response


From: seba . segura
Subject: Re: [lwip-users] No Ping Response
Date: Wed, 10 Jul 2013 13:36:19 +0200 (CEST)

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" <address@hidden>
À: "Mailing list for lwIP users" <address@hidden>
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: address@hidden [mailto:address@hidden On Behalf Of UV
Sent: ד 10 יולי 2013 09:53
To: address@hidden
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
address@hidden
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
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]