j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: wmb Date: 2007-11-08 00:57:36 +0100 (Thu, 08 Nov 2007) New Revision: 722
Modified: ofw/inet/dns.fth Log: Handle DNS hostnames beginning with digits. This is useful for pools of NTP servers like 0.pool.ntp.org .
Modified: ofw/inet/dns.fth =================================================================== --- ofw/inet/dns.fth 2007-11-07 23:55:19 UTC (rev 721) +++ ofw/inet/dns.fth 2007-11-07 23:57:36 UTC (rev 722) @@ -199,7 +199,7 @@ 1 and throw ( ) get-host-addr ( answer-ip ) ; -: (resolve) ( hostname$ -- ) +: (resolve) ( hostname$ -- 'ip ) bootnet-debug if ( hostname$ ) ." Using DNS to find the IP address of " ( hostname$ ) 2dup type cr ( hostname$ ) @@ -245,7 +245,11 @@ headers : $set-host ( hostname$ -- ) dup 0= ?bad-ip - over c@ [char] 0 [char] 9 between if $>ip else (resolve) then + 2dup ['] $>ip catch if ( hostname$ x x ) + 2drop (resolve) + else ( hostname$ 'ip ) + nip nip ( 'ip ) + then set-dest-ip ; \ LICENSE_BEGIN