Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Nov 2006 14:40:37 GMT
From:      "Christian S.J. Peron" <csjp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 110390 for review
Message-ID:  <200611221440.kAMEebK2073420@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=110390

Change 110390 by csjp@csjp_xor on 2006/11/22 14:40:25

	Instead of coverting the data to big endian on copy, do a straight
	memory copy. The user is expected to have the address data in
	network byte order already. This is consistent with how we read the
	machine portion of the regular termid.

Affected files ...

.. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#56 edit

Differences ...

==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#56 (text+ko) ====

@@ -30,7 +30,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#55 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#56 $
  */
 
 #include <sys/types.h>
@@ -1104,12 +1104,10 @@
 	ADD_U_INT32(dptr, sid);
 	ADD_U_INT32(dptr, tid->at_port);
 	ADD_U_INT32(dptr, tid->at_type);
-	ADD_U_INT32(dptr, tid->at_addr[0]);
-	if (tid->at_type == AU_IPv6) {
-		ADD_U_INT32(dptr, tid->at_addr[1]);
-		ADD_U_INT32(dptr, tid->at_addr[2]);
-		ADD_U_INT32(dptr, tid->at_addr[3]);
-	}
+	if (tid->at_type == AU_IPv6)
+		ADD_MEM(dptr, &tid->at_addr[0], 4 * sizeof(u_int32_t));
+	else
+		ADD_MEM(dptr, &tid->at_addr[0], sizeof(u_int32_t));
 
 	return (t);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611221440.kAMEebK2073420>