Blob Blame History Raw
diff -Naur libreswan-3.15-orig/programs/pluto/state.c libreswan-3.15/programs/pluto/state.c
--- libreswan-3.15-orig/programs/pluto/state.c	2015-08-24 16:52:43.000000000 -0400
+++ libreswan-3.15/programs/pluto/state.c	2015-09-04 09:31:28.815818376 -0400
@@ -1652,21 +1652,20 @@
 		char *mbcp = traffic_buf + snprintf(traffic_buf,
 				sizeof(traffic_buf) - 1, ", type=%s,  add_time=%" PRIu64, mode,  st->st_esp.add_time);
 
-		if (get_sa_info(st, TRUE, NULL)) {
+		if (get_sa_info(st, FALSE, NULL)) {
 			size_t buf_len =  traffic_buf + sizeof(traffic_buf) - mbcp;
-			u_int inb = st->st_esp.present ? st->st_esp.peer_bytes :
+			u_int outb = st->st_esp.present ? st->st_esp.peer_bytes :
 				st->st_ah.present ? st->st_ah.peer_bytes :
 				st->st_ipcomp.present ? st->st_ipcomp.peer_bytes : 0;
-
-			mbcp += snprintf(mbcp, buf_len - 1, ", inBytes=%u", inb);
+			mbcp += snprintf(mbcp, buf_len - 1, ", outBytes=%u", outb);
 		}
-		if (get_sa_info(st, FALSE, NULL)) {
+
+		if (get_sa_info(st, TRUE, NULL)) {
 			size_t buf_len =  traffic_buf + sizeof(traffic_buf) - mbcp;
-			u_int outb = st->st_esp.present ? st->st_esp.our_bytes :
+			u_int inb = st->st_esp.present ? st->st_esp.our_bytes:
 				st->st_ah.present ? st->st_ah.our_bytes :
 				st->st_ipcomp.present ? st->st_ipcomp.our_bytes : 0;
-
-			snprintf(mbcp, buf_len - 1, ", outBytes=%u", outb);
+			snprintf(mbcp, buf_len - 1, ", inBytes=%u", inb);
 		}
 	}
 
@@ -1815,7 +1814,7 @@
 						       mbcp,
 						       traffic_buf +
 							  sizeof(traffic_buf),
-						       " AHin=");
+						       " AHout=");
 			}
 #endif
 			add_said(&c->spd.this.host_addr, st->st_ah.our_spi,
@@ -1826,7 +1825,7 @@
 						       mbcp,
 						       traffic_buf +
 							 sizeof(traffic_buf),
-						       " AHout=");
+						       " AHin=");
 			}
 #endif
 			mbcp = humanize_number(
@@ -1842,23 +1841,23 @@
 				 SA_ESP);
 /* ??? needs proper fix, via kernel_ops? */
 #if defined(linux) && defined(NETKEY_SUPPORT)
-			if (get_sa_info(st, FALSE, NULL)) {
+			if (get_sa_info(st, TRUE, NULL)) {
 				mbcp = humanize_number(st->st_esp.peer_bytes,
 						       mbcp,
 						       traffic_buf +
 							 sizeof(traffic_buf),
-						       " ESPin=");
+						       " ESPout=");
 			}
 #endif
 			add_said(&c->spd.this.host_addr, st->st_esp.our_spi,
 				 SA_ESP);
 #if defined(linux) && defined(NETKEY_SUPPORT)
-			if (get_sa_info(st, TRUE, NULL)) {
+			if (get_sa_info(st, FALSE, NULL)) {
 				mbcp = humanize_number(st->st_esp.our_bytes,
 						       mbcp,
 						       traffic_buf +
 							 sizeof(traffic_buf),
-						       " ESPout=");
+						       " ESPin=");
 			}
 #endif
 
@@ -1879,7 +1878,7 @@
 						mbcp,
 						traffic_buf +
 						  sizeof(traffic_buf),
-						" IPCOMPin=");
+						" IPCOMPout=");
 			}
 #endif
 			add_said(&c->spd.this.host_addr, st->st_ipcomp.our_spi,
@@ -1891,7 +1890,7 @@
 						mbcp,
 						traffic_buf +
 						  sizeof(traffic_buf),
-						" IPCOMPout=");
+						" IPCOMPin=");
 			}
 #endif