#ifdef INET_REFCNT_DEBUG atomic_inc(&inet_sock_nr); #endif 
sk_refcnt_debug_inc(sk); 
static int inet_create(struct socket *sock, int protocol){	struct sock *sk;	struct list_head *p;	struct inet_protosw *answer;	struct inet_sock *inet;	struct proto *answer_prot;	unsigned char answer_flags;	char answer_no_check;	int err;	sock->state = SS_UNCONNECTED;	/* Look for the requested type/protocol pair. */	answer = NULL;	rcu_read_lock();	list_for_each_rcu(p, &inetsw[sock->type]) {		answer = list_entry(p, struct inet_protosw, list);		/* Check the non-wild match. */		if (protocol == answer->protocol) {			if (protocol != IPPROTO_IP)				break;		} else {			/* Check for the two wild cases. */			if (IPPROTO_IP == protocol) {				protocol = answer->protocol;				break;			}			if (IPPROTO_IP == answer->protocol)				break;		}		answer = NULL;	}	err = -ESOCKTNOSUPPORT;	if (!answer)		goto out_rcu_unlock;	err = -EPERM;	if (answer->capability > 0 && !capable(answer->capability))		goto out_rcu_unlock;	err = -EPROTONOSUPPORT;	if (!protocol)		goto out_rcu_unlock;	sock->ops = answer->ops;	answer_prot = answer->prot;	answer_no_check = answer->no_check;	answer_flags = answer->flags;	rcu_read_unlock();	BUG_TRAP(answer_prot->slab != NULL);	err = -ENOBUFS;	sk = sk_alloc(PF_INET, GFP_KERNEL, answer_prot, 1);	if (sk == NULL)		goto out;	err = 0;	sk->sk_no_check = answer_no_check;	if (INET_PROTOSW_REUSE & answer_flags)		sk->sk_reuse = 1;	inet = inet_sk(sk);	if (SOCK_RAW == sock->type) {		inet->num = protocol;		if (IPPROTO_RAW == protocol)			inet->hdrincl = 1;	}	if (ipv4_config.no_pmtu_disc)		inet->pmtudisc = IP_PMTUDISC_DONT;	else		inet->pmtudisc = IP_PMTUDISC_WANT;	inet->id = 0;	sock_init_data(sock, sk);	sk->sk_destruct	   = inet_sock_destruct;	sk->sk_family	   = PF_INET;	sk->sk_protocol	   = protocol;	sk->sk_backlog_rcv = sk->sk_prot->backlog_rcv;	inet->uc_ttl	= -1;	inet->mc_loop	= 1;	inet->mc_ttl	= 1;	inet->mc_index	= 0;	inet->mc_list	= NULL;#ifdef INET_REFCNT_DEBUG	atomic_inc(&inet_sock_nr);#endif	if (inet->num) {		/* It assumes that any protocol which allows		 * the user to assign a number at socket		 * creation time automatically		 * shares.		 */		inet->sport = htons(inet->num);		/* Add to protocol hash chains. */		sk->sk_prot->hash(sk);	}	if (sk->sk_prot->init) {		err = sk->sk_prot->init(sk);		if (err)			sk_common_release(sk);	}out:	return err;out_rcu_unlock:	rcu_read_unlock();	goto out;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e6848976b721eeb5551cd94673faafeef78d9f35/af_inet.c/clean/net/ipv4/af_inet.c