public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Strange code in NetReceive(..) in net.c
@ 2005-05-02 19:47 Reinhard Arlt
  2005-05-02 20:44 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Reinhard Arlt @ 2005-05-02 19:47 UTC (permalink / raw)
  To: u-boot

Hallo,

if you look at the code for ICMP handling in NetReceive, you will see that:

-- For an ICMP_REDIR_HOST packet, the nc_input_packet code and then the 
(*packetHandler) is called.

-- For an ICMP_ECHO_REPLY, the (*packetHandler) is called twice.

Is this is not intended, i can prepare a patch.

A "return" before the "break" in the ICMP_PROTO path and an "return" 
before the "break" in the ICMP_ECHO_REPLY path will do it.

Else the comment after  "(ip_>ip_p != IPPROTO_UDP)" should be corrected.

Reinhard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] Strange code in NetReceive(..) in net.c
  2005-05-02 19:47 [U-Boot-Users] Strange code in NetReceive(..) in net.c Reinhard Arlt
@ 2005-05-02 20:44 ` Wolfgang Denk
  2005-05-09  8:12   ` Reinhard Arlt
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2005-05-02 20:44 UTC (permalink / raw)
  To: u-boot

In message <427683E5.5050608@t-online.de> you wrote:
> 
> if you look at the code for ICMP handling in NetReceive, you will see that:

Which version of the code are you talking about?

> -- For an ICMP_REDIR_HOST packet, the nc_input_packet code and then the 
> (*packetHandler) is called.
> 
> -- For an ICMP_ECHO_REPLY, the (*packetHandler) is called twice.
> 
> Is this is not intended, i can prepare a patch.

We should probably have "return"s in both "case"s. Lokking forward to
see your patch.

> A "return" before the "break" in the ICMP_PROTO path and an "return" 
> before the "break" in the ICMP_ECHO_REPLY path will do it.

Agreed.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
No one can guarantee the actions of another.
	-- Spock, "Day of the Dove", stardate unknown

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] Strange code in NetReceive(..) in net.c
  2005-05-02 20:44 ` Wolfgang Denk
@ 2005-05-09  8:12   ` Reinhard Arlt
  0 siblings, 0 replies; 3+ messages in thread
From: Reinhard Arlt @ 2005-05-09  8:12 UTC (permalink / raw)
  To: u-boot

Hello,

here is the patch for the two missing statements.

Reinhard

Wolfgang Denk wrote:
> In message <427683E5.5050608@t-online.de> you wrote:
> 
>>if you look at the code for ICMP handling in NetReceive, you will see that:
> 
> 
> Which version of the code are you talking about?

1.1.2
> 
> 
>>-- For an ICMP_REDIR_HOST packet, the nc_input_packet code and then the 
>>(*packetHandler) is called.
>>
>>-- For an ICMP_ECHO_REPLY, the (*packetHandler) is called twice.
>>
>>Is this is not intended, i can prepare a patch.
> 
> 
> We should probably have "return"s in both "case"s. Lokking forward to
> see your patch.
> 
> 
>>A "return" before the "break" in the ICMP_PROTO path and an "return" 
>>before the "break" in the ICMP_ECHO_REPLY path will do it.
> 
> 
> Agreed.
> 
> Best regards,
> 
> Wolfgang Denk
> 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Changelog
Url: http://lists.denx.de/pipermail/u-boot/attachments/20050509/ac73d6e7/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: net_missing_return_patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20050509/ac73d6e7/attachment-0001.txt 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-09  8:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-02 19:47 [U-Boot-Users] Strange code in NetReceive(..) in net.c Reinhard Arlt
2005-05-02 20:44 ` Wolfgang Denk
2005-05-09  8:12   ` Reinhard Arlt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox