Subject: [PATCH] af_unix: dont send SCM_CREDENTIAL when dest socket is NULL

From: dingtianhong <[email-masked]>
Date: Wed, 27 Mar 2013 15:35:52 +0800

On 2013/3/26 21:46, Eric Dumazet wrote:
> On Tue, 2013-03-26 at 19:35 +0800, dingtianhong wrote:
> 
>> I think if not call scm_set_creds(), the credential would useles in recvmsg().
>> we could remove code:
>> 		if (check_creds) {
>>                         /* Never glue messages from different writers */
>>                         if ((UNIXCB(skb).pid  != siocb->scm->pid) ||
>>                             (UNIXCB(skb).cred != siocb->scm->cred))
>>                                 break;
>>                 } else {
>>                         /* Copy credentials */
>>                         scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred);
>>                         check_creds = 1;
>>                 }
> 
> Are you paraphrasing me or saying something different ?
>  

if not call scm_set_creds(), how get credentials for receiver and distinguish different writes,
so I think scm_set_creds() is necessary here.