[BACK]Return to raw_ip.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/raw_ip.c between version 1.171.2.1 and 1.171.2.2

version 1.171.2.1, 2018/03/22 01:44:51 version 1.171.2.2, 2018/04/16 02:00:08
Line 138  rip_init(void)
Line 138  rip_init(void)
   
 static void  static void
 rip_sbappendaddr(struct inpcb *last, struct ip *ip, const struct sockaddr *sa,  rip_sbappendaddr(struct inpcb *last, struct ip *ip, const struct sockaddr *sa,
     int hlen, struct mbuf *opts, struct mbuf *n)      int hlen, struct mbuf *n)
 {  {
           struct mbuf *opts = NULL;
   
         if (last->inp_flags & INP_NOHEADER)          if (last->inp_flags & INP_NOHEADER)
                 m_adj(n, hlen);                  m_adj(n, hlen);
         if (last->inp_flags & INP_CONTROLOPTS          if (last->inp_flags & INP_CONTROLOPTS ||
             || SOOPT_TIMESTAMP(last->inp_socket->so_options))              SOOPT_TIMESTAMP(last->inp_socket->so_options))
                 ip_savecontrol(last, &opts, ip, n);                  ip_savecontrol(last, &opts, ip, n);
         if (sbappendaddr(&last->inp_socket->so_rcv, sa, n, opts) == 0) {          if (sbappendaddr(&last->inp_socket->so_rcv, sa, n, opts) == 0) {
                 soroverflow(last->inp_socket);                  soroverflow(last->inp_socket);
                 m_freem(n);                  m_freem(n);
                 if (opts)                  if (opts)
                         m_freem(opts);                          m_freem(opts);
         } else          } else {
                 sorwakeup(last->inp_socket);                  sorwakeup(last->inp_socket);
           }
 }  }
   
 /*  /*
Line 167  rip_input(struct mbuf *m, ...)
Line 170  rip_input(struct mbuf *m, ...)
         struct inpcb_hdr *inph;          struct inpcb_hdr *inph;
         struct inpcb *inp;          struct inpcb *inp;
         struct inpcb *last = NULL;          struct inpcb *last = NULL;
         struct mbuf *n, *opts = NULL;          struct mbuf *n;
         struct sockaddr_in ripsrc;          struct sockaddr_in ripsrc;
         va_list ap;          va_list ap;
   
Line 199  rip_input(struct mbuf *m, ...)
Line 202  rip_input(struct mbuf *m, ...)
                 if (!in_nullhost(inp->inp_faddr) &&                  if (!in_nullhost(inp->inp_faddr) &&
                     !in_hosteq(inp->inp_faddr, ip->ip_src))                      !in_hosteq(inp->inp_faddr, ip->ip_src))
                         continue;                          continue;
                 if (last == NULL)  
                   if (last == NULL) {
                         ;                          ;
                   }
 #if defined(IPSEC)  #if defined(IPSEC)
                 /* check AH/ESP integrity. */  
                 else if (ipsec_used && ipsec_in_reject(m, last)) {                  else if (ipsec_used && ipsec_in_reject(m, last)) {
                         /* do not inject data to pcb */                          /* do not inject data into pcb */
                 }                  }
 #endif /*IPSEC*/  #endif
                 else if ((n = m_copypacket(m, M_DONTWAIT)) != NULL) {                  else if ((n = m_copypacket(m, M_DONTWAIT)) != NULL) {
                         rip_sbappendaddr(last, ip, sintosa(&ripsrc), hlen, opts,                          rip_sbappendaddr(last, ip, sintosa(&ripsrc), hlen, n);
                             n);  
                         opts = NULL;  
                 }                  }
   
                 last = inp;                  last = inp;
         }          }
   
 #if defined(IPSEC)  #if defined(IPSEC)
         /* check AH/ESP integrity. */  
         if (ipsec_used && last != NULL && ipsec_in_reject(m, last)) {          if (ipsec_used && last != NULL && ipsec_in_reject(m, last)) {
                 m_freem(m);                  m_freem(m);
                 IP_STATDEC(IP_STAT_DELIVERED);                  IP_STATDEC(IP_STAT_DELIVERED);
                 /* do not inject data to pcb */                  /* do not inject data into pcb */
         } else          } else
 #endif /*IPSEC*/  #endif
         if (last != NULL)          if (last != NULL) {
                 rip_sbappendaddr(last, ip, sintosa(&ripsrc), hlen, opts, m);                  rip_sbappendaddr(last, ip, sintosa(&ripsrc), hlen, m);
         else if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) {          } else if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) {
                 uint64_t *ips;                  uint64_t *ips;
   
                 icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PROTOCOL,                  icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PROTOCOL,
Line 233  rip_input(struct mbuf *m, ...)
Line 236  rip_input(struct mbuf *m, ...)
                 ips[IP_STAT_NOPROTO]++;                  ips[IP_STAT_NOPROTO]++;
                 ips[IP_STAT_DELIVERED]--;                  ips[IP_STAT_DELIVERED]--;
                 IP_STAT_PUTREF();                  IP_STAT_PUTREF();
         } else          } else {
                 m_freem(m);                  m_freem(m);
           }
   
         return;          return;
 }  }
   

Legend:
Removed from v.1.171.2.1  
changed lines
  Added in v.1.171.2.2

CVSweb <webmaster@jp.NetBSD.org>