From f331f3f43fcefb2d20fc328cbae48180c75e606c Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Mon, 15 May 2017 21:20:51 +0200 Subject: [PATCH] Fixed ARP setup. In general I consider the approach of a netmask length a typical case of over-optimzation - incl. the typical downside of an "unnecessary" bug. However as the optimization is already present I opted to not remove it but rather fix the bug: So far the gateway was in usual environments only used if the target IP address differed already in the first byte from the local net IP addresses. Now the gateway is used correctly - even for i.e. the address 192.168.1.1 from the local net 192.168.0.x --- ip65/arp.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ip65/arp.s b/ip65/arp.s index 23b4121..c75c01c 100644 --- a/ip65/arp.s +++ b/ip65/arp.s @@ -68,7 +68,7 @@ ap_packlen = 42 ; total length of packet ; gateway handling gw_mask: .res 4 ; inverted netmask -gw_test: .res 4 ; gateway ip or:d with inverted netmask +gw_test: .res 4 ; gateway ip or'd with inverted netmask gw_last: .res 1 ; netmask length - 1 ; timeout @@ -97,7 +97,7 @@ arp_calculate_gateway_mask: lda cfg_netmask,x eor #$ff cmp #$ff - bne :+ + beq :+ inc gw_last : sta gw_mask,x ora cfg_gateway,x