[movitz-cvs] CVS update: movitz/losp/lib/net/ip4.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Wed Nov 24 13:12:27 UTC 2004


Update of /project/movitz/cvsroot/movitz/losp/lib/net
In directory common-lisp.net:/tmp/cvs-serv15051

Modified Files:
	ip4.lisp 
Log Message:
Ensure zero-padding for UDP checksum.

Date: Wed Nov 24 14:12:27 2004
Author: ffjeld

Index: movitz/losp/lib/net/ip4.lisp
diff -u movitz/losp/lib/net/ip4.lisp:1.9 movitz/losp/lib/net/ip4.lisp:1.10
--- movitz/losp/lib/net/ip4.lisp:1.9	Wed Nov 24 11:06:25 2004
+++ movitz/losp/lib/net/ip4.lisp	Wed Nov 24 14:12:26 2004
@@ -10,7 +10,7 @@
 ;;;; Author:        Frode Vatvedt Fjeld <frodef at acm.org>
 ;;;; Created at:    Wed Apr 30 13:52:57 2003
 ;;;;                
-;;;; $Id: ip4.lisp,v 1.9 2004/11/24 10:06:25 ffjeld Exp $
+;;;; $Id: ip4.lisp,v 1.10 2004/11/24 13:12:26 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -342,6 +342,8 @@
       (setf (ip4-ref packet start 6 :unsigned-byte16) checksum))
      ((eq t checksum)
       (setf (ip4-ref packet start 6 :unsigned-byte16) 0)
+      (when (oddp udp-length)		; Ensure zero-padding for checksum.
+	(setf (ip4-ref packet start udp-length :unsigned-byte8) 0))
       (setf (ip4-ref packet start 6 :unsigned-byte16)
 	(logxor #xffff
 		(add-u16-ones-complement (checksum-octets source)
@@ -472,7 +474,7 @@
   (unless *ip4-nic*
     (let ((ethernet
 	   (some #'muerte.x86-pc.ne2k:ne2k-probe
-		 muerte.x86-pc.ne2k:+ne2k-probe-addresses+)))
+		 muerte.x86-pc.ne2k:*ne2k-probe-addresses*)))
       (assert ethernet ethernet "No ethernet device.")
       (setf *ip4-nic* ethernet)))
   (unless *ip4-ip*





More information about the Movitz-cvs mailing list