This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [PATCH] 1 of 2: default ssid to 0

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] 1 of 2: default ssid to 0
From: David Hopwood <david.nospam.hopwood@xxxxxxxxxxxxxxxx>
Date: Sun, 26 Jun 2005 14:55:56 +0100
Delivery-date: Sun, 26 Jun 2005 13:54:58 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <OF925F6D60.79986553-ON8525702C.0012218A-8525702C.001254CB@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <OF925F6D60.79986553-ON8525702C.0012218A-8525702C.001254CB@xxxxxxxxxx>
Reply-to: david.nospam.hopwood@xxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
Reiner Sailer wrote:
From: aq <aquynh@xxxxxxxxx>

+     for(j=0; j<= CWALL_MAX_SSIDREFS; j++)
+         if ((0 < j) &&( j <= CWALL_MAX_TYPES))
+             ssidrefs[j*CWALL_MAX_TYPES + j - 1] = htons(1);

why dont you run the loop from j=1?

because row j=0 is the new default ssid and has no types set.
We start with row j=1 and set the "diagonal" types to one.

I think aq's point was that the above loop is equivalent to:

  #include <stdlib.h> // for 'min'

  for (j = 1; j <= min(CWALL_MAX_SSIDREFS, CWALL_MAX_TYPES); j++) {
      ssidrefs[j*CWALL_MAX_TYPES + j - 1] = htons(1);

which is arguably clearer.

David Hopwood <david.nospam.hopwood@xxxxxxxxxxxxxxxx>

Xen-devel mailing list