From 18b40a43ee40b60f16950803b49724d0ef523293 Mon Sep 17 00:00:00 2001 From: bz Date: Thu, 2 Sep 2010 17:43:44 +0000 Subject: MFp4 CH=183052 183053 183258: In protosw we define pr_protocol as short, while on the wire it is an uint8_t. That way we can have "internal" protocols like DIVERT, SEND or gaps for modules (PROTO_SPACER). Switch ipproto_{un,}register to accept a short protocol number(*) and do an upfront check for valid boundries. With this we also consistently report EPROTONOSUPPORT for out of bounds protocols, as we did for proto == 0. This allows a caller to not error for this case, which is especially important if we want to automatically call these from domain handling. (*) the functions have been without any in-tree consumer since the initial introducation, so this is considered save. Implement ip6proto_{un,}register() similarly to their legacy IP counter parts to allow modules to hook up dynamically. Reviewed by: philip, will MFC after: 1 week --- sys/netinet6/ip6_var.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/netinet6/ip6_var.h') diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 3e91a79..51ae1f7 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -368,6 +368,9 @@ void ip6_init __P((void)); #ifdef VIMAGE void ip6_destroy __P((void)); #endif +int ip6proto_register(short); +int ip6proto_unregister(short); + void ip6_input __P((struct mbuf *)); struct in6_ifaddr *ip6_getdstifaddr __P((struct mbuf *)); void ip6_freepcbopts __P((struct ip6_pktopts *)); -- cgit v1.1