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
This commit is contained in:
Oliver Schmidt 2017-05-15 21:20:51 +02:00
parent 3193774a31
commit 1a5bd8c7e5

View File

@ -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