tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sendmsg(2) with IP_PKTINFO



>> I implemented IP_PKTINFO for sendmsg(2). For recvmsg(2) IP_PKTINFO is already
>> supported, but it is not supported for sending. This causes problems
>> described in https://mail-index.netbsd.org/tech-net/2013/09/22/msg004252.html
>> 
>> patch is here.
>>       http://www.netbsd.org/~ryo/ip_pktinfo.patch
>>    or https://github.com/ryo/netbsd-src/compare/master...ip_pktinfo
>
>+				/* Checking laddr:port already in use? */
>+				xinp = in_pcblookup_bind(&udbtable,
>+				    laddr.sin_addr, inp->inp_lport);
>+				if ((xinp != NULL) && (xinp != inp)) {
>+					error = EADDRINUSE;
>+					goto release;
>+				}
>+				break;
>
>Why is this check needed and why is it UDP specific?
>
>In dhcpcd's case it's already bound the local address the socket and the 
>kernel then claims the address is already in use which is wrong.

I thought that it should fail with EADDRINUSE if sendmsg with IP_PKTINFO
using address:port same as already bound on other socket.

Certainly, this behavior is different from IP6_PKTINFO and linux.
Should I fix to be able to PKTINFO with address:port that another socket bound?

--
ryo shimizu


Home | Main Index | Thread Index | Old Index