]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/ip_options.c
Merge branch 'linus' into x86/urgent
[linux-2.6-omap-h63xx.git] / net / ipv4 / ip_options.c
index d107543d3f81b4d13a0e788272a6ac8243c9a155..be3f18a7a40ebbbf4f40ef90bfea8702fd4f1fae 100644 (file)
@@ -5,8 +5,6 @@
  *
  *             The options processing module for ip.c
  *
- * Version:    $Id: ip_options.c,v 1.21 2001/09/01 00:31:50 davem Exp $
- *
  * Authors:    A.N.Kuznetsov
  *
  */
@@ -55,10 +53,10 @@ void ip_options_build(struct sk_buff * skb, struct ip_options * opt,
                if (opt->ts_needaddr)
                        ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, rt);
                if (opt->ts_needtime) {
-                       struct timeval tv;
+                       struct timespec tv;
                        __be32 midtime;
-                       do_gettimeofday(&tv);
-                       midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000);
+                       getnstimeofday(&tv);
+                       midtime = htonl((tv.tv_sec % 86400) * MSEC_PER_SEC + tv.tv_nsec / NSEC_PER_MSEC);
                        memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4);
                }
                return;
@@ -406,10 +404,10 @@ int ip_options_compile(struct net *net,
                                        break;
                                }
                                if (timeptr) {
-                                       struct timeval tv;
+                                       struct timespec tv;
                                        __be32  midtime;
-                                       do_gettimeofday(&tv);
-                                       midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000);
+                                       getnstimeofday(&tv);
+                                       midtime = htonl((tv.tv_sec % 86400) * MSEC_PER_SEC + tv.tv_nsec / NSEC_PER_MSEC);
                                        memcpy(timeptr, &midtime, sizeof(__be32));
                                        opt->is_changed = 1;
                                }