  	__packet_set_status(po, h.raw, status);
  	smp_mb();
  	{
-@@ -1119,6 +1191,15 @@ static int packet_snd(struct socket *sock,
+@@ -1119,6 +1192,15 @@ static int packet_snd(struct socket *sock,
  	if (err)
  		goto out_free;
  

 	switch (cmd) {
 	case SIOCOUTQ:
 	{
@@ -1999,9 +2092,55 @@ 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 */
+			ffclock_fill_ktime(sk->sk_ffclock_stamp,
+					    &(sk->sk_stamp));
+		} else if (sk->sk_ffclock_tsmode ==
+			    FFCLOCK_TSMODE_FAIRCOMPARE) {
+			/* We are in FAIRCOMPARE mode so happily overwrite the
+			 * timestamp that is returned right below
+			 */
+			sk->sk_stamp = sk->sk_stamp_fair;
+		}
+#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 */
+			ffclock_fill_ktime(sk->sk_ffclock_stamp,
+					    &(sk->sk_stamp));
+		} else if (sk->sk_ffclock_tsmode ==
+			    FFCLOCK_TSMODE_FAIRCOMPARE) {
+			/* We are in FAIRCOMPARE mode so happily overwrite the
+			 * timestamp that is returned right below
+			 */
+			sk->sk_stamp = sk->sk_stamp_fair;
+		}
+#endif /* CONFIG_FFCLOCK */
 		return sock_get_timestampns(sk, (struct timespec __user *)arg);
+#ifdef CONFIG_FFCLOCK

 	sock_recv_timestamp(msg, sk, skb);
 
 	if (msg->msg_name)
@@ -1979,6 +2069,10 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
 {
 	struct sock *sk = sock->sk;
 
