コード例 #1
0
ファイル: ip_fragment.threaded.c プロジェクト: kay21s/pStack
/*
  Remove an entry from the "incomplete datagrams" queue, either
  because we completed, reassembled and processed it, or because it
  timed out.
*/
static void
//! ip_free(struct ipq * qp)
ip_free(struct ipq * qp,IP_THREAD_LOCAL_P  ip_thread_local_p)
{
	struct ipfrag *fp;
	struct ipfrag *xp;

	/* Stop the timer for this entry. */
//!   del_timer(&qp->timer);
	del_timer(&qp->timer,ip_thread_local_p);

	/* Remove this entry from the "incomplete datagrams" queue. */
	if (qp->prev == NULL) {
//!     this_host->ipqueue = qp->next;
		ip_thread_local_p->this_host->ipqueue = qp->next;
//!     if (this_host->ipqueue != NULL)
		if (ip_thread_local_p->this_host->ipqueue != NULL)
//!       this_host->ipqueue->prev = NULL;
			ip_thread_local_p->this_host->ipqueue->prev = NULL;
		else
//!       rmthis_host();

			rmthis_host(ip_thread_local_p);
	} else {
		qp->prev->next = qp->next;
		if (qp->next != NULL)
			qp->next->prev = qp->prev;
	}
	/* Release all fragment data. */
	fp = qp->fragments;
	while (fp != NULL) {
		xp = fp->next;
//!     frag_kfree_skb(fp->skb, FREE_READ);
		frag_kfree_skb(fp->skb, FREE_READ,ip_thread_local_p);
//!     frag_kfree_s(fp, sizeof(struct ipfrag));
		frag_kfree_s(fp, sizeof(struct ipfrag),ip_thread_local_p);
		fp = xp;
	}
	/* Release the IP header. */
	frag_kfree_s(qp->iph, 64 + 8, ip_thread_local_p);

	/* Finally, release the queue descriptor itself. */
//!   frag_kfree_s(qp, sizeof(struct ipq));
	frag_kfree_s(qp, sizeof(struct ipq),ip_thread_local_p);
}
コード例 #2
0
ファイル: ip_fragment.c プロジェクト: chenc10/FIT
/*
  Remove an entry from the "incomplete datagrams" queue, either
  because we completed, reassembled and processed it, or because it
  timed out.
*/
static void
ip_free(struct ipq * qp)
{
  struct ipfrag *fp;
  struct ipfrag *xp;

  /* Stop the timer for this entry. */
  del_timer(&qp->timer);

  /* Remove this entry from the "incomplete datagrams" queue. */
  if (qp->prev == NULL) {
    this_host->ipqueue = qp->next;
    if (this_host->ipqueue != NULL)
      this_host->ipqueue->prev = NULL;
    else
      rmthis_host();
  }
  else {
    qp->prev->next = qp->next;
    if (qp->next != NULL)
      qp->next->prev = qp->prev;
  }
  /* Release all fragment data. */
  fp = qp->fragments;
  while (fp != NULL) {
    xp = fp->next;
    frag_kfree_skb(fp->skb, FREE_READ);
    frag_kfree_s(fp, sizeof(struct ipfrag));
    fp = xp;
  }
  /* Release the IP header. */
  frag_kfree_s(qp->iph, 64 + 8);

  /* Finally, release the queue descriptor itself. */
  frag_kfree_s(qp, sizeof(struct ipq));
}