diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-02-10 15:34:23 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-02-10 15:34:23 +0000 |
commit | 42462f3a4b95f56870005e9f46c22a32a9278d5b (patch) | |
tree | 5e947939e99718fe660b77b5ac5fbafce19cf528 /sys/netinet | |
parent | 3e9033756c2f1ae422c059eb8554e36d5655287c (diff) |
Cleanup, kill dead code and unused arguments. Mostly stuff that is computed
and passed around but never used. OK mglocker@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in_gif.c | 27 | ||||
-rw-r--r-- | sys/netinet/in_gif.h | 4 | ||||
-rw-r--r-- | sys/netinet/ip_ipip.c | 6 |
3 files changed, 12 insertions, 25 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index c2a73734bc7..b37c54719e9 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_gif.c,v 1.31 2005/12/23 13:01:23 claudio Exp $ */ +/* $OpenBSD: in_gif.c,v 1.32 2007/02/10 15:34:22 claudio Exp $ */ /* $KAME: in_gif.c,v 1.50 2001/01/22 07:27:16 itojun Exp $ */ /* @@ -54,11 +54,10 @@ #include "bridge.h" int -in_gif_output(ifp, family, m, rt) +in_gif_output(ifp, family, m) struct ifnet *ifp; int family; struct mbuf *m; - struct rtentry *rt; { struct gif_softc *sc = (struct gif_softc*)ifp; struct sockaddr_in *sin_src = (struct sockaddr_in *)sc->gif_psrc; @@ -66,7 +65,6 @@ in_gif_output(ifp, family, m, rt) struct tdb tdb; struct xformsw xfs; int error; - int hlen, poff; struct mbuf *mp; if (sin_src == NULL || sin_dst == NULL || @@ -90,18 +88,9 @@ in_gif_output(ifp, family, m, rt) switch (family) { case AF_INET: - if (m->m_len < sizeof(struct ip)) { - m = m_pullup(m, sizeof(struct ip)); - if (m == NULL) - return ENOBUFS; - } - hlen = (mtod(m, struct ip *)->ip_hl) << 2; - poff = offsetof(struct ip, ip_p); break; #ifdef INET6 case AF_INET6: - hlen = sizeof(struct ip6_hdr); - poff = offsetof(struct ip6_hdr, ip6_nxt); break; #endif #if NBRIDGE > 0 @@ -127,13 +116,14 @@ in_gif_output(ifp, family, m, rt) return EFAULT; m = mp; - goto sendit; + return ip_output(m, (void *)NULL, (void *)NULL, 0, + (void *)NULL, (void *)NULL); } #endif /* NBRIDGE */ /* encapsulate into IPv4 packet */ mp = NULL; - error = ipip_output(m, &tdb, &mp, hlen, poff); + error = ipip_output(m, &tdb, &mp, 0, 0); if (error) return error; else if (mp == NULL) @@ -141,11 +131,8 @@ in_gif_output(ifp, family, m, rt) m = mp; -#if NBRIDGE > 0 - sendit: -#endif /* NBRIDGE */ - - return ip_output(m, (void *)NULL, (void *)NULL, 0, (void *)NULL, (void *)NULL); + return ip_output(m, (void *)NULL, (void *)NULL, 0, (void *)NULL, + (void *)NULL); } void diff --git a/sys/netinet/in_gif.h b/sys/netinet/in_gif.h index f87ec08c077..3a12d06dd91 100644 --- a/sys/netinet/in_gif.h +++ b/sys/netinet/in_gif.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_gif.h,v 1.4 2002/03/14 01:27:11 millert Exp $ */ +/* $OpenBSD: in_gif.h,v 1.5 2007/02/10 15:34:22 claudio Exp $ */ /* $KAME: in_gif.h,v 1.5 2000/04/14 08:36:02 itojun Exp $ */ /* @@ -34,6 +34,6 @@ #define _NETINET_IN_GIF_H_ void in_gif_input(struct mbuf *, ...); -int in_gif_output(struct ifnet *, int, struct mbuf *, struct rtentry *); +int in_gif_output(struct ifnet *, int, struct mbuf *); #endif /*_NETINET_IN_GIF_H_*/ diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c index 427f4214f1a..4b9fae0b5cb 100644 --- a/sys/netinet/ip_ipip.c +++ b/sys/netinet/ip_ipip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipip.c,v 1.38 2006/12/13 09:01:59 itojun Exp $ */ +/* $OpenBSD: ip_ipip.c,v 1.39 2007/02/10 15:34:22 claudio Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -374,8 +374,8 @@ ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp) } int -ipip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, - int protoff) +ipip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int dummy, + int dummy2) { u_int8_t tp, otos; |