/* Add a protocol handler to the hash tables  */
int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol)
/* Add a protocol handler to the hash tables  */
int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol)
{
	int hash, ret;
	hash = protocol & (MAX_INET_PROTOS - 1);
	spin_lock_bh(&inet_proto_lock);
	if (inet_protos[hash]) {
		ret = -1;
	} else {
		inet_protos[hash] = prot;
		ret = 0;
	}
	spin_unlock_bh(&inet_proto_lock);
	return ret;
}