[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.298.2.1 and 1.303

version 1.298.2.1, 2018/02/09 14:09:35 version 1.303, 2012/11/29 02:07:20
Line 139  __KERNEL_RCSID(0, "$NetBSD$");
Line 139  __KERNEL_RCSID(0, "$NetBSD$");
 #ifdef MROUTING  #ifdef MROUTING
 #include <netinet/ip_mroute.h>  #include <netinet/ip_mroute.h>
 #endif  #endif
   #include <netinet/portalgo.h>
   
 #ifdef KAME_IPSEC  
 #include <netinet6/ipsec.h>  
 #include <netinet6/ipsec_private.h>  
 #include <netkey/key.h>  
 #endif  
 #ifdef FAST_IPSEC  #ifdef FAST_IPSEC
 #include <netipsec/ipsec.h>  #include <netipsec/ipsec.h>
 #include <netipsec/key.h>  #include <netipsec/key.h>
Line 161  __KERNEL_RCSID(0, "$NetBSD$");
Line 157  __KERNEL_RCSID(0, "$NetBSD$");
 #define IPSENDREDIRECTS 1  #define IPSENDREDIRECTS 1
 #endif  #endif
 #ifndef IPFORWSRCRT  #ifndef IPFORWSRCRT
 #define IPFORWSRCRT     0       /* forward source-routed packets */  #define IPFORWSRCRT     1       /* forward source-routed packets */
 #endif  #endif
 #ifndef IPALLOWSRCRT  #ifndef IPALLOWSRCRT
 #define IPALLOWSRCRT    0       /* allow source-routed packets */  #define IPALLOWSRCRT    1       /* allow source-routed packets */
 #endif  #endif
 #ifndef IPMTUDISC  #ifndef IPMTUDISC
 #define IPMTUDISC       1  #define IPMTUDISC       1
Line 536  ip_input(struct mbuf *m)
Line 532  ip_input(struct mbuf *m)
                         m_adj(m, len - m->m_pkthdr.len);                          m_adj(m, len - m->m_pkthdr.len);
         }          }
   
 #if defined(KAME_IPSEC)  
         /* ipflow (IP fast forwarding) is not compatible with IPsec. */  
         m->m_flags &= ~M_CANFASTFWD;  
 #else  
         /*          /*
          * Assume that we can create a fast-forward IP flow entry           * Assume that we can create a fast-forward IP flow entry
          * based on this packet.           * based on this packet.
          */           */
         m->m_flags |= M_CANFASTFWD;          m->m_flags |= M_CANFASTFWD;
 #endif  
   
 #ifdef PFIL_HOOKS  #ifdef PFIL_HOOKS
         /*          /*
Line 559  ip_input(struct mbuf *m)
Line 550  ip_input(struct mbuf *m)
          * let ipfilter look at packet on the wire,           * let ipfilter look at packet on the wire,
          * not the decapsulated packet.           * not the decapsulated packet.
          */           */
 #ifdef KAME_IPSEC  #if defined(FAST_IPSEC)
         if (!ipsec_getnhist(m))  
 #elif defined(FAST_IPSEC)  
         if (!ipsec_indone(m))          if (!ipsec_indone(m))
 #else  #else
         if (1)          if (1)
Line 743  ip_input(struct mbuf *m)
Line 732  ip_input(struct mbuf *m)
                         IP_STATINC(IP_STAT_CANTFORWARD);                          IP_STATINC(IP_STAT_CANTFORWARD);
                         return;                          return;
                 }                  }
 #ifdef KAME_IPSEC  
                 if (ipsec4_in_reject(m, NULL)) {  
                         IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);  
                         goto bad;  
                 }  
 #endif  
 #ifdef FAST_IPSEC  #ifdef FAST_IPSEC
                 mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL);                  mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL);
                 s = splsoftnet();                  s = splsoftnet();
Line 826  ours:
Line 809  ours:
                 hlen = ip->ip_hl << 2;                  hlen = ip->ip_hl << 2;
         }          }
   
 #if defined(KAME_IPSEC)  
         /*  
          * enforce IPsec policy checking if we are seeing last header.  
          * note that we do not visit this with protocols with pcb layer  
          * code - like udp/tcp/raw ip.  
          */  
         if ((inetsw[ip_protox[ip->ip_p]].pr_flags & PR_LASTHDR) != 0 &&  
             ipsec4_in_reject(m, NULL)) {  
                 IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);  
                 goto bad;  
         }  
 #endif  
 #ifdef FAST_IPSEC  #ifdef FAST_IPSEC
         /*          /*
          * enforce IPsec policy checking if we are seeing last header.           * enforce IPsec policy checking if we are seeing last header.
Line 1452  ip_forward(struct mbuf *m, int srcrt)
Line 1423  ip_forward(struct mbuf *m, int srcrt)
                 if ((rt = rtcache_validate(&ipforward_rt)) != NULL)                  if ((rt = rtcache_validate(&ipforward_rt)) != NULL)
                         destmtu = rt->rt_ifp->if_mtu;                          destmtu = rt->rt_ifp->if_mtu;
   
 #if defined(KAME_IPSEC) || defined(FAST_IPSEC)  #if defined(FAST_IPSEC)
                 {                  {
                         /*                          /*
                          * If the packet is routed over IPsec tunnel, tell the                           * If the packet is routed over IPsec tunnel, tell the
Line 1494  ip_forward(struct mbuf *m, int srcrt)
Line 1465  ip_forward(struct mbuf *m, int srcrt)
                                         }                                          }
                                 }                                  }
   
 #ifdef  KAME_IPSEC  
                                 key_freesp(sp);  
 #else  
                                 KEY_FREESP(&sp);                                  KEY_FREESP(&sp);
 #endif  
                         }                          }
                 }                  }
 #endif /*defined(KAME_IPSEC) || defined(FAST_IPSEC)*/  #endif /*defined(FAST_IPSEC)*/
                 IP_STATINC(IP_STAT_CANTFRAG);                  IP_STATINC(IP_STAT_CANTFRAG);
                 break;                  break;
   
Line 1829  sysctl_net_inet_ip_setup(struct sysctllo
Line 1796  sysctl_net_inet_ip_setup(struct sysctllo
                        CTLFLAG_PERMANENT|CTLFLAG_READWRITE,                         CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                        CTLTYPE_INT, "mtudisctimeout",                         CTLTYPE_INT, "mtudisctimeout",
                        SYSCTL_DESCR("Lifetime of a Path MTU Discovered route"),                         SYSCTL_DESCR("Lifetime of a Path MTU Discovered route"),
                        sysctl_net_inet_ip_pmtudto, 0, &ip_mtudisc_timeout, 0,                         sysctl_net_inet_ip_pmtudto, 0, (void *)&ip_mtudisc_timeout, 0,
                        CTL_NET, PF_INET, IPPROTO_IP,                         CTL_NET, PF_INET, IPPROTO_IP,
                        IPCTL_MTUDISCTIMEOUT, CTL_EOL);                         IPCTL_MTUDISCTIMEOUT, CTL_EOL);
 #ifdef GATEWAY  #ifdef GATEWAY
Line 1920  sysctl_net_inet_ip_setup(struct sysctllo
Line 1887  sysctl_net_inet_ip_setup(struct sysctllo
                        sysctl_net_inet_ip_stats, 0, NULL, 0,                         sysctl_net_inet_ip_stats, 0, NULL, 0,
                        CTL_NET, PF_INET, IPPROTO_IP, IPCTL_STATS,                         CTL_NET, PF_INET, IPPROTO_IP, IPCTL_STATS,
                        CTL_EOL);                         CTL_EOL);
   
           /* anonportalgo RFC6056 subtree */
           const struct sysctlnode *portalgo_node;
           sysctl_createv(clog, 0, NULL, &portalgo_node,
                          CTLFLAG_PERMANENT,
                          CTLTYPE_NODE, "anonportalgo",
                          SYSCTL_DESCR("Anonymous Port Algorithm Selection (RFC 6056)"),
                          NULL, 0, NULL, 0,
                          CTL_NET, PF_INET, IPPROTO_IP, CTL_CREATE, CTL_EOL);
           sysctl_createv(clog, 0, &portalgo_node, NULL,
                          CTLFLAG_PERMANENT,
                          CTLTYPE_STRING, "available",
                          SYSCTL_DESCR("available algorithms"),
                          sysctl_portalgo_available, 0, NULL, PORTALGO_MAXLEN,
                          CTL_CREATE, CTL_EOL);
           sysctl_createv(clog, 0, &portalgo_node, NULL,
                          CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                          CTLTYPE_STRING, "selected",
                          SYSCTL_DESCR("selected algorithm"),
                          sysctl_portalgo_selected4, 0, NULL, PORTALGO_MAXLEN,
                          CTL_CREATE, CTL_EOL);
           sysctl_createv(clog, 0, &portalgo_node, NULL,
                          CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                          CTLTYPE_STRUCT, "reserve",
                          SYSCTL_DESCR("bitmap of reserved ports"),
                          sysctl_portalgo_reserve4, 0, NULL, 0,
                          CTL_CREATE, CTL_EOL);
 }  }
   
 void  void

Legend:
Removed from v.1.298.2.1  
changed lines
  Added in v.1.303

CVSweb <webmaster@jp.NetBSD.org>