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

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

Diff for /src/sys/netinet6/ip6_input.c between version 1.78.2.5 and 1.94.2.5

version 1.78.2.5, 2007/10/27 11:36:12 version 1.94.2.5, 2007/05/17 13:41:51
Line 136  static int ip6qmaxlen = IFQ_MAXLEN;
Line 136  static int ip6qmaxlen = IFQ_MAXLEN;
 struct in6_ifaddr *in6_ifaddr;  struct in6_ifaddr *in6_ifaddr;
 struct ifqueue ip6intrq;  struct ifqueue ip6intrq;
   
 extern callout_t in6_tmpaddrtimer_ch;  extern struct callout in6_tmpaddrtimer_ch;
   
 int ip6_forward_srcrt;                  /* XXX */  int ip6_forward_srcrt;                  /* XXX */
 int ip6_sourcecheck;                    /* XXX */  int ip6_sourcecheck;                    /* XXX */
Line 148  struct pfil_head inet6_pfil_hook;
Line 148  struct pfil_head inet6_pfil_hook;
   
 struct ip6stat ip6stat;  struct ip6stat ip6stat;
   
 static void ip6_init2(void *);  static void ip6_init2 __P((void *));
 static struct m_tag *ip6_setdstifaddr __P((struct mbuf *, struct in6_ifaddr *));  static struct m_tag *ip6_setdstifaddr __P((struct mbuf *, struct in6_ifaddr *));
   
 static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *);  static int ip6_hopopts_input __P((u_int32_t *, u_int32_t *, struct mbuf **, int *));
 static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int);  static struct mbuf *ip6_pullexthdr __P((struct mbuf *, size_t, int));
   
 /*  /*
  * IP6 initialization: fill in IP6 protocol switch table.   * IP6 initialization: fill in IP6 protocol switch table.
Line 202  ip6_init2(void *dummy)
Line 202  ip6_init2(void *dummy)
 {  {
   
         /* nd6_timer_init */          /* nd6_timer_init */
         callout_init(&nd6_timer_ch, 0);          callout_init(&nd6_timer_ch);
         callout_reset(&nd6_timer_ch, hz, nd6_timer, NULL);          callout_reset(&nd6_timer_ch, hz, nd6_timer, NULL);
   
         /* timer for regeneranation of temporary addresses randomize ID */          /* timer for regeneranation of temporary addresses randomize ID */
         callout_init(&in6_tmpaddrtimer_ch, 0);          callout_init(&in6_tmpaddrtimer_ch);
         callout_reset(&in6_tmpaddrtimer_ch,          callout_reset(&in6_tmpaddrtimer_ch,
                       (ip6_temp_preferred_lifetime - ip6_desync_factor -                        (ip6_temp_preferred_lifetime - ip6_desync_factor -
                        ip6_temp_regen_advance) * hz,                         ip6_temp_regen_advance) * hz,
Line 490  ip6_input(struct mbuf *m)
Line 490  ip6_input(struct mbuf *m)
         else          else
                 ip6stat.ip6s_forward_cachemiss++;                  ip6stat.ip6s_forward_cachemiss++;
   
 #define rt6_getkey(__rt) satocsin6(rt_getkey(__rt))  #define rt6_key(r) ((struct sockaddr_in6 *)((r)->rt_nodes->rn_key))
   
         /*          /*
          * Accept the packet if the forwarding interface to the destination           * Accept the packet if the forwarding interface to the destination
Line 510  ip6_input(struct mbuf *m)
Line 510  ip6_input(struct mbuf *m)
              * the destination and the key of the rtentry has               * the destination and the key of the rtentry has
              * already done through looking up the routing table.               * already done through looking up the routing table.
              */               */
             IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &rt6_getkey(rt)->sin6_addr) &&              IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &rt6_key(rt)->sin6_addr) &&
 #endif  #endif
             rt->rt_ifp->if_type == IFT_LOOP) {              rt->rt_ifp->if_type == IFT_LOOP) {
                 struct in6_ifaddr *ia6 = (struct in6_ifaddr *)rt->rt_ifa;                  struct in6_ifaddr *ia6 = (struct in6_ifaddr *)rt->rt_ifa;
Line 590  ip6_input(struct mbuf *m)
Line 590  ip6_input(struct mbuf *m)
          * as our interface address (e.g. multicast addresses, addresses           * as our interface address (e.g. multicast addresses, addresses
          * within FAITH prefixes and such).           * within FAITH prefixes and such).
          */           */
         if (deliverifp && ip6_getdstifaddr(m) == NULL) {          if (deliverifp && !ip6_getdstifaddr(m)) {
                 struct in6_ifaddr *ia6;                  struct in6_ifaddr *ia6;
   
                 ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst);                  ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst);
                 if (ia6 != NULL && ip6_setdstifaddr(m, ia6) == NULL) {                  if (ia6) {
                         /*                          if (!ip6_setdstifaddr(m, ia6)) {
                          * XXX maybe we should drop the packet here,                                  /*
                          * as we could not provide enough information                                   * XXX maybe we should drop the packet here,
                          * to the upper layers.                                   * as we could not provide enough information
                          */                                   * to the upper layers.
                                    */
                           }
                 }                  }
         }          }
   
