[U-Boot] [PATCH v2 2/6] NET: pass source IP address to packet handlers

Luca Ceresoli
2011-04-19T15:26:36Z

Il 19/04/2011 16:15, Detlev Zundel ha scritto:
> Hi Luca,
>
>> This is needed for the upcoming TFTP server implementation.
>>
>> This also simplifies PingHandler() and fixes rxhand_f documentation.
>>
>> Signed-off-by: Luca Ceresoli<luca.ceresoli@comelit.it>
>> Cc: Wolfgang Denk<wd@denx.de>
>> ---
>> Changes in v2:
>> - fixed checkpatch issues.
>>
>> drivers/net/netconsole.c | 5 +++--
>> include/net.h | 15 ++++++++++-----
>> net/bootp.c | 9 ++++++---
>> net/dns.c | 2 +-
>> net/net.c | 30 +++++++++++++++++-------------
>> net/nfs.c | 2 +-
>> net/rarp.c | 3 ++-
>> net/sntp.c | 3 ++-
>> net/tftp.c | 3 ++-
>> 9 files changed, 44 insertions(+), 28 deletions(-)
>>
> [...]
>
>> diff --git a/net/net.c b/net/net.c
>> index a609632..132f99b 100644
>> --- a/net/net.c
>> +++ b/net/net.c
> [...]
>
>> @@ -1596,11 +1598,12 @@ NetReceive(volatile uchar * inpkt, int len)
>> * IP header OK. Pass the packet to the current handler.
>> */
>> /* XXX point to ip packet */
>> - (*packetHandler)((uchar *)ip, 0, 0, 0);
>> + (*packetHandler)((uchar *)ip, 0, src_ip, 0, 0);
>> return;
>> case ICMP_ECHO_REQUEST:
>> - debug("Got ICMP ECHO REQUEST, return %d bytes \n",
>> - ETHER_HDR_SIZE + len);
>> + debug("Got ICMP ECHO REQUEST, "
>> + "return %d bytes\n",
>> + ETHER_HDR_SIZE + len);
>>
>> memcpy (&et->et_dest[0],&et->et_src[0], 6);
>> memcpy (&et->et_src[ 0], NetOurEther, 6);
> This second hunk is not related to the patch at hand, so strictly
> speaking it should not be in here. It's not enough to NAK the patch
> however, just something to look out for in the future.

Yep, but it's needed for checkpatch compliance.

Luca