LOOP packets don't use the time field, so don't swap it
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 15 May 1986 23:45:00 +0000 (15:45 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 15 May 1986 23:45:00 +0000 (15:45 -0800)
more packets should be done this way

SCCS-vsn: usr.sbin/timed/timed/byteorder.c 2.2

usr/src/usr.sbin/timed/timed/byteorder.c

index a9df44c..96eb62f 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)byteorder.c        2.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)byteorder.c        2.2 (Berkeley) %G%";
 #endif not lint
 
 #include "globals.h"
 #endif not lint
 
 #include "globals.h"
@@ -20,14 +20,18 @@ bytenetorder(ptr)
 struct tsp *ptr;
 {
        ptr->tsp_seq = htons((u_short)ptr->tsp_seq);
 struct tsp *ptr;
 {
        ptr->tsp_seq = htons((u_short)ptr->tsp_seq);
-       ptr->tsp_time.tv_sec = htonl((u_long)ptr->tsp_time.tv_sec);
-       ptr->tsp_time.tv_usec = htonl((u_long)ptr->tsp_time.tv_usec);
+       if (ptr->tsp_type != TSP_LOOP) {
+               ptr->tsp_time.tv_sec = htonl((u_long)ptr->tsp_time.tv_sec);
+               ptr->tsp_time.tv_usec = htonl((u_long)ptr->tsp_time.tv_usec);
+       }
 }
 
 bytehostorder(ptr)
 struct tsp *ptr;
 {
        ptr->tsp_seq = ntohs((u_short)ptr->tsp_seq);
 }
 
 bytehostorder(ptr)
 struct tsp *ptr;
 {
        ptr->tsp_seq = ntohs((u_short)ptr->tsp_seq);
-       ptr->tsp_time.tv_sec = ntohl((u_long)ptr->tsp_time.tv_sec);
-       ptr->tsp_time.tv_usec = ntohl((u_long)ptr->tsp_time.tv_usec);
+       if (ptr->tsp_type != TSP_LOOP) {
+               ptr->tsp_time.tv_sec = ntohl((u_long)ptr->tsp_time.tv_sec);
+               ptr->tsp_time.tv_usec = ntohl((u_long)ptr->tsp_time.tv_usec);
+       }
 }
 }