Line 808  ip6_input(struct mbuf *m)
Line 810  ip6_input(struct mbuf *m)
                         /* XXX error stat??? */                          /* XXX error stat??? */
                         error = EINVAL;                          error = EINVAL;
                         DPRINTF(("ip6_input: no SP, packet discarded\n"));/*XXX*/                          DPRINTF(("ip6_input: no SP, packet discarded\n"));/*XXX*/
                           goto bad;
                 }                  }
                 splx(s);                  splx(s);
                 if (error)                  if (error)
Line 827  ip6_input(struct mbuf *m)
Line 830  ip6_input(struct mbuf *m)
  * set/grab in6_ifaddr correspond to IPv6 destination address.   * set/grab in6_ifaddr correspond to IPv6 destination address.
  */   */
 static struct m_tag *  static struct m_tag *
 ip6_setdstifaddr(struct mbuf *m, struct in6_ifaddr *ia6)  ip6_setdstifaddr(m, ia6)
           struct mbuf *m;
           struct in6_ifaddr *ia6;
 {  {
         struct m_tag *mtag;          struct m_tag *mtag;
   
Line 838  ip6_setdstifaddr(struct mbuf *m, struct 
Line 843  ip6_setdstifaddr(struct mbuf *m, struct 
 }  }
   
 struct in6_ifaddr *  struct in6_ifaddr *
 ip6_getdstifaddr(struct mbuf *m)  ip6_getdstifaddr(m)
           struct mbuf *m;
 {  {
         struct m_tag *mtag;          struct m_tag *mtag;
   
Line 852  ip6_getdstifaddr(struct mbuf *m)
Line 858  ip6_getdstifaddr(struct mbuf *m)
 /*  /*
  * Hop-by-Hop options header processing. If a valid jumbo payload option is   * Hop-by-Hop options header processing. If a valid jumbo payload option is
  * included, the real payload length will be stored in plenp.   * included, the real payload length will be stored in plenp.
  *  
  * rtalertp - XXX: should be stored more smart way  
  */   */
 static int  static int
 ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp,  ip6_hopopts_input(plenp, rtalertp, mp, offp)
         struct mbuf **mp, int *offp)          u_int32_t *plenp;
           u_int32_t *rtalertp;    /* XXX: should be stored more smart way */
           struct mbuf **mp;
           int *offp;
 {  {
         struct mbuf *m = *mp;          struct mbuf *m = *mp;
         int off = *offp, hbhlen;          int off = *offp, hbhlen;
Line 901  ip6_hopopts_input(u_int32_t *plenp, u_in
Line 908  ip6_hopopts_input(u_int32_t *plenp, u_in
  * opthead + hbhlen is located in continuous memory region.   * opthead + hbhlen is located in continuous memory region.
  */   */
 int  int
 ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen,  ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp)
         u_int32_t *rtalertp, u_int32_t *plenp)          struct mbuf *m;
           u_int8_t *opthead;
           int hbhlen;
           u_int32_t *rtalertp;
           u_int32_t *plenp;
 {  {
         struct ip6_hdr *ip6;          struct ip6_hdr *ip6;
         int optlen = 0;          int optlen = 0;
Line 1034  ip6_process_hopopts(struct mbuf *m, u_in
Line 1045  ip6_process_hopopts(struct mbuf *m, u_in
  * is not continuous in order to return an ICMPv6 error.   * is not continuous in order to return an ICMPv6 error.
  */   */
 int  int
 ip6_unknown_opt(u_int8_t *optp, struct mbuf *m, int off)  ip6_unknown_opt(optp, m, off)
           u_int8_t *optp;
           struct mbuf *m;
           int off;
 {  {
         struct ip6_hdr *ip6;          struct ip6_hdr *ip6;
   
Line 1076  ip6_unknown_opt(u_int8_t *optp, struct m
Line 1090  ip6_unknown_opt(u_int8_t *optp, struct m
  * you are using IP6_EXTHDR_CHECK() not m_pulldown())   * you are using IP6_EXTHDR_CHECK() not m_pulldown())
  */   */
 void  void
 ip6_savecontrol(struct in6pcb *in6p, struct mbuf **mp,  ip6_savecontrol(in6p, mp, ip6, m)
         struct ip6_hdr *ip6, struct mbuf *m)          struct in6pcb *in6p;
           struct mbuf **mp;
           struct ip6_hdr *ip6;
           struct mbuf *m;
 {  {
 #ifdef RFC2292  #ifdef RFC2292
 #define IS2292(x, y)    ((in6p->in6p_flags & IN6P_RFC2292) ? (x) : (y))  #define IS2292(x, y)    ((in6p->in6p_flags & IN6P_RFC2292) ? (x) : (y))
Line 1334  ip6_notify_pmtu(struct in6pcb *in6p, con
Line 1351  ip6_notify_pmtu(struct in6pcb *in6p, con
  * contains the result, or NULL on error.   * contains the result, or NULL on error.
  */   */
 static struct mbuf *  static struct mbuf *
 ip6_pullexthdr(struct mbuf *m, size_t off, int nxt)  ip6_pullexthdr(m, off, nxt)
           struct mbuf *m;
           size_t off;
           int nxt;
 {  {
         struct ip6_ext ip6e;          struct ip6_ext ip6e;
         size_t elen;          size_t elen;
Line 1393  ip6_pullexthdr(struct mbuf *m, size_t of
Line 1413  ip6_pullexthdr(struct mbuf *m, size_t of
  * we develop `neater' mechanism to process extension headers.   * we develop `neater' mechanism to process extension headers.
  */   */
 u_int8_t *  u_int8_t *
 ip6_get_prevhdr(struct mbuf *m, int off)  ip6_get_prevhdr(m, off)
           struct mbuf *m;
           int off;
 {  {
         struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);          struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
   
Line 1432  ip6_get_prevhdr(struct mbuf *m, int off)
Line 1454  ip6_get_prevhdr(struct mbuf *m, int off)
  * get next header offset.  m will be retained.   * get next header offset.  m will be retained.
  */   */
 int  int
 ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp)  ip6_nexthdr(m, off, proto, nxtp)
           struct mbuf *m;
           int off;
           int proto;
           int *nxtp;
 {  {
         struct ip6_hdr ip6;          struct ip6_hdr ip6;
         struct ip6_ext ip6e;          struct ip6_ext ip6e;
Line 1511  ip6_nexthdr(struct mbuf *m, int off, int
Line 1537  ip6_nexthdr(struct mbuf *m, int off, int
  * get offset for the last header in the chain.  m will be kept untainted.   * get offset for the last header in the chain.  m will be kept untainted.
  */   */
 int  int
 ip6_lasthdr(struct mbuf *m, int off, int proto, int *nxtp)  ip6_lasthdr(m, off, proto, nxtp)
           struct mbuf *m;
           int off;
           int proto;
           int *nxtp;
 {  {
         int newoff;          int newoff;
         int nxt;          int nxt;
Line 1535  ip6_lasthdr(struct mbuf *m, int off, int
Line 1565  ip6_lasthdr(struct mbuf *m, int off, int
 }  }
   
 struct m_tag *  struct m_tag *
 ip6_addaux(struct mbuf *m)  ip6_addaux(m)
           struct mbuf *m;
 {  {
         struct m_tag *mtag;          struct m_tag *mtag;
   
Line 1552  ip6_addaux(struct mbuf *m)
Line 1583  ip6_addaux(struct mbuf *m)
 }  }
   
 struct m_tag *  struct m_tag *
 ip6_findaux(struct mbuf *m)  ip6_findaux(m)
           struct mbuf *m;
 {  {
         struct m_tag *mtag;          struct m_tag *mtag;
   
Line 1561  ip6_findaux(struct mbuf *m)
Line 1593  ip6_findaux(struct mbuf *m)
 }  }
   
 void  void
 ip6_delaux(struct mbuf *m)  ip6_delaux(m)
           struct mbuf *m;
 {  {
         struct m_tag *mtag;          struct m_tag *mtag;
   

Legend:
Removed from v.1.78.2.5  
changed lines
  Added in v.1.94.2.5

CVSweb <webmaster@jp.NetBSD.org>