anchor.diff:    `(mezzano.supervisor:with-mutex ((tcp-connection-lock ,connection))
        ,@body))
   
  +(defun get-tcp-listener (local-ip local-port)
  +  (mezzano.supervisor:with-mutex (*tcp-listener-lock*)
  +    (dolist (listener *tcp-listeners*)
  +      (when (and (or (mezzano.network.ip:address-equal
  +                      (tcp-listener-local-ip listener) local-ip)
  +                     (mezzano.network.ip:address-equal
  +                      (mezzano.network.ip:make-ipv4-address "0.0.0.0")
  +                      (tcp-listener-local-ip listener)))
  +                 (eql (tcp-listener-local-port listener) local-port))
  +        (return listener)))))
  +
   (defun get-tcp-connection (remote-ip remote-port local-ip local-port)
     (mezzano.supervisor:with-mutex (*tcp-connection-lock*)
       (dolist (connection *tcp-connections*)
  
positive.code:            (header-length (* (ldb (byte 4 12) flags-and-data-offset) 4))
             (data-length (- end (+ start header-length))))
        (case (tcp-connection-state connection)
          (:syn-sent
           (cond ((and (logtest flags +tcp4-flag-ack+)
                       (logtest flags +tcp4-flag-syn+)
  
negative.code:          (local-port (ub16ref/be packet (+ start +tcp4-header-destination-port+)))
           (flags (ldb (byte 12 0)
                       (ub16ref/be packet (+ start +tcp4-header-flags-and-data-offset+))))
           (connection (get-tcp-connection remote-ip remote-port local-ip local-port))
           (listener (get-tcp-listener local-ip local-port)))
      (cond
        (connection
         (tcp4-receive connection packet start end))
        ((and listener (eql flags +tcp4-flag-syn+))
         (let ((connection (make-instance 'tcp-connection
                                          :%state :listen
                                          :local-port local-port
                                          :local-ip local-ip
                                          :remote-port remote-port
                                          :remote-ip remote-ip
                                          :s-next 0
                                          :r-next (ub32ref/be packet (+ start +tcp4-header-sequence-number+))
                                          :window-size 8192)))
           (mezzano.supervisor:with-mutex ((tcp-listener-lock listener))
             (push connection (tcp-listener-connection listener)))
           (mezzano.supervisor:with-mutex (*tcp-connection-lock*)
             (push connection *tcp-connections*))))
        ((eql flags +tcp4-flag-syn+)
         (tcp4-establish-connection local-ip local-port remote-ip remote-port packet start end))
        (t (format t "Ignoring packet from ~X ~X ~S~%" remote-ip flags
                   (subseq packet start end))))))
  
  (defun tcp4-accept-connection (connection)
    (let* ((seq (random #x100000000))
           (ack (logand #xFFFFFFFF (1+ (tcp-connection-r-next connection)))))
      (setf (tcp-connection-state connection) :syn-received
            (tcp-connection-s-next connection) (logand #xFFFFFFFF (1+ seq))
            (tcp-connection-r-next connection) ack)
      (tcp4-send-packet connection seq ack nil :ack-p t :syn-p t)
      (make-instance 'tcp-stream :connection connection)))
  
  (defun tcp4-decline-connection (connection)
    (close connection)
    (detach-tcp-connection connection))
  
  (defun tcp4-establish-connection (local-ip local-port remote-ip remote-port packet start end)
    (let* ((seq (ub32ref/be packet (+ start +tcp4-header-sequence-number+)))
  