diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-05 20:17:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-05 20:17:07 +0000 |
commit | 9f467e348cf40ed0c34a3a3d26981bb9776a29fb (patch) | |
tree | 658254feb9157cdf694313b806fb4e4a29ee28d2 /sys | |
parent | 4a8a875990eb2662dafbd7e2a4bf0047b0190df1 (diff) |
remove bogus entry from if_enc address list; and rename enc_softc to encif
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_enc.c | 43 | ||||
-rw-r--r-- | sys/net/route.c | 6 | ||||
-rw-r--r-- | sys/netinet/ip_ah.c | 10 | ||||
-rw-r--r-- | sys/netinet/ip_esp.c | 10 |
4 files changed, 30 insertions, 39 deletions
diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index a6df38f45fb..175c3893700 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_enc.c,v 1.10 1999/05/16 21:35:54 niklas Exp $ */ +/* $OpenBSD: if_enc.c,v 1.11 1999/07/05 20:17:05 deraadt Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -71,7 +71,7 @@ extern struct ifqueue nsintrq; #include "bpfilter.h" -struct ifnet enc_softc; +struct ifnet encif; void encattach __P((int)); int encoutput __P((struct ifnet *, struct mbuf *, struct sockaddr *, @@ -82,35 +82,26 @@ void encrtrequest __P((int, struct rtentry *, struct sockaddr *)); void encattach(int nenc) { - struct ifaddr *ifa; - - bzero(&enc_softc, sizeof(struct ifnet)); + bzero(&encif, sizeof(encif)); /* We only need one interface anyway under the new mode of operation */ - enc_softc.if_index = 0; - - sprintf(enc_softc.if_xname, "enc0"); - enc_softc.if_list.tqe_next = NULL; - enc_softc.if_mtu = ENCMTU; - enc_softc.if_flags = 0; - enc_softc.if_type = IFT_ENC; - enc_softc.if_ioctl = encioctl; - enc_softc.if_output = encoutput; - enc_softc.if_hdrlen = ENC_HDRLEN; - enc_softc.if_addrlen = 0; - if_attach(&enc_softc); + encif.if_index = 0; + + encif.if_softc = &encif; + sprintf(encif.if_xname, "enc0"); + encif.if_list.tqe_next = NULL; + encif.if_mtu = ENCMTU; + encif.if_flags = 0; + encif.if_type = IFT_ENC; + encif.if_ioctl = encioctl; + encif.if_output = encoutput; + encif.if_hdrlen = ENC_HDRLEN; + encif.if_addrlen = 0; + if_attach(&encif); #if NBPFILTER > 0 - bpfattach(&enc_softc.if_bpf, &enc_softc, DLT_ENC, ENC_HDRLEN); + bpfattach(&encif.if_bpf, &encif, DLT_ENC, ENC_HDRLEN); #endif - - /* Just a bogus entry */ - ifa = (struct ifaddr *) malloc(sizeof(struct ifaddr) + - sizeof(struct sockaddr), M_IFADDR, M_WAITOK); - bzero(ifa, sizeof(struct ifaddr) + sizeof(struct sockaddr)); - ifa->ifa_addr = ifa->ifa_dstaddr = (struct sockaddr *) (ifa + 1); - ifa->ifa_ifp = &enc_softc; - TAILQ_INSERT_HEAD(&(enc_softc.if_addrlist), ifa, ifa_list); } /* diff --git a/sys/net/route.c b/sys/net/route.c index 0074b841e12..d9ab2e1ed8f 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.13 1999/02/25 18:56:48 angelos Exp $ */ +/* $OpenBSD: route.c,v 1.14 1999/07/05 20:17:05 deraadt Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -72,7 +72,7 @@ didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>. #ifdef IPSEC #include <netinet/ip_ipsp.h> -extern struct ifnet enc_softc; +extern struct ifnet encif; #endif #define SA(p) ((struct sockaddr *)(p)) @@ -87,7 +87,7 @@ static int okaytoclone __P((u_int, int)); static struct ifaddr * encap_findgwifa(struct sockaddr *gw) { - return enc_softc.if_addrlist.tqh_first; + return encif.if_addrlist.tqh_first; } #endif diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index 85f2e2fbe7f..b8ccf123112 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.23 1999/05/16 21:48:30 niklas Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.24 1999/07/05 20:17:06 deraadt Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -75,7 +75,7 @@ #include "bpfilter.h" -extern struct ifnet enc_softc; +extern struct ifnet encif; #ifdef ENCDEBUG #define DPRINTF(x) if (encdebug) printf x @@ -173,7 +173,7 @@ ah_input(m, va_alist) return; } - m->m_pkthdr.rcvif = &enc_softc; + m->m_pkthdr.rcvif = &encif; /* Register first use, setup expiration timer */ if (tdbp->tdb_first_use == 0) @@ -269,7 +269,7 @@ ah_input(m, va_alist) m->m_flags |= M_AUTH; #if NBPFILTER > 0 - if (enc_softc.if_bpf) + if (encif.if_bpf) { /* * We need to prepend the address family as @@ -289,7 +289,7 @@ ah_input(m, va_alist) m0.m_len = ENC_HDRLEN; m0.m_data = (char *) &hdr; - bpf_mtap(enc_softc.if_bpf, &m0); + bpf_mtap(encif.if_bpf, &m0); } #endif diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index 23628b67367..ffb5b28139f 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.23 1999/05/16 21:48:33 niklas Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.24 1999/07/05 20:17:06 deraadt Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -75,7 +75,7 @@ #include "bpfilter.h" -extern struct ifnet enc_softc; +extern struct ifnet encif; #ifdef ENCDEBUG #define DPRINTF(x) if (encdebug) printf x @@ -172,7 +172,7 @@ esp_input(m, va_alist) return; } - m->m_pkthdr.rcvif = &enc_softc; + m->m_pkthdr.rcvif = &encif; /* Register first use, setup expiration timer */ if (tdbp->tdb_first_use == 0) @@ -268,7 +268,7 @@ esp_input(m, va_alist) m->m_flags |= M_CONF; #if NBPFILTER > 0 - if (enc_softc.if_bpf) + if (encif.if_bpf) { /* * We need to prepend the address family as @@ -288,7 +288,7 @@ esp_input(m, va_alist) m0.m_len = ENC_HDRLEN; m0.m_data = (char *) &hdr; - bpf_mtap(enc_softc.if_bpf, &m0); + bpf_mtap(encif.if_bpf, &m0); } #endif |