diff options
author | ume <ume@FreeBSD.org> | 2003-10-29 12:49:12 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-10-29 12:49:12 +0000 |
commit | bde54b9152c6e052b2d02175676d7eeac29baa99 (patch) | |
tree | 33ddeba020bb7d9d7051a738bcf89b9ae9dcde66 | |
parent | 7020f8aa301ee772c5798cb453325a3f294c8b58 (diff) | |
download | FreeBSD-src-bde54b9152c6e052b2d02175676d7eeac29baa99.zip FreeBSD-src-bde54b9152c6e052b2d02175676d7eeac29baa99.tar.gz |
hide m_tag, again.
Requested by: sam
-rw-r--r-- | sys/netinet6/ip6_input.c | 48 | ||||
-rw-r--r-- | sys/netinet6/ip6_var.h | 4 | ||||
-rw-r--r-- | sys/netinet6/route6.c | 7 |
3 files changed, 21 insertions, 38 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index e068928..10b9823 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -157,7 +157,7 @@ int ip6_fw_enable = 1; struct ip6stat ip6stat; static void ip6_init2 __P((void *)); -static struct m_tag *ip6_setdstifaddr __P((struct mbuf *, struct in6_ifaddr *)); +static struct ip6aux *ip6_setdstifaddr __P((struct mbuf *, struct in6_ifaddr *)); static int ip6_hopopts_input __P((u_int32_t *, u_int32_t *, struct mbuf **, int *)); #ifdef PULLDOWN_TEST static struct mbuf *ip6_pullexthdr __P((struct mbuf *, size_t, int)); @@ -719,7 +719,7 @@ ip6_input(m) } else if (!ours) { ip6_forward(m, srcrt); return; - } + } ip6 = mtod(m, struct ip6_hdr *); @@ -762,22 +762,6 @@ ip6_input(m) goto bad; } -#if 0 - /* - * do we need to do it for every header? yeah, other - * functions can play with it (like re-allocate and copy). - */ - mhist = ip6_addaux(m); - if (mhist && M_TRAILINGSPACE(mhist) >= sizeof(nxt)) { - hist = mtod(mhist, caddr_t) + mhist->m_len; - bcopy(&nxt, hist, sizeof(nxt)); - mhist->m_len += sizeof(nxt); - } else { - ip6stat.ip6s_toomanyhdr++; - goto bad; - } -#endif - #ifdef IPSEC /* * enforce IPsec policy checking if we are seeing last header. @@ -801,28 +785,28 @@ ip6_input(m) * set/grab in6_ifaddr correspond to IPv6 destination address. * XXX backward compatibility wrapper */ -static struct m_tag * +static struct ip6aux * ip6_setdstifaddr(m, ia6) struct mbuf *m; struct in6_ifaddr *ia6; { - struct m_tag *mtag; + struct ip6aux *ip6a; - mtag = ip6_addaux(m); - if (mtag) - ((struct ip6aux *)(mtag + 1))->ip6a_dstia6 = ia6; - return mtag; /* NULL if failed to set */ + ip6a = ip6_addaux(m); + if (ip6a) + ip6a->ip6a_dstia6 = ia6; + return ip6a; /* NULL if failed to set */ } struct in6_ifaddr * ip6_getdstifaddr(m) struct mbuf *m; { - struct m_tag *mtag; + struct ip6aux *ip6a; - mtag = ip6_findaux(m); - if (mtag) - return ((struct ip6aux *)(mtag + 1))->ip6a_dstia6; + ip6a = ip6_findaux(m); + if (ip6a) + return ip6a->ip6a_dstia6; else return NULL; } @@ -1537,7 +1521,7 @@ ip6_lasthdr(m, off, proto, nxtp) } } -struct m_tag * +struct ip6aux * ip6_addaux(m) struct mbuf *m; { @@ -1552,17 +1536,17 @@ ip6_addaux(m) bzero(mtag + 1, sizeof(struct ip6aux)); } } - return mtag; + return mtag ? (struct ip6aux *)(mtag + 1) : NULL; } -struct m_tag * +struct ip6aux * ip6_findaux(m) struct mbuf *m; { struct m_tag *mtag; mtag = m_tag_find(m, PACKET_TAG_IPV6_INPUT, NULL); - return mtag; + return mtag ? (struct ip6aux *)(mtag + 1) : NULL; } void diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 8206755..6edaa1c 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -345,8 +345,8 @@ char * ip6_get_prevhdr __P((struct mbuf *, int)); int ip6_nexthdr __P((struct mbuf *, int, int, int *)); int ip6_lasthdr __P((struct mbuf *, int, int, int *)); -struct m_tag *ip6_addaux __P((struct mbuf *)); -struct m_tag *ip6_findaux __P((struct mbuf *)); +struct ip6aux *ip6_addaux __P((struct mbuf *)); +struct ip6aux *ip6_findaux __P((struct mbuf *)); void ip6_delaux __P((struct mbuf *)); int ip6_mforward __P((struct ip6_hdr *, struct ifnet *, struct mbuf *)); diff --git a/sys/netinet6/route6.c b/sys/netinet6/route6.c index 567d0ba..c4b0f61 100644 --- a/sys/netinet6/route6.c +++ b/sys/netinet6/route6.c @@ -60,11 +60,10 @@ route6_input(mp, offp, proto) struct mbuf *m = *mp; struct ip6_rthdr *rh; int off = *offp, rhlen; - struct m_tag *mtag; + struct ip6aux *ip6a; - mtag = ip6_findaux(m); - if (mtag) { - struct ip6aux *ip6a = (struct ip6aux *)(mtag + 1); + ip6a = ip6_findaux(m); + if (ip6a) { /* XXX reject home-address option before rthdr */ if (ip6a->ip6a_flags & IP6A_SWAP) { ip6stat.ip6s_badoptions++; |