r10174: fix dotted-to-ipaddr
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 28 Nov 2004 20:15:20 +0000 (20:15 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 28 Nov 2004 20:15:20 +0000 (20:15 +0000)
sockets.lisp

index f105501777be5e122c3cdf012c5c44ff6ca0b1e9..cbadc07c608c70f377e1b28cddeab97552e5b72e 100644 (file)
@@ -133,12 +133,16 @@ setsockopt SO_REUSEADDR if :reuse is not nil"
   (declare (string dotted))
   (if errorp
       (let ((ll (delimited-string-to-list dotted #\.)))
-       (+ (ash (first ll) 24) (ash (second ll) 16)
-          (ash (third ll) 8) (fourth ll)))
+       (+ (ash (parse-integer (first ll)) 24) 
+          (ash (parse-integer (second ll)) 16)
+          (ash (parse-integer (third ll)) 8) 
+          (parse-integer (fourth ll))))
     (ignore-errors
       (let ((ll (delimited-string-to-list dotted #\.)))
-       (+ (ash (first ll) 24) (ash (second ll) 16)
-          (ash (third ll) 8) (fourth ll))))))
+       (+ (ash (parse-integer (first ll)) 24)
+          (ash (parse-integer (second ll)) 16)
+          (ash (parse-integer (third ll)) 8) 
+          (parse-integer (fourth ll)))))))
 
 #+sbcl
 (defun ipaddr-to-hostname (ipaddr &key ignore-cache)