tech-net archive

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

Re: sendmsg(2) with IP_PKTINFO



Hi Ryo

On 25/07/2017 06:53, Ryo Shimizu wrote:
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.

Roy


Home | Main Index | Thread Index | Old Index