net: sock: simplify tw proto registration
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Thu, 11 Mar 2021 02:57:36 +0000 (10:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Mar 2021 00:05:08 +0000 (16:05 -0800)
commitb80350f393703fa2e733921430276c98bbc092de
treee6f35cfeaf220a25fecd5d360214b43221263622
parent47142ed6c34d544ae9f0463e58d482289cbe0d46
net: sock: simplify tw proto registration

Introduce the new function tw_prot_init (inspired by
req_prot_init) to simplify "proto_register" function.

tw_prot_cleanup will take care of a partially initialized
timewait_sock_ops.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c