From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Tue, 19 Apr 2011 16:15:13 +0200 Subject: [U-Boot] [PATCH v2 2/6] NET: pass source IP address to packet handlers In-Reply-To: <1303143594-5345-3-git-send-email-luca.ceresoli@comelit.it> (Luca Ceresoli's message of "Mon, 18 Apr 2011 18:19:50 +0200") References: <1302796377-3321-1-git-send-email-luca.ceresoli@comelit.it> <1303143594-5345-3-git-send-email-luca.ceresoli@comelit.it> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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. Apart from that the changes look good, so Acked-by: Detlev Zundel -- LISP has jokingly been described as "the most intelligent way to misuse a computer". I think that description a great compliment because it transmits the full flavour of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts. - Edsger W. Dijkstra -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de