| 620 | } |
| 621 | |
| 622 | static int |
| 623 | IcmpAliasOut(struct libalias *la, struct ip *pip, int create) |
| 624 | { |
| 625 | int iresult; |
| 626 | struct icmp *ic; |
| 627 | |
| 628 | LIBALIAS_LOCK_ASSERT(la); |
| 629 | (void)create; |
| 630 | |
| 631 | /* Return if proxy-only mode is enabled */ |
| 632 | if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) |
| 633 | return (PKT_ALIAS_OK); |
| 634 | |
| 635 | ic = (struct icmp *)ip_next(pip); |
| 636 | |
| 637 | iresult = PKT_ALIAS_IGNORED; |
| 638 | switch (ic->icmp_type) { |
| 639 | case ICMP_ECHO: |
| 640 | case ICMP_TSTAMP: |
| 641 | if (ic->icmp_code == 0) { |
| 642 | iresult = IcmpAliasOut1(la, pip, create); |
| 643 | } |
| 644 | break; |
| 645 | case ICMP_UNREACH: |
| 646 | case ICMP_SOURCEQUENCH: |
| 647 | case ICMP_TIMXCEED: |
| 648 | case ICMP_PARAMPROB: |
| 649 | iresult = IcmpAliasOut2(la, pip); |
| 650 | break; |
| 651 | case ICMP_ECHOREPLY: |
| 652 | case ICMP_TSTAMPREPLY: |
| 653 | iresult = IcmpAliasOut1(la, pip, create); |
| 654 | } |
| 655 | return (iresult); |
| 656 | } |
| 657 | |
| 658 | static int |
| 659 | ProtoAliasIn(struct libalias *la, struct in_addr ip_src, |
no test coverage detected