[U-Boot] [PATCH] bootp: Prevent u-boot from using others bootp responses.

From d53ea5847b92e31563c58804c189afc0fe4773f5 Mon Sep 17 00:00:00 2001
From: Anton Persson don.juanton@gmail.com Date: Thu, 17 Mar 2016 09:38:21 +0100 Subject: [PATCH] bootp: Prevent u-boot from using others responses.
In rare circumstances two dhcp clients may generate the same bootp ID. If this happens it is vital that the client also checks the hw address in the received response to prevent IP address conflicts.
Signed-off-by: Anton Persson don.juanton@gmail.com --- net/bootp.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/net/bootp.c b/net/bootp.c index aefc808..d7852db 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -132,6 +132,8 @@ static int check_reply_packet(uchar *pkt, unsigned dest, unsigned src, retval = -5; else if (!bootp_match_id(net_read_u32(&bp->bp_id))) retval = -6; + else if (memcmp(bp->bp_chaddr, net_ethaddr, HWL_ETHER) != 0) + retval = -7;
debug("Filtering pkt = %d\n", retval);

On Thu, Mar 17, 2016 at 03:14:08PM +0100, Anton Persson wrote:
From d53ea5847b92e31563c58804c189afc0fe4773f5 Mon Sep 17 00:00:00 2001
From: Anton Persson don.juanton@gmail.com Date: Thu, 17 Mar 2016 09:38:21 +0100 Subject: [PATCH] bootp: Prevent u-boot from using others responses.
In rare circumstances two dhcp clients may generate the same bootp ID. If this happens it is vital that the client also checks the hw address in the received response to prevent IP address conflicts.
Signed-off-by: Anton Persson don.juanton@gmail.com
Applied to u-boot/master (and git was smart enough to fixup this log on its own), thanks!

On Thu, Mar 17, 2016 at 03:14:08PM +0100, Anton Persson wrote:
From d53ea5847b92e31563c58804c189afc0fe4773f5 Mon Sep 17 00:00:00 2001
From: Anton Persson don.juanton@gmail.com Date: Thu, 17 Mar 2016 09:38:21 +0100 Subject: [PATCH] bootp: Prevent u-boot from using others responses.
In rare circumstances two dhcp clients may generate the same bootp ID. If this happens it is vital that the client also checks the hw address in the received response to prevent IP address conflicts.
Signed-off-by: Anton Persson don.juanton@gmail.com
Applied to u-boot/master, thanks!
participants (2)
-
Anton Persson
-
Tom Rini