Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36834
b: refs/heads/master
c: e25d2ca
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and David S. Miller committed Sep 29, 2006
1 parent 1c688cc commit 1de8729
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1d18f9fa09489635a451ee13c1727e1683c2333
refs/heads/master: e25d2ca6b2808c427704b01608baf0f7dea1696e
16 changes: 8 additions & 8 deletions trunk/net/ipv4/ip_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void ip_options_build(struct sk_buff * skb, struct ip_options * opt,
ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, rt);
if (opt->ts_needtime) {
struct timeval tv;
__u32 midtime;
__be32 midtime;
do_gettimeofday(&tv);
midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000);
memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4);
Expand Down Expand Up @@ -91,7 +91,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb)
unsigned char *sptr, *dptr;
int soffset, doffset;
int optlen;
u32 daddr;
__be32 daddr;

memset(dopt, 0, sizeof(struct ip_options));

Expand Down Expand Up @@ -362,7 +362,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
goto error;
}
if (optptr[2] <= optlen) {
__u32 * timeptr = NULL;
__be32 *timeptr = NULL;
if (optptr[2]+3 > optptr[1]) {
pp_ptr = optptr + 2;
goto error;
Expand All @@ -371,7 +371,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
case IPOPT_TS_TSONLY:
opt->ts = optptr - iph;
if (skb)
timeptr = (__u32*)&optptr[optptr[2]-1];
timeptr = (__be32*)&optptr[optptr[2]-1];
opt->ts_needtime = 1;
optptr[2] += 4;
break;
Expand All @@ -383,7 +383,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
opt->ts = optptr - iph;
if (skb) {
memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4);
timeptr = (__u32*)&optptr[optptr[2]+3];
timeptr = (__be32*)&optptr[optptr[2]+3];
}
opt->ts_needaddr = 1;
opt->ts_needtime = 1;
Expand All @@ -401,7 +401,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
if (inet_addr_type(addr) == RTN_UNICAST)
break;
if (skb)
timeptr = (__u32*)&optptr[optptr[2]+3];
timeptr = (__be32*)&optptr[optptr[2]+3];
}
opt->ts_needtime = 1;
optptr[2] += 8;
Expand All @@ -415,10 +415,10 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
}
if (timeptr) {
struct timeval tv;
__u32 midtime;
__be32 midtime;
do_gettimeofday(&tv);
midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000);
memcpy(timeptr, &midtime, sizeof(__u32));
memcpy(timeptr, &midtime, sizeof(__be32));
opt->is_changed = 1;
}
} else {
Expand Down

0 comments on commit 1de8729

Please sign in to comment.