From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luca Ceresoli Date: Tue, 19 Apr 2011 17:26:36 +0200 Subject: [U-Boot] [PATCH v2 2/6] NET: pass source IP address to packet handlers In-Reply-To: References: <1302796377-3321-1-git-send-email-luca.ceresoli@comelit.it> <1303143594-5345-3-git-send-email-luca.ceresoli@comelit.it> Message-ID: <4DADA9AC.2060302@comelit.it> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >> Cc: Wolfgang Denk >> --- >> 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