summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAnton Persson <don.juanton@gmail.com>2016-03-17 09:38:21 +0100
committerTom Rini <trini@konsulko.com>2016-03-27 09:12:21 -0400
commit214cc905defa58b2beb57033ebc6e66a2a90d769 (patch)
tree04c3b7f96d7dd02e362cd784adb22e46212ae897 /net
parenta481a15600ac607d2266a88c92ff571c9c573041 (diff)
downloadu-boot-214cc905defa58b2beb57033ebc6e66a2a90d769.tar.gz
u-boot-214cc905defa58b2beb57033ebc6e66a2a90d769.tar.xz
u-boot-214cc905defa58b2beb57033ebc6e66a2a90d769.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/bootp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bootp.c b/net/bootp.c
index aefc808391..d7852dbb44 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);