An: Jelena Frtunik <address@hidden>; Mailing list for lwIP users <address@hidden>
Gesendet: 11:02 Freitag, 14.September 2012
Betreff: Re: [lwip-users] Help- TCP connection does not work after a some number of packets are received
> [..]
> static void ethernetif_input( void * pvParameters )
> {
> [..]
> switch (htons(ethhdr->type))
> {
> /* IP packet? */
> case 256:
> case ETHTYPE_IP:
> /* full packet send to tcpip_thread
> to process */
> if (s_pxNetIf->input(p, s_pxNetIf) != ERR_OK)
>
{
> LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
> pbuf_free(p);
> p = NULL;
> }
> break;
>
> case ETHTYPE_ARP:
> /* pass p to ARP module */
> ethernet_input(p, s_pxNetIf);
This is wrong and you'll get threading problems. Instead, call "s_pxNetIf->input()" for ARP, too, so that ARP packets are processed in tcpip_thread, too, not in interrupt context. For this to work, you'll have to set the ethernet flag in netif->flags and make sure to pass the correct input function netif_add() (for NO_SYS==1, this would be 'ethernet_input', for NO_SYS==0, this would be 'tcpip_input'). See the skeleton ethernetif.c.
Simon
_______________________________________________
lwip-users mailing list
address@hiddenhttps://lists.nongnu.org/mailman/listinfo/lwip-users