[openfirmware] r1173 - in ofw: inet inetv6

svn at openfirmware.info svn at openfirmware.info
Wed May 6 09:08:33 CEST 2009


Author: wmb
Date: 2009-05-06 09:08:33 +0200 (Wed, 06 May 2009)
New Revision: 1173

Modified:
   ofw/inet/tcp.fth
   ofw/inetv6/tcp.fth
   ofw/inetv6/tcpv6.fth
Log:
TCP - bump the local port number on each open.  Tip 'o the Hat to Luke Gorrie.




Modified: ofw/inet/tcp.fth
===================================================================
--- ofw/inet/tcp.fth	2009-05-04 17:05:54 UTC (rev 1172)
+++ ofw/inet/tcp.fth	2009-05-06 07:08:33 UTC (rev 1173)
@@ -231,6 +231,14 @@
    then
 ;
 
+h# 555 value next-tcp-local-port
+
+: alloc-next-tcp-local-port  ( -- port )
+   next-tcp-local-port 1+                ( port )
+   h# ffff and  h# 555 max               ( port )
+   dup to next-tcp-local-port            ( port )
+;
+
 \ send sequence variables
 0 instance value snd_una		\ send unacknowledged
 0 instance value snd_nxt		\ send next
@@ -2339,7 +2347,7 @@
 
    ['] protocol-tick  d# 500  alarm
 
-   h# 555 to my-tcp-port  \ XXX
+   alloc-next-tcp-local-port to my-tcp-port
    true to alive?
 
    true

Modified: ofw/inetv6/tcp.fth
===================================================================
--- ofw/inetv6/tcp.fth	2009-05-04 17:05:54 UTC (rev 1172)
+++ ofw/inetv6/tcp.fth	2009-05-06 07:08:33 UTC (rev 1173)
@@ -231,6 +231,14 @@
    then
 ;
 
+h# 555 value next-tcp-local-port
+
+: alloc-next-tcp-local-port  ( -- port )
+   next-tcp-local-port 1+                ( port )
+   h# ffff and  h# 555 max               ( port )
+   dup to next-tcp-local-port            ( port )
+;
+
 \ send sequence variables
 0 instance value snd_una		\ send unacknowledged
 0 instance value snd_nxt		\ send next
@@ -2337,7 +2345,7 @@
 
    ['] protocol-tick  d# 500  alarm
 
-   h# 555 to my-tcp-port  \ XXX
+   alloc-next-tcp-local-port to my-tcp-port
    true to alive?
 
    true

Modified: ofw/inetv6/tcpv6.fth
===================================================================
--- ofw/inetv6/tcpv6.fth	2009-05-04 17:05:54 UTC (rev 1172)
+++ ofw/inetv6/tcpv6.fth	2009-05-06 07:08:33 UTC (rev 1173)
@@ -248,6 +248,14 @@
 ;
 
 [ifndef] include-ipv4
+h# 555 value next-tcp-local-port
+
+: alloc-next-tcp-local-port  ( -- port )
+   next-tcp-local-port 1+                ( port )
+   h# ffff and  h# 555 max               ( port )
+   dup to next-tcp-local-port            ( port )
+;
+
 \ send sequence variables
 0 instance value snd_una		\ send unacknowledged
 0 instance value snd_nxt		\ send next
@@ -2442,7 +2450,7 @@
 
    ['] protocol-tick  d# 500  alarm
 
-   h# 555 to my-tcp-port  \ XXX
+   alloc-next-tcp-local-port to my-tcp-port
    true to alive?
 
    true




More information about the openfirmware mailing list