 +	/* Copy the vcount stamp just before where the mac/sll header wil be */
 +	ffclock_off -= sizeof(ffcounter_t);
 +	memcpy(h.raw + ffclock_off, &(skb->ffclock_stamp), sizeof(ffcounter_t));
-+#endif /* FFCLOCK_CONFIG */
++#endif /* CONFIG_CONFIG */
 +
  	__packet_set_status(po, h.raw, status);
  	smp_mb();
  	{
-@@ -1119,6 +1184,11 @@ static int packet_snd(struct socket *sock,
+@@ -1119,6 +1177,10 @@ static int packet_snd(struct socket *sock,
  	if (err)
  		goto out_free;
  

 	sock_recv_timestamp(msg, sk, skb);
 
 	if (msg->msg_name)
@@ -1979,6 +2053,10 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
 {
 	struct sock *sk = sock->sk;
 
+#ifdef CONFIG_FFCLOCK
+	long tsmode = FFCLOCK_TSMODE_FFCLOCK;
+#endif
+
 	switch (cmd) {
 	case SIOCOUTQ:
 	{
@@ -1999,9 +2077,42 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
 		return put_user(amount, (int __user *)arg);
 	}
 	case SIOCGSTAMP:
+#ifdef CONFIG_FFCLOCK
+		if (sk->sk_ffclock_tsmode == FFCLOCK_TSMODE_FFCLOCK) {
+			/* timeval stamp build based on the FFClock */
+			ffcounter_to_ktime(&sk->sk_ffclock_stamp,
+					    &(sk->sk_stamp));
+		}
+#endif /* CONFIG_FFCLOCK */
 		return sock_get_timestamp(sk, (struct timeval __user *)arg);
 	case SIOCGSTAMPNS:
+#ifdef CONFIG_FFCLOCK
+		if (sk->sk_ffclock_tsmode == FFCLOCK_TSMODE_FFCLOCK) {
+			/* timeval stamp build based on the FFClock */
+			ffcounter_to_ktime(&sk->sk_ffclock_stamp,
+					    &(sk->sk_stamp));
+		}
+#endif /* CONFIG_FFCLOCK */
 		return sock_get_timestampns(sk, (struct timespec __user *)arg);
+#ifdef CONFIG_FFCLOCK
+	case SIOCSFFCLOCKTSMODE:

 	new->transport_header	= old->transport_header;
 	new->network_header	= old->network_header;
diff --git a/net/core/sock.c b/net/core/sock.c
index 7626b6a..b49da94 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -130,6 +130,10 @@
