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/net | |
parent | 4a8a875990eb2662dafbd7e2a4bf0047b0190df1 (diff) |
remove bogus entry from if_enc address list; and rename enc_softc to encif
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_enc.c | 43 | ||||
-rw-r--r-- | sys/net/route.c | 6 |
2 files changed, 20 insertions, 29 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 |