Skip to content

Commit

Permalink
- configCv4() and configCv6() returns real payload number or
Browse files Browse the repository at this point in the history
  IPPROTO_IP.  Packet passes to the next process when value of
  IPPROTO_IP was returned.
  • Loading branch information
fujisawa committed Jul 15, 2001
1 parent 7d58bc7 commit 4015ce9
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions kame/sys/netinet6/natpt_dispatch.c
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: natpt_dispatch.c,v 1.23 2001/07/15 09:42:33 fujisawa Exp $ */ /* $KAME: natpt_dispatch.c,v 1.24 2001/07/15 19:34:05 fujisawa Exp $ */


/* /*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -284,8 +284,8 @@ natpt_incomingIPv4(int sess, struct ifBox *ifb, struct mbuf *m4, struct mbuf **m
struct _fragment *frg = NULL; struct _fragment *frg = NULL;
#endif #endif


if ((rv = configCv4(sess, m4, &cv)) == IPPROTO_MAX) if ((rv = configCv4(sess, m4, &cv)) == IPPROTO_IP)
return (IPPROTO_MAX); /* discard this packet */ return (rv); /* goto the following process */


if ((rv = sanityCheckIn4(&cv)) != IPPROTO_IPV4) if ((rv = sanityCheckIn4(&cv)) != IPPROTO_IPV4)
return (IPPROTO_DONE); /* discard this packet without free */ return (IPPROTO_DONE); /* discard this packet without free */
Expand Down Expand Up @@ -395,8 +395,8 @@ natpt_outgoingIPv4(int sess, struct ifBox *ifb, struct mbuf *m4, struct mbuf **m
struct _fragment *frg = NULL; struct _fragment *frg = NULL;
#endif #endif


if ((rv = configCv4(sess, m4, &cv)) == IPPROTO_MAX) if ((rv = configCv4(sess, m4, &cv)) == IPPROTO_IP)
return (IPPROTO_MAX); /* discard this packet */ return (rv); /* goto the following process */


#if defined(NATPT_NAT) && defined(NATPT_FRAGMENT) #if defined(NATPT_NAT) && defined(NATPT_FRAGMENT)
ip4 = mtod(m4, struct ip *); ip4 = mtod(m4, struct ip *);
Expand Down Expand Up @@ -502,9 +502,8 @@ natpt_incomingIPv6(int sess, struct ifBox *ifb, struct mbuf *m6, struct mbuf **m
struct _cSlot *acs; struct _cSlot *acs;
struct ip6_hdr *ip6; struct ip6_hdr *ip6;


rv = configCv6(sess, m6, &cv); if ((rv = configCv6(sess, m6, &cv)) == IPPROTO_IP)
if ((rv == IPPROTO_IP) || (rv == IPPROTO_MAX) || (rv == IPPROTO_DONE)) return (rv); /* goto the following process */
return (rv);


if ((cv.ats = lookingForIncomingV6Hash(&cv)) == NULL) if ((cv.ats = lookingForIncomingV6Hash(&cv)) == NULL)
{ {
Expand Down Expand Up @@ -538,9 +537,8 @@ natpt_outgoingIPv6(int sess, struct ifBox *ifb, struct mbuf *m6, struct mbuf **m
struct _cv cv6; struct _cv cv6;
struct _cSlot *acs; struct _cSlot *acs;


rv = configCv6(sess, m6, &cv6); if ((rv = configCv6(sess, m6, &cv6)) == IPPROTO_IP)
if ((rv == IPPROTO_IP) || (rv == IPPROTO_MAX) || (rv == IPPROTO_DONE)) return (rv); /* goto the following process */
return (rv);


if ((rv = sanityCheckOut6(&cv6)) != IPPROTO_IPV6) if ((rv = sanityCheckOut6(&cv6)) != IPPROTO_IPV6)
return (IPPROTO_DONE); /* discard this packet */ return (IPPROTO_DONE); /* discard this packet */
Expand Down Expand Up @@ -589,7 +587,7 @@ configCv4(int sess, struct mbuf *m, struct _cv *cv)
return (ip->ip_p); return (ip->ip_p);
} }


return (IPPROTO_MAX); return (IPPROTO_IP);
} }




Expand Down Expand Up @@ -624,7 +622,7 @@ configCv6(int sess, struct mbuf *m, struct _cv *cv)
} }
} }


return (proto); return (IPPROTO_IP);
} }




Expand Down

0 comments on commit 4015ce9

Please sign in to comment.