MINOR: protocols: replace protocol_by_family() with protocol_lookup()

At a few places we were still using protocol_by_family() instead of
the richer protocol_lookup(). The former is limited as it enforces
SOCK_STREAM and a stream protocol at the control layer. At least with
protocol_lookup() we don't have this limitationn. The values were still
set for now but later we can imagine making them configurable on the
fly.
This commit is contained in:
Willy Tarreau
2021-10-27 17:41:07 +02:00
parent e3b4518414
commit 14e7f29e86
6 changed files with 7 additions and 16 deletions

View File

@@ -76,16 +76,6 @@ int protocol_resume_all(void);
*/
int protocol_enable_all(void);
/* returns the protocol associated to family <family> with sock_type and
* ctrl_type of SOCK_STREAM, or NULL if not found
*/
static inline struct protocol *protocol_by_family(int family)
{
if (family >= 0 && family < AF_CUST_MAX)
return __protocol_by_family[family][0][0];
return NULL;
}
/* returns the protocol associated to family <family> with proto_type among the
* supported protocol types, and ctrl_type of either SOCK_STREAM or SOCK_DGRAM
* depending on the requested values, or NULL if not found.