diff options
Diffstat (limited to 'drivers/net/ppp_deflate.c')
-rw-r--r-- | drivers/net/ppp_deflate.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index 034c1c650bcb..695bc83e0cfd 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c | |||
@@ -111,11 +111,11 @@ static void *z_comp_alloc(unsigned char *options, int opt_len) | |||
111 | struct ppp_deflate_state *state; | 111 | struct ppp_deflate_state *state; |
112 | int w_size; | 112 | int w_size; |
113 | 113 | ||
114 | if (opt_len != CILEN_DEFLATE | 114 | if (opt_len != CILEN_DEFLATE || |
115 | || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) | 115 | (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || |
116 | || options[1] != CILEN_DEFLATE | 116 | options[1] != CILEN_DEFLATE || |
117 | || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL | 117 | DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || |
118 | || options[3] != DEFLATE_CHK_SEQUENCE) | 118 | options[3] != DEFLATE_CHK_SEQUENCE) |
119 | return NULL; | 119 | return NULL; |
120 | w_size = DEFLATE_SIZE(options[2]); | 120 | w_size = DEFLATE_SIZE(options[2]); |
121 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) | 121 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) |
@@ -163,12 +163,12 @@ static int z_comp_init(void *arg, unsigned char *options, int opt_len, | |||
163 | { | 163 | { |
164 | struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; | 164 | struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; |
165 | 165 | ||
166 | if (opt_len < CILEN_DEFLATE | 166 | if (opt_len < CILEN_DEFLATE || |
167 | || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) | 167 | (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || |
168 | || options[1] != CILEN_DEFLATE | 168 | options[1] != CILEN_DEFLATE || |
169 | || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL | 169 | DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || |
170 | || DEFLATE_SIZE(options[2]) != state->w_size | 170 | DEFLATE_SIZE(options[2]) != state->w_size || |
171 | || options[3] != DEFLATE_CHK_SEQUENCE) | 171 | options[3] != DEFLATE_CHK_SEQUENCE) |
172 | return 0; | 172 | return 0; |
173 | 173 | ||
174 | state->seqno = 0; | 174 | state->seqno = 0; |
@@ -330,11 +330,11 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len) | |||
330 | struct ppp_deflate_state *state; | 330 | struct ppp_deflate_state *state; |
331 | int w_size; | 331 | int w_size; |
332 | 332 | ||
333 | if (opt_len != CILEN_DEFLATE | 333 | if (opt_len != CILEN_DEFLATE || |
334 | || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) | 334 | (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || |
335 | || options[1] != CILEN_DEFLATE | 335 | options[1] != CILEN_DEFLATE || |
336 | || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL | 336 | DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || |
337 | || options[3] != DEFLATE_CHK_SEQUENCE) | 337 | options[3] != DEFLATE_CHK_SEQUENCE) |
338 | return NULL; | 338 | return NULL; |
339 | w_size = DEFLATE_SIZE(options[2]); | 339 | w_size = DEFLATE_SIZE(options[2]); |
340 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) | 340 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) |
@@ -381,12 +381,12 @@ static int z_decomp_init(void *arg, unsigned char *options, int opt_len, | |||
381 | { | 381 | { |
382 | struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; | 382 | struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; |
383 | 383 | ||
384 | if (opt_len < CILEN_DEFLATE | 384 | if (opt_len < CILEN_DEFLATE || |
385 | || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) | 385 | (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || |
386 | || options[1] != CILEN_DEFLATE | 386 | options[1] != CILEN_DEFLATE || |
387 | || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL | 387 | DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || |
388 | || DEFLATE_SIZE(options[2]) != state->w_size | 388 | DEFLATE_SIZE(options[2]) != state->w_size || |
389 | || options[3] != DEFLATE_CHK_SEQUENCE) | 389 | options[3] != DEFLATE_CHK_SEQUENCE) |
390 | return 0; | 390 | return 0; |
391 | 391 | ||
392 | state->seqno = 0; | 392 | state->seqno = 0; |