[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.130 and 1.131

version 1.130, 2001/03/02 04:26:10 version 1.131, 2001/03/27 02:24:38
Line 211  struct pfil_head inet_pfil_hook;
Line 211  struct pfil_head inet_pfil_hook;
   
 struct ipqhead ipq;  struct ipqhead ipq;
 int     ipq_locked;  int     ipq_locked;
   int     ip_nfragpackets = 0;
   int     ip_maxfragpackets = -1;
   
 static __inline int ipq_lock_try __P((void));  static __inline int ipq_lock_try __P((void));
 static __inline void ipq_unlock __P((void));  static __inline void ipq_unlock __P((void));
Line 781  ip_reass(ipqe, fp)
Line 783  ip_reass(ipqe, fp)
          * If first fragment to arrive, create a reassembly queue.           * If first fragment to arrive, create a reassembly queue.
          */           */
         if (fp == 0) {          if (fp == 0) {
                   /*
                    * Enforce upper bound on number of fragmented packets
                    * for which we attempt reassembly;
                    * If maxfrag is 0, never accept fragments.
                    * If maxfrag is -1, accept all fragments without limitation.
                    */
                   if (ip_maxfragpackets < 0)
                           ;
                   else if (ip_nfragpackets >= ip_maxfragpackets)
                           goto dropfrag;
                   ip_nfragpackets++;
                 MALLOC(fp, struct ipq *, sizeof (struct ipq),                  MALLOC(fp, struct ipq *, sizeof (struct ipq),
                     M_FTABLE, M_NOWAIT);                      M_FTABLE, M_NOWAIT);
                 if (fp == NULL)                  if (fp == NULL)
Line 896  insert:
Line 909  insert:
         ip->ip_dst = fp->ipq_dst;          ip->ip_dst = fp->ipq_dst;
         LIST_REMOVE(fp, ipq_q);          LIST_REMOVE(fp, ipq_q);
         FREE(fp, M_FTABLE);          FREE(fp, M_FTABLE);
           ip_nfragpackets--;
         m->m_len += (ip->ip_hl << 2);          m->m_len += (ip->ip_hl << 2);
         m->m_data -= (ip->ip_hl << 2);          m->m_data -= (ip->ip_hl << 2);
         /* some debugging cruft by sklower, below, will go away soon */          /* some debugging cruft by sklower, below, will go away soon */
Line 934  ip_freef(fp)
Line 948  ip_freef(fp)
         }          }
         LIST_REMOVE(fp, ipq_q);          LIST_REMOVE(fp, ipq_q);
         FREE(fp, M_FTABLE);          FREE(fp, M_FTABLE);
           ip_nfragpackets--;
 }  }
   
 /*  /*
Line 955  ip_slowtimo()
Line 970  ip_slowtimo()
                         ip_freef(fp);                          ip_freef(fp);
                 }                  }
         }          }
           /*
            * If we are over the maximum number of fragments
            * (due to the limit being lowered), drain off
            * enough to get down to the new limit.
            */
           if (ip_maxfragpackets < 0)
                   ;
           else {
                   while (ip_nfragpackets > ip_maxfragpackets && ipq.lh_first)
                           ip_freef(ipq.lh_first);
           }
         IPQ_UNLOCK();          IPQ_UNLOCK();
 #ifdef GATEWAY  #ifdef GATEWAY
         ipflow_slowtimo();          ipflow_slowtimo();
Line 1791  ip_sysctl(name, namelen, oldp, oldlenp, 
Line 1817  ip_sysctl(name, namelen, oldp, oldlenp, 
                 return (error);                  return (error);
 #endif  #endif
   
           case IPCTL_MAXFRAGPACKETS:
                   return (sysctl_int(oldp, oldlenp, newp, newlen,
                       &ip_maxfragpackets));
   
         default:          default:
                 return (EOPNOTSUPP);                  return (EOPNOTSUPP);
         }          }

Legend:
Removed from v.1.130  
changed lines
  Added in v.1.131

CVSweb <webmaster@jp.NetBSD.org>