Lines 4401-4407
pf_test_state_tcp(struct pf_state **state, int direction, struct pfi_kif *kif,
Link Here
|
4401 |
return (PF_PASS); |
4401 |
return (PF_PASS); |
4402 |
} |
4402 |
} |
4403 |
|
4403 |
|
4404 |
static int |
4404 |
int |
4405 |
pf_test_state_udp(struct pf_state **state, int direction, struct pfi_kif *kif, |
4405 |
pf_test_state_udp(struct pf_state **state, int direction, struct pfi_kif *kif, |
4406 |
struct mbuf *m, int off, void *h, struct pf_pdesc *pd) |
4406 |
struct mbuf *m, int off, void *h, struct pf_pdesc *pd) |
4407 |
{ |
4407 |
{ |
Lines 4409-4414
pf_test_state_udp(struct pf_state **state, int direction, struct pfi_kif *kif,
Link Here
|
4409 |
struct pf_state_key_cmp key; |
4409 |
struct pf_state_key_cmp key; |
4410 |
struct udphdr *uh = pd->hdr.udp; |
4410 |
struct udphdr *uh = pd->hdr.udp; |
4411 |
|
4411 |
|
|
|
4412 |
if (state == NULL) |
4413 |
panic("s != NULL"); |
4414 |
|
4412 |
bzero(&key, sizeof(key)); |
4415 |
bzero(&key, sizeof(key)); |
4413 |
key.af = pd->af; |
4416 |
key.af = pd->af; |
4414 |
key.proto = IPPROTO_UDP; |
4417 |
key.proto = IPPROTO_UDP; |
Lines 4426-4431
pf_test_state_udp(struct pf_state **state, int direction, struct pfi_kif *kif,
Link Here
|
4426 |
|
4429 |
|
4427 |
STATE_LOOKUP(kif, &key, direction, *state, pd); |
4430 |
STATE_LOOKUP(kif, &key, direction, *state, pd); |
4428 |
|
4431 |
|
|
|
4432 |
if (*state == NULL) |
4433 |
panic("*s != NULL"); |
4434 |
|
4429 |
if (direction == (*state)->direction) { |
4435 |
if (direction == (*state)->direction) { |
4430 |
src = &(*state)->src; |
4436 |
src = &(*state)->src; |
4431 |
dst = &(*state)->dst; |
4437 |
dst = &(*state)->dst; |
Lines 4449-4454
pf_test_state_udp(struct pf_state **state, int direction, struct pfi_kif *kif,
Link Here
|
4449 |
|
4455 |
|
4450 |
/* translate source/destination address, if necessary */ |
4456 |
/* translate source/destination address, if necessary */ |
4451 |
if ((*state)->key[PF_SK_WIRE] != (*state)->key[PF_SK_STACK]) { |
4457 |
if ((*state)->key[PF_SK_WIRE] != (*state)->key[PF_SK_STACK]) { |
|
|
4458 |
if ((*state)->key[PF_SK_WIRE] == NULL) |
4459 |
panic("key PF_SK_WIRE is NULL"); |
4460 |
if ((*state)->key[PF_SK_STACK] == NULL) |
4461 |
panic("key PF_SK_STACK is NULL"); |
4462 |
if (pd->didx != 0 && pd->didx != 1) |
4463 |
panic("bad pd->didx"); |
4464 |
if (pd->sidx != 0 && pd->sidx != 1) |
4465 |
panic("bad pd->didx"); |
4466 |
|
4452 |
struct pf_state_key *nk = (*state)->key[pd->didx]; |
4467 |
struct pf_state_key *nk = (*state)->key[pd->didx]; |
4453 |
|
4468 |
|
4454 |
if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || |
4469 |
if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || |