From 4730235e05e725b3d9180ae8db7a63759e29e928 Mon Sep 17 00:00:00 2001
From: Aurelio Colosimo <aurelio@aureliocolosimo.it>
Date: Mon, 26 Nov 2012 12:00:21 +0100
Subject: [PATCH] wrc_ptp_ppsi.c: fix alignment of incoming packets buffer

Due to previous implementation of net functions, packet buffer address was
badly aligned.

Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
---
 wrc_ptp_ppsi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/wrc_ptp_ppsi.c b/wrc_ptp_ppsi.c
index b8282cf26..821d04dc4 100644
--- a/wrc_ptp_ppsi.c
+++ b/wrc_ptp_ppsi.c
@@ -165,15 +165,13 @@ int wrc_ptp_update()
 	struct pp_instance *ppi = &ppi_static;
 
 	if (ptp_enabled) {
-		static unsigned char _packet[500];
-		/* FIXME Alignment */
-		unsigned char *packet = _packet + 2;
+		static unsigned char packet[500];
 
 		/*
 		 * We got a packet. If it's not ours, continue consuming
 		 * the pending timeout
 		 */
-		i = spec_recv_packet(ppi, packet, sizeof(_packet),
+		i = spec_recv_packet(ppi, packet, sizeof(packet),
 				     &ppi->last_rcv_time);
 		if ((!i) && (timer_get_tics() - start_tics < delay_ms))
 			return 0;
-- 
GitLab