diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-09-27 21:28:47 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-28 21:01:55 -0400 |
commit | e25d2ca6b2808c427704b01608baf0f7dea1696e (patch) | |
tree | ff0e7ffb3ac5230a5e97e18b7d9a4667cbb2e09a /net/ipv4 | |
parent | c1d18f9fa09489635a451ee13c1727e1683c2333 (diff) |
[IPV4]: trivial ip_options.c annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_options.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index 3e6d3d4e50d4..8dabbfc31267 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
@@ -57,7 +57,7 @@ void ip_options_build(struct sk_buff * skb, struct ip_options * opt, | |||
57 | ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, rt); | 57 | ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, rt); |
58 | if (opt->ts_needtime) { | 58 | if (opt->ts_needtime) { |
59 | struct timeval tv; | 59 | struct timeval tv; |
60 | __u32 midtime; | 60 | __be32 midtime; |
61 | do_gettimeofday(&tv); | 61 | do_gettimeofday(&tv); |
62 | midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000); | 62 | midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000); |
63 | memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4); | 63 | memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4); |
@@ -91,7 +91,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb) | |||
91 | unsigned char *sptr, *dptr; | 91 | unsigned char *sptr, *dptr; |
92 | int soffset, doffset; | 92 | int soffset, doffset; |
93 | int optlen; | 93 | int optlen; |
94 | u32 daddr; | 94 | __be32 daddr; |
95 | 95 | ||
96 | memset(dopt, 0, sizeof(struct ip_options)); | 96 | memset(dopt, 0, sizeof(struct ip_options)); |
97 | 97 | ||
@@ -362,7 +362,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb) | |||
362 | goto error; | 362 | goto error; |
363 | } | 363 | } |
364 | if (optptr[2] <= optlen) { | 364 | if (optptr[2] <= optlen) { |
365 | __u32 * timeptr = NULL; | 365 | __be32 *timeptr = NULL; |
366 | if (optptr[2]+3 > optptr[1]) { | 366 | if (optptr[2]+3 > optptr[1]) { |
367 | pp_ptr = optptr + 2; | 367 | pp_ptr = optptr + 2; |
368 | goto error; | 368 | goto error; |
@@ -371,7 +371,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb) | |||
371 | case IPOPT_TS_TSONLY: | 371 | case IPOPT_TS_TSONLY: |
372 | opt->ts = optptr - iph; | 372 | opt->ts = optptr - iph; |
373 | if (skb) | 373 | if (skb) |
374 | timeptr = (__u32*)&optptr[optptr[2]-1]; | 374 | timeptr = (__be32*)&optptr[optptr[2]-1]; |
375 | opt->ts_needtime = 1; | 375 | opt->ts_needtime = 1; |
376 | optptr[2] += 4; | 376 | optptr[2] += 4; |
377 | break; | 377 | break; |
@@ -383,7 +383,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb) | |||
383 | opt->ts = optptr - iph; | 383 | opt->ts = optptr - iph; |
384 | if (skb) { | 384 | if (skb) { |
385 | memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4); | 385 | memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4); |
386 | timeptr = (__u32*)&optptr[optptr[2]+3]; | 386 | timeptr = (__be32*)&optptr[optptr[2]+3]; |
387 | } | 387 | } |
388 | opt->ts_needaddr = 1; | 388 | opt->ts_needaddr = 1; |
389 | opt->ts_needtime = 1; | 389 | opt->ts_needtime = 1; |
@@ -401,7 +401,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb) | |||
401 | if (inet_addr_type(addr) == RTN_UNICAST) | 401 | if (inet_addr_type(addr) == RTN_UNICAST) |
402 | break; | 402 | break; |
403 | if (skb) | 403 | if (skb) |
404 | timeptr = (__u32*)&optptr[optptr[2]+3]; | 404 | timeptr = (__be32*)&optptr[optptr[2]+3]; |
405 | } | 405 | } |
406 | opt->ts_needtime = 1; | 406 | opt->ts_needtime = 1; |
407 | optptr[2] += 8; | 407 | optptr[2] += 8; |
@@ -415,10 +415,10 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb) | |||
415 | } | 415 | } |
416 | if (timeptr) { | 416 | if (timeptr) { |
417 | struct timeval tv; | 417 | struct timeval tv; |
418 | __u32 midtime; | 418 | __be32 midtime; |
419 | do_gettimeofday(&tv); | 419 | do_gettimeofday(&tv); |
420 | midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000); | 420 | midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000); |
421 | memcpy(timeptr, &midtime, sizeof(__u32)); | 421 | memcpy(timeptr, &midtime, sizeof(__be32)); |
422 | opt->is_changed = 1; | 422 | opt->is_changed = 1; |
423 | } | 423 | } |
424 | } else { | 424 | } else { |