static int IcmpAliasIn(struct libalias *la, struct ip *pip) { int iresult; struct icmp *ic; LIBALIAS_LOCK_ASSERT(la); /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) return (PKT_ALIAS_OK); ic = (struct icmp *)ip_next(pip); iresult = PKT_ALIAS_IGNORED; switch (ic->icmp_type) { case ICMP_ECHOREPLY: case ICMP_TSTAMPREPLY: if (ic->icmp_code == 0) { iresult = IcmpAliasIn1(la, pip); } break; case ICMP_UNREACH: case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: iresult = IcmpAliasIn2(la, pip); break; case ICMP_ECHO: case ICMP_TSTAMP: iresult = IcmpAliasIn1(la, pip); break; } return (iresult); }
static int IcmpAliasIn(struct ip *pip) { int iresult; struct icmp *ic; /* Return if proxy-only mode is enabled */ if (packetAliasMode & PKT_ALIAS_PROXY_ONLY) return PKT_ALIAS_OK; ic = (struct icmp *) ((char *) pip + (pip->ip_hl << 2)); iresult = PKT_ALIAS_IGNORED; switch (ic->icmp_type) { case ICMP_ECHOREPLY: case ICMP_TSTAMPREPLY: if (ic->icmp_code == 0) { iresult = IcmpAliasIn1(pip); } break; case ICMP_UNREACH: case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: iresult = IcmpAliasIn2(pip); break; case ICMP_ECHO: case ICMP_TSTAMP: iresult = IcmpAliasIn1(pip); break; } return(iresult); }