PERFORCE change 110390 for review

Christian S.J. Peron csjp at FreeBSD.org
Wed Nov 22 14:40:44 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=110390

Change 110390 by csjp at 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);
 }


More information about the p4-projects mailing list