Lines 4418-4423
ipf_matchicmpqueryreply(v, ic, icmp, rev)
Link Here
|
4418 |
} |
4418 |
} |
4419 |
|
4419 |
|
4420 |
|
4420 |
|
|
|
4421 |
/* ------------------------------------------------------------------------ */ |
4422 |
/* Function: ipf_ifnames_cmp */ |
4423 |
/* Parameters: fr1(I) - first rule structure to compare */ |
4424 |
/* fr2(I) - second rule structure to compare */ |
4425 |
/* Returns: int - 0 == rules are the same, 1 == mismatch */ |
4426 |
/* */ |
4427 |
/* Compare two ifnames within frentry structures and return 0 if they */ |
4428 |
/* match or 1 if they do not. */ |
4429 |
/* ------------------------------------------------------------------------ */ |
4430 |
static int |
4431 |
ipf_ifnames_cmp(const frentry_t *fr1, const frentry_t *fr2) |
4432 |
{ |
4433 |
int i, rc = 0; |
4434 |
|
4435 |
for (i = 0; i < 4; i++) { |
4436 |
if ((!fr1->fr_ifnames[i] && !fr2->fr_ifnames[i]) || |
4437 |
strcmp(FR_NAME(fr1, fr_ifnames[i]), |
4438 |
FR_NAME(fr2, fr_ifnames[i])) == 0) |
4439 |
continue; |
4440 |
rc = 1; |
4441 |
} |
4442 |
return (rc); |
4443 |
} |
4444 |
|
4445 |
|
4421 |
/* ------------------------------------------------------------------------ */ |
4446 |
/* ------------------------------------------------------------------------ */ |
4422 |
/* Function: ipf_rule_compare */ |
4447 |
/* Function: ipf_rule_compare */ |
4423 |
/* Parameters: fr1(I) - first rule structure to compare */ |
4448 |
/* Parameters: fr1(I) - first rule structure to compare */ |
Lines 4439-4451
ipf_rule_compare(frentry_t *fr1, frentry_t *fr2)
Link Here
|
4439 |
if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, FR_CMPSIZ(fr1)) |
4464 |
if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, FR_CMPSIZ(fr1)) |
4440 |
!= 0) |
4465 |
!= 0) |
4441 |
return (4); |
4466 |
return (4); |
|
|
4467 |
if (ipf_ifnames_cmp(fr1, fr2) != 0) |
4468 |
return (5); |
4442 |
if (!fr1->fr_data && !fr2->fr_data) |
4469 |
if (!fr1->fr_data && !fr2->fr_data) |
4443 |
return (0); /* move along, nothing to see here */ |
4470 |
return (0); /* move along, nothing to see here */ |
4444 |
if (fr1->fr_data && fr2->fr_data) { |
4471 |
if (fr1->fr_data && fr2->fr_data) { |
4445 |
if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize) == 0) |
4472 |
if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize) == 0) |
4446 |
return (0); /* same */ |
4473 |
return (0); /* same */ |
4447 |
} |
4474 |
} |
4448 |
return (5); |
4475 |
return (6); |
4449 |
} |
4476 |
} |
4450 |
|
4477 |
|
4451 |
|
4478 |
|