From 89475b3598f5a632f5ee100c2107e93e53e758b9 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Mon, 30 May 2022 18:19:54 +0200
Subject: [PATCH] Follow-up fix for recent contribution.
Set the new IP address only on success.
---
ip65/dhcp.s | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ip65/dhcp.s b/ip65/dhcp.s
index 327b567..4283dd6 100644
--- a/ip65/dhcp.s
+++ b/ip65/dhcp.s
@@ -450,11 +450,11 @@ send_dhcprequest:
ldax #output_buffer
jsr udp_send
- bcs :+ ; if we didn't send the message we probably need to wait for an ARP reply to come back.
+ bcs :++ ; if we didn't send the message we probably need to wait for an ARP reply to come back.
+
lda #dhcp_bound ; technically, we should wait till we get a DHCPACK message. but we'll assume success
sta dhcp_state
-
-: ldx #3 ; set the new IP address
+ ldx #3 ; set the new IP address
: lda dhcp_ip,x
sta cfg_ip,x
dex