lwip-devel
[Top][All Lists]
Advanced

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

RE : RE : [lwip-devel] [bug #19206] the ARP layer isnotprotectedagainstc


From: Frédéric BERNON
Subject: RE : RE : [lwip-devel] [bug #19206] the ARP layer isnotprotectedagainstconcurrent access
Date: Mon, 5 Mar 2007 23:00:45 +0100

Patch with last fix. Always a solution to find for :

etharp_arp_input(netif, (struct eth_addr*)(netif->hwaddr), p); //FB Not really 
nice, but internal driver state in "unknown" in tcpip.c 
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : Frédéric BERNON 
Envoyé : lundi 5 mars 2007 22:54
À : 'lwip-devel'
Objet : RE : RE : [lwip-devel] [bug #19206] the ARP layer 
isnotprotectedagainstconcurrent access


A little bug in the patch, because, in tcpip.c, we don't really have access to 
driver's ethaddr field. I try to cast it, but I only create a bug. I will 
provide tomorrow a better fix. But, If you have any idea.....

#if ETHARP_TCPIP_ETHINPUT
static void
ethernet_input(struct pbuf *p, struct netif *netif)
{
  struct ethernetif* ethernetif;
  struct eth_hdr*    ethhdr;

  ethernetif = netif->state;
 
  /* points to packet payload, which starts with an Ethernet header */
  ethhdr = p->payload;

#if LINK_STATS
  lwip_stats.link.recv++;
#endif /* LINK_STATS */
    
  switch (htons(ethhdr->type)) {
    /* IP packet? */
    case ETHTYPE_IP:
      #if ETHARP_TRUST_IP_MAC
      /* update ARP table */
      etharp_ip_input( netif, p);
      #endif
      /* skip Ethernet header */
      pbuf_header(p, -sizeof(struct eth_hdr));
      /* pass to IP layer */
      ip_input(p, netif);
      break;
      
    case ETHTYPE_ARP:
      /* pass p to ARP module  */
      //FB !!!!!! etharp_arp_input(netif, ((struct eth_addr *)(ethernetif)), 
p); //FB !! I was crazy !!!
      etharp_arp_input(netif, (struct eth_addr*)(netif->hwaddr), p); //FB Not 
really nice, but internal driver state in "unknown" in tcpip.c
      break;
      break;

    default: /* Not really necessary, but...*/
      pbuf_free(p);
      p = NULL;
      break;
  }
}
#endif /* ETHARP_TCPIP_ETHINPUT */

 
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Frédéric BERNON Envoyé 
: lundi 5 mars 2007 21:49 À : lwip-devel Objet : RE : [lwip-devel] [bug #19206] 
the ARP layer isnotprotectedagainstconcurrent access


First draft patch. Any comments?
 
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : Frédéric BERNON 
Envoyé : lundi 5 mars 2007 16:25
À : 'Kieran Mansley'
Cc : 'Simon Goldschmidt'; Frédéric BERNON
Objet : RE : RE : [lwip-devel] [bug #19206] the ARP layer is 
notprotectedagainstconcurrent access


It will increase the footprint, but ok, I do it like this... 
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : Kieran Mansley [mailto:address@hidden 
Envoyé : lundi 5 mars 2007 16:22
À : Frédéric BERNON
Cc : Simon Goldschmidt
Objet : Re: RE : [lwip-devel] [bug #19206] the ARP layer is 
notprotectedagainstconcurrent access


On Mon, 2007-03-05 at 16:19 +0100, Frédéric BERNON wrote:
> (I write you directly because my email change (address@hidden ->
> address@hidden) isn't updated on Savannah servers...)
> 
> Perhaps do you prefer I set the TCPIP_PACKET_INPUT to 0 as default
> value? With that, old drivers won't have to change their behavior, but 
> they still have this problem with ARP (and I don't think it's a good 
> thing)... It seems better than add a new message, which finally do the 
> same thing : send "packets" from driver to tcpip_thread...

I'm not sure what TCPIP_PACKET_INPUT refers to - I've lost the beginning of the 
discussion, but I'd like to see the problem fixed by default, even if that 
means existing drivers will need updating.

> Tell me if you prefer that solution (TCPIP_PACKET_INPUT to 0 as
> default value), or if you prefer TCPIP_MSG_ETHINPUT. If you choose 
> last, do you want an exclusive feature - at build time - between 
> TCPIP_MSG_ETHINPUT and TCPIP_MSG_INPUT?

I don't think we need to have a compile time switch - I can see that a driver 
may wish to use both.

Kieran

Attachment: Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf

Attachment: arp.patch
Description: arp.patch


reply via email to

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