Kernel version 0.9 : Bug Fix in ICMP/PING

This commit is contained in:
Rémy GIBERT 2017-01-31 23:13:26 +01:00
parent bf8ce243c5
commit ec385bd23f
6 changed files with 28 additions and 24 deletions

Binary file not shown.

Binary file not shown.

View File

@ -128,11 +128,11 @@ CS.RUN.OPENSKT ldx #3
ldy #Identifier
lda A2OSX.RANDOM16
sta Socket.Src.Port
sta Socket.Dst.Port
sta (pData),y
iny
lda A2OSX.RANDOM16+1
sta Socket.Src.Port+1
sta Socket.Dst.Port+1
sta (pData),y
lda #0
@ -277,13 +277,11 @@ CS.Print.REPLY lda #TIMEOUT.MAX
rts
*--------------------------------------
CS.QUIT ldy #hSocket
>DEBUG
lda (pData),y
beq .1
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.CLOSEA
* >LIBCALL hLIBTCPIP,LIBTCPIP.SKT.CLOSEA
.1 lda hLIBTCPIP
lda hLIBTCPIP
>SYSCALL UnloadLibA
clc
rts
@ -316,9 +314,9 @@ Socket .DA #S.SOCKET.SOCK.RAW
.BS 2
.DA #S.IP.PROTOCOL.ICMP
Socket.Src.Addr .BS 4
Socket.Src.Port .BS 2 Identifier
Socket.Src.Port .DA 0 Dynamic
Socket.Dst.Addr .BS 4
Socket.Dst.Port .DA 0 not used
Socket.Dst.Port .DA 0 Identifier
.BS 16
*--------------------------------------
ICMP.Request .DA #S.ICMP.TYPE.ECHOREQ

View File

@ -79,10 +79,10 @@ ICMP.IN.ECHOREP jsr IP.FillTmpSocketSrcDst
ldy #S.ICMP.IDENTIFIER
lda (ZPFrameInPtr),y
sta TmpSocket+S.SOCKET.SRC.PORT+1
sta TmpSocket+S.SOCKET.DST.PORT+1
iny
lda (ZPFrameInPtr),y
sta TmpSocket+S.SOCKET.SRC.PORT
sta TmpSocket+S.SOCKET.DST.PORT
>LDYA L.SKT.TABLE
>STYA ZPPtrSKT

View File

@ -170,23 +170,26 @@ SKT.SEND.TCP
*--------------------------------------
SKT.SEND.RAW ldy #S.SOCKET.RAW.PROTO
lda (ZPPtrSKT),y
cmp #S.IP.PROTOCOL.ICMP
bne .9
jsr FRM.NewA
bcs .9
>LDAXI S.ICMP-2
>LDAXI S.IP-2
jsr SKT.SetFrameOutLenAX
>LDAXI S.ICMP
>LDAXI S.IP
jsr SKT.SetDataOutPtrAX
jsr SKT.SetFrameOutDstIP
jsr SKT.CopyDataInToOut
jmp FRM.SendIP
ldy #S.SOCKET.RAW.PROTO
lda (ZPPtrSKT),y
cmp #S.IP.PROTOCOL.ICMP
bne .1
jmp FRM.SendICMP
.1 jmp FRM.SendIP
.9 sec
rts
@ -221,7 +224,10 @@ SKT.RCVDA jsr SKT.GetA.I
.99 sec
.9 rts
*--------------------------------------
SKT.CLOSEA jsr SKT.GetA
SKT.CLOSEA cmp #K.SKTTABLE.SIZE
bcs SKT.GetA.9
jsr SKT.GetA.I
bcs .9
cmp #S.SOCKET.SOCK.DGRAM
@ -242,10 +248,6 @@ SKT.CLOSEA jsr SKT.GetA
clc
.9 rts
*--------------------------------------
SKT.GETTABLE >LDYA L.SKT.TABLE
clc
rts
*--------------------------------------
SKT.GetA cmp #K.SKTTABLE.SIZE
bcs SKT.GetA.9
jsr SKT.GetA.I
@ -310,6 +312,10 @@ SKT.AddToQueueA sta .2+1
.9 sec
rts
*--------------------------------------
SKT.GETTABLE >LDYA L.SKT.TABLE
clc
rts
*--------------------------------------
SKT.AddToQueueS
clc
rts

View File

@ -241,10 +241,10 @@ CS.DOEVENT lda (pEvent)
*--------------------------------------
CS.QUIT ldy #hSocket
lda (pData),y
beq .1
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.CLOSEA
.1 lda hLIBTCPIP
lda hLIBTCPIP
>SYSCALL UnloadLibA
clc
rts