aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_options.c
diff options
context:
space:
mode:
authorWeilong Chen <chenweilong@huawei.com>2013-12-23 01:37:26 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-26 13:43:21 -0500
commita22318e83bc4726252262f91b08f17d2d66bd88c (patch)
tree7130a2601d5c9ac7bc840c9928e6c922c285698c /net/ipv4/ip_options.c
parentf55b0821b92ee31c440a4a278b2b0fec7ae92bd1 (diff)
ipv4: do clean up with spaces
Fix checkpatch errors like: ERROR: spaces required around that XXX Signed-off-by: Weilong Chen <chenweilong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_options.c')
-rw-r--r--net/ipv4/ip_options.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index ec7264514a82..dd9d90b44f97 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -167,7 +167,7 @@ int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb)
167 soffset -= 4; 167 soffset -= 4;
168 if (soffset > 3) { 168 if (soffset > 3) {
169 memcpy(&faddr, &start[soffset-1], 4); 169 memcpy(&faddr, &start[soffset-1], 4);
170 for (soffset-=4, doffset=4; soffset > 3; soffset-=4, doffset+=4) 170 for (soffset -= 4, doffset = 4; soffset > 3; soffset -= 4, doffset += 4)
171 memcpy(&dptr[doffset-1], &start[soffset-1], 4); 171 memcpy(&dptr[doffset-1], &start[soffset-1], 4);
172 /* 172 /*
173 * RFC1812 requires to fix illegal source routes. 173 * RFC1812 requires to fix illegal source routes.
@@ -227,7 +227,7 @@ void ip_options_fragment(struct sk_buff *skb)
227 continue; 227 continue;
228 } 228 }
229 optlen = optptr[1]; 229 optlen = optptr[1];
230 if (optlen<2 || optlen>l) 230 if (optlen < 2 || optlen > l)
231 return; 231 return;
232 if (!IPOPT_COPIED(*optptr)) 232 if (!IPOPT_COPIED(*optptr))
233 memset(optptr, IPOPT_NOOP, optlen); 233 memset(optptr, IPOPT_NOOP, optlen);
@@ -276,7 +276,7 @@ int ip_options_compile(struct net *net,
276 for (l = opt->optlen; l > 0; ) { 276 for (l = opt->optlen; l > 0; ) {
277 switch (*optptr) { 277 switch (*optptr) {
278 case IPOPT_END: 278 case IPOPT_END:
279 for (optptr++, l--; l>0; optptr++, l--) { 279 for (optptr++, l--; l > 0; optptr++, l--) {
280 if (*optptr != IPOPT_END) { 280 if (*optptr != IPOPT_END) {
281 *optptr = IPOPT_END; 281 *optptr = IPOPT_END;
282 opt->is_changed = 1; 282 opt->is_changed = 1;
@@ -289,7 +289,7 @@ int ip_options_compile(struct net *net,
289 continue; 289 continue;
290 } 290 }
291 optlen = optptr[1]; 291 optlen = optptr[1];
292 if (optlen<2 || optlen>l) { 292 if (optlen < 2 || optlen > l) {
293 pp_ptr = optptr; 293 pp_ptr = optptr;
294 goto error; 294 goto error;
295 } 295 }
@@ -572,7 +572,7 @@ void ip_forward_options(struct sk_buff *skb)
572 572
573 optptr = raw + opt->srr; 573 optptr = raw + opt->srr;
574 574
575 for ( srrptr=optptr[2], srrspace = optptr[1]; 575 for ( srrptr = optptr[2], srrspace = optptr[1];
576 srrptr <= srrspace; 576 srrptr <= srrspace;
577 srrptr += 4 577 srrptr += 4
578 ) { 578 ) {
@@ -628,7 +628,7 @@ int ip_options_rcv_srr(struct sk_buff *skb)
628 if (rt->rt_type != RTN_LOCAL) 628 if (rt->rt_type != RTN_LOCAL)
629 return -EINVAL; 629 return -EINVAL;
630 630
631 for (srrptr=optptr[2], srrspace = optptr[1]; srrptr <= srrspace; srrptr += 4) { 631 for (srrptr = optptr[2], srrspace = optptr[1]; srrptr <= srrspace; srrptr += 4) {
632 if (srrptr + 3 > srrspace) { 632 if (srrptr + 3 > srrspace) {
633 icmp_send(skb, ICMP_PARAMETERPROB, 0, htonl((opt->srr+2)<<24)); 633 icmp_send(skb, ICMP_PARAMETERPROB, 0, htonl((opt->srr+2)<<24));
634 return -EINVAL; 634 return -EINVAL;