diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-11-17 13:36:05 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-11-17 13:36:05 +0000 |
commit | 24762cd6b9d0647aa312f5d610c5c0e5d5f53117 (patch) | |
tree | 3dc2ebee1f6d3dd2819a2ddebabcffb6251acaa4 | |
parent | 8a98925b998060d4a5405a3751c263525373c0e7 (diff) |
Move etherip counters and their allocation to etherip(4)
gif(4) now depends on etherip(4) but this is a temporary drawback: we
can get rid of etherip_init(), called from the protocol switch, and
ip_ether.c should stop using etherip counters once it is clear that this
file doesn't handle ethernet-in-IP any more.
ok visa@ as part of a larger diff, ok mpi@
-rw-r--r-- | sys/net/if_etherip.c | 5 | ||||
-rw-r--r-- | sys/netinet/in_proto.c | 3 | ||||
-rw-r--r-- | sys/netinet/ip_ether.c | 10 | ||||
-rw-r--r-- | sys/netinet/ip_ether.h | 3 |
4 files changed, 7 insertions, 14 deletions
diff --git a/sys/net/if_etherip.c b/sys/net/if_etherip.c index b87f635d6ec..051a8692faa 100644 --- a/sys/net/if_etherip.c +++ b/sys/net/if_etherip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_etherip.c,v 1.23 2017/11/15 17:30:20 jca Exp $ */ +/* $OpenBSD: if_etherip.c,v 1.24 2017/11/17 13:36:04 jca Exp $ */ /* * Copyright (c) 2015 Kazuya GODA <goda@openbsd.org> * @@ -80,6 +80,8 @@ LIST_HEAD(, etherip_softc) etherip_softc_list; int etherip_allow = 0; #endif +struct cpumem *etheripcounters; + void etheripattach(int); int etherip_clone_create(struct if_clone *, int); int etherip_clone_destroy(struct ifnet *); @@ -98,6 +100,7 @@ void etheripattach(int count) { if_clone_attach(ðerip_cloner); + etheripcounters = counters_alloc(etherips_ncounters); } int diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index 740396ed8ce..36aac8afcca 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_proto.c,v 1.83 2017/11/15 16:52:44 jca Exp $ */ +/* $OpenBSD: in_proto.c,v 1.84 2017/11/17 13:36:04 jca Exp $ */ /* $NetBSD: in_proto.c,v 1.14 1996/02/18 18:58:32 christos Exp $ */ /* @@ -279,7 +279,6 @@ struct protosw inetsw[] = { .pr_usrreq = rip_usrreq, .pr_attach = rip_attach, .pr_detach = rip_detach, - .pr_init = etherip_init, }, #endif /* NGIF */ #if defined(MPLS) && NGIF > 0 diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c index 6a6b3f40289..765047c7e64 100644 --- a/sys/netinet/ip_ether.c +++ b/sys/netinet/ip_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ether.c,v 1.90 2017/11/15 17:30:20 jca Exp $ */ +/* $OpenBSD: ip_ether.c,v 1.91 2017/11/17 13:36:04 jca Exp $ */ /* * The author of this code is Angelos D. Keromytis (kermit@adk.gr) * @@ -82,14 +82,6 @@ struct gif_softc *etherip_getgif(struct mbuf *); */ int etherip_allow = 0; -struct cpumem *etheripcounters; - -void -etherip_init(void) -{ - etheripcounters = counters_alloc(etherips_ncounters); -} - /* * etherip_input gets called when we receive an encapsulated packet. */ diff --git a/sys/netinet/ip_ether.h b/sys/netinet/ip_ether.h index 97b0778b780..4457fad5435 100644 --- a/sys/netinet/ip_ether.h +++ b/sys/netinet/ip_ether.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ether.h,v 1.24 2017/11/15 17:30:20 jca Exp $ */ +/* $OpenBSD: ip_ether.h,v 1.25 2017/11/17 13:36:04 jca Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@adk.gr) * @@ -109,7 +109,6 @@ etheripstat_pkt(enum etheripstat_counters pcounter, struct tdb; -void etherip_init(void); int etherip_output(struct mbuf *, struct tdb *, struct mbuf **, int); int etherip_input(struct mbuf **, int *, int, int); |