if (log_IsKept(LogTCPIP)) {
if (PacketAliasSetMode(0, 0) & PKT_ALIAS_DENY_INCOMING) { log_Printf(LogTCPIP, "NAT engine denied data:\n"); m_freem(bp); bp = NULL; } else if (log_IsKept(LogTCPIP)) {
nat_LayerPull(struct bundle *bundle, struct link *l, struct mbuf *bp,                u_short *proto){  static int gfrags;  int ret, len, nfrags;  struct mbuf **last;  char *fptr;  if (!bundle->NatEnabled || *proto != PROTO_IP)    return bp;  log_Printf(LogDEBUG, "nat_LayerPull: PROTO_IP -> PROTO_IP\n");  m_settype(bp, MB_NATIN);  /* Ensure there's a bit of extra buffer for the NAT code... */  bp = m_pullup(m_append(bp, NULL, NAT_EXTRABUF));  ret = PacketAliasIn(MBUF_CTOP(bp), bp->m_len);  bp->m_len = ntohs(((struct ip *)MBUF_CTOP(bp))->ip_len);  if (bp->m_len > MAX_MRU) {    log_Printf(LogWARN, "nat_LayerPull: Problem with IP header length (%lu)\n",               (unsigned long)bp->m_len);    m_freem(bp);    return NULL;  }  switch (ret) {    case PKT_ALIAS_OK:      break;    case PKT_ALIAS_UNRESOLVED_FRAGMENT:      /* Save the data for later */      fptr = malloc(bp->m_len);      bp = mbuf_Read(bp, fptr, bp->m_len);      PacketAliasSaveFragment(fptr);      log_Printf(LogDEBUG, "Store another frag (%lu) - now %d\n",                 (unsigned long)((struct ip *)fptr)->ip_id, ++gfrags);      break;    case PKT_ALIAS_FOUND_HEADER_FRAGMENT:      /* Fetch all the saved fragments and chain them on the end of `bp' */      last = &bp->m_nextpkt;      nfrags = 0;      while ((fptr = PacketAliasGetFragment(MBUF_CTOP(bp))) != NULL) {        nfrags++;        PacketAliasFragmentIn(MBUF_CTOP(bp), fptr);        len = ntohs(((struct ip *)fptr)->ip_len);        *last = m_get(len, MB_NATIN);        memcpy(MBUF_CTOP(*last), fptr, len);        free(fptr);        last = &(*last)->m_nextpkt;      }      gfrags -= nfrags;      log_Printf(LogDEBUG, "Found a frag header (%lu) - plus %d more frags (no"                 "w %d)\n", (unsigned long)((struct ip *)MBUF_CTOP(bp))->ip_id,                 nfrags, gfrags);      break;    case PKT_ALIAS_IGNORED:      if (log_IsKept(LogTCPIP)) {        log_Printf(LogTCPIP, "NAT engine ignored data:\n");        PacketCheck(bundle, MBUF_CTOP(bp), bp->m_len, NULL, NULL, NULL);      }      break;    default:      log_Printf(LogWARN, "nat_LayerPull: Dropped a packet (%d)....\n", ret);      m_freem(bp);      bp = NULL;      break;  }  return bp;}