diff mbox series

net: ipv6: Add missing break into IPv6 protocol handler

Message ID 20221206070816.2453839-1-v.v.mitrofanov@yadro.com
State Accepted
Delegated to: Tom Rini
Headers show
Series net: ipv6: Add missing break into IPv6 protocol handler | expand

Commit Message

Vyacheslav V. Mitrofanov Dec. 6, 2022, 7:08 a.m. UTC
IPv6 protocol handler is not terminated with a break statment.
It can lead to running unexpected code.

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
---
 net/net.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Schwierzeck Dec. 6, 2022, 12:21 p.m. UTC | #1
On 12/6/22 08:08, Viacheslav Mitrofanov wrote:
> IPv6 protocol handler is not terminated with a break statment.
> It can lead to running unexpected code.
> 
> Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
> ---
>   net/net.c | 1 +
>   1 file changed, 1 insertion(+)
> 

thanks for the quick fix

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

> diff --git a/net/net.c b/net/net.c
> index 1c39acc493..57da9bda85 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -1269,6 +1269,7 @@ void net_process_received_packet(uchar *in_packet, int len)
>   #if IS_ENABLED(CONFIG_IPV6)
>   	case PROT_IP6:
>   		net_ip6_handler(et, (struct ip6_hdr *)ip, len);
> +		break;
>   #endif
>   	case PROT_IP:
>   		debug_cond(DEBUG_NET_PKT, "Got IP\n");
Tom Rini Dec. 23, 2022, 3 p.m. UTC | #2
On Tue, Dec 06, 2022 at 10:08:16AM +0300, Viacheslav Mitrofanov wrote:

> IPv6 protocol handler is not terminated with a break statment.
> It can lead to running unexpected code.
> 
> Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/net/net.c b/net/net.c
index 1c39acc493..57da9bda85 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1269,6 +1269,7 @@  void net_process_received_packet(uchar *in_packet, int len)
 #if IS_ENABLED(CONFIG_IPV6)
 	case PROT_IP6:
 		net_ip6_handler(et, (struct ip6_hdr *)ip, len);
+		break;
 #endif
 	case PROT_IP:
 		debug_cond(DEBUG_NET_PKT, "Got IP\n");