[BACK]Return to ip_input.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / netinet

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/netinet/ip_input.c between version 1.71 and 1.72

version 1.71, 1998/09/30 21:52:25 version 1.72, 1998/10/08 01:19:25
Line 88 
Line 88 
 #include <sys/time.h>  #include <sys/time.h>
 #include <sys/kernel.h>  #include <sys/kernel.h>
 #include <sys/proc.h>  #include <sys/proc.h>
   #include <sys/pool.h>
   
 #include <vm/vm.h>  #include <vm/vm.h>
 #include <sys/sysctl.h>  #include <sys/sysctl.h>
Line 165  u_int16_t ip_id;
Line 166  u_int16_t ip_id;
 int     ip_defttl;  int     ip_defttl;
 struct ipqhead ipq;  struct ipqhead ipq;
   
   struct pool ipqent_pool;
   
 /*  /*
  * We need to save the IP options in case a protocol wants to respond   * We need to save the IP options in case a protocol wants to respond
  * to an incoming packet over the same route if the packet got here   * to an incoming packet over the same route if the packet got here
Line 192  ip_init()
Line 195  ip_init()
         register struct protosw *pr;          register struct protosw *pr;
         register int i;          register int i;
   
           pool_init(&ipqent_pool, sizeof(struct ipqent), 0, 0, 0, "ipqepl",
               0, NULL, NULL, M_IPQ);
   
         pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW);          pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW);
         if (pr == 0)          if (pr == 0)
                 panic("ip_init");                  panic("ip_init");
Line 492  found:
Line 498  found:
                  */                   */
                 if (mff || ip->ip_off) {                  if (mff || ip->ip_off) {
                         ipstat.ips_fragments++;                          ipstat.ips_fragments++;
                         MALLOC(ipqe, struct ipqent *, sizeof (struct ipqent),                          ipqe = pool_get(&ipqent_pool, PR_NOWAIT);
                             M_IPQ, M_NOWAIT);  
                         if (ipqe == NULL) {                          if (ipqe == NULL) {
                                 ipstat.ips_rcvmemdrop++;                                  ipstat.ips_rcvmemdrop++;
                                 goto bad;                                  goto bad;
Line 609  ip_reass(ipqe, fp)
Line 614  ip_reass(ipqe, fp)
                 nq = q->ipqe_q.le_next;                  nq = q->ipqe_q.le_next;
                 m_freem(q->ipqe_m);                  m_freem(q->ipqe_m);
                 LIST_REMOVE(q, ipqe_q);                  LIST_REMOVE(q, ipqe_q);
                 FREE(q, M_IPQ);                  pool_put(&ipqent_pool, q);
         }          }
   
 insert:  insert:
Line 648  insert:
Line 653  insert:
         m->m_next = 0;          m->m_next = 0;
         m_cat(m, t);          m_cat(m, t);
         nq = q->ipqe_q.le_next;          nq = q->ipqe_q.le_next;
         FREE(q, M_IPQ);          pool_put(&ipqent_pool, q);
         for (q = nq; q != NULL; q = nq) {          for (q = nq; q != NULL; q = nq) {
                 t = q->ipqe_m;                  t = q->ipqe_m;
                 nq = q->ipqe_q.le_next;                  nq = q->ipqe_q.le_next;
                 FREE(q, M_IPQ);                  pool_put(&ipqent_pool, q);
                 m_cat(m, t);                  m_cat(m, t);
         }          }
   
Line 681  insert:
Line 686  insert:
 dropfrag:  dropfrag:
         ipstat.ips_fragdropped++;          ipstat.ips_fragdropped++;
         m_freem(m);          m_freem(m);
         FREE(ipqe, M_IPQ);          pool_put(&ipqent_pool, ipqe);
         return (0);          return (0);
 }  }
   
Line 699  ip_freef(fp)
Line 704  ip_freef(fp)
                 p = q->ipqe_q.le_next;                  p = q->ipqe_q.le_next;
                 m_freem(q->ipqe_m);                  m_freem(q->ipqe_m);
                 LIST_REMOVE(q, ipqe_q);                  LIST_REMOVE(q, ipqe_q);
                 FREE(q, M_IPQ);                  pool_put(&ipqent_pool, q);
         }          }
         LIST_REMOVE(fp, ipq_q);          LIST_REMOVE(fp, ipq_q);
         FREE(fp, M_FTABLE);          FREE(fp, M_FTABLE);

Legend:
Removed from v.1.71  
changed lines
  Added in v.1.72

CVSweb <webmaster@jp.NetBSD.org>