lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Suggestion re ARP


From: Leon Woestenberg
Subject: Re: [lwip-devel] Suggestion re ARP
Date: Wed, 28 Apr 2004 22:17:08 +0200
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)

Hello,

Leon Woestenberg wrote:
Another, similar, but orthogonal implementation choice by me
was this:

etharp_ip_input() will also ask the ARP module to add a new entry
to the table whenever an IP packet from the local network is directed to us.

I now see that this case is also handled by the ARP RFC, as the algorithm
below is protocol agnostic and also goes for the IP case.

I think I do the correct thing(tm) in etharp, although the decision called "?Am I the target protocol address?" is a bit ambiguous as to whether this is true for multicast / broadcast IP addresses.

I will remove the ETHARP_ALWAYS_INSERT option.

Regards,

Leon.

-----------------------------------------
?Do I have the hardware type in ar$hrd?
Yes: (almost definitely)
  [optionally check the hardware length ar$hln]
  ?Do I speak the protocol in ar$pro?
  Yes:
    [optionally check the protocol length ar$pln]
    Merge_flag := false
    If the pair <protocol type, sender protocol address> is
        already in my translation table, update the sender
        hardware address field of the entry with the new
        information in the packet and set Merge_flag to true.
    ?Am I the target protocol address?
    Yes:
      If Merge_flag is false, add the triplet <protocol type,
          sender protocol address, sender hardware address> to
          the translation table.
      ?Is the opcode ares_op$REQUEST?  (NOW look at the opcode!!)
      Yes:
        Swap hardware and protocol fields, putting the local
            hardware and protocol addresses in the sender fields.
        Set the ar$op field to ares_op$REPLY
        Send the packet to the (new) target hardware address on
            the same hardware on which the request was received.
------------------------------------------




reply via email to

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