From owner-freebsd-net Mon May 21 10:56: 6 2001 Delivered-To: freebsd-net@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id D94C637B42C for ; Mon, 21 May 2001 10:56:03 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 21 May 2001 18:56:03 +0100 (BST) To: Thomas Moestl Cc: Ian Dowse , Barney Wolff , freebsd-net@FreeBSD.ORG Subject: Re: Using connect() on UDP RPC client sockets. In-Reply-To: Your message of "Mon, 21 May 2001 17:24:19 +0200." <20010521172419.A672@crow.dom2ip.de> Date: Mon, 21 May 2001 18:56:02 +0100 From: Ian Dowse Message-ID: <200105211856.aa41143@salmon.maths.tcd.ie> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In message <20010521172419.A672@crow.dom2ip.de>, Thomas Moestl writes: > >I have a patch that does just that (although it just overloads >IP_RECVDSTADDR for sendmsg instead of creating a new flag). I wrote it >some time ago for a DNS server (the standard requires the source >address to be the address the packet went to). It may need some >resynching, but if you want, I can dig it out and prepare it for >committing. I anyway wanted to do this some time... Thanks! I know I had seen this somewhere - turns out I had saved it in my freebsd-net mailbox too. Getting this functionality committed would be a great first step towards resolving the wrong- address issue at least between FreeBSD hosts. I think the option should be renamed to something like IP_SENDSRCADDR just to avoid confusion - does this seem reasonable? I'll read through the patch shortly and maybe see if it still applies. Actually, a bit more searching has shown up some more posibilities. IPv6 uses a IPV6_PKTINFO option, based on the in6_pktinfo struct: struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ }; and it seems Linux has something similar for IPv4 which uses an IP_PKTINFO option: struct in_pktinfo { unsigned int ipi_ifindex; /* Interface index */ struct in_addr ipi_spec_dst;/* Routing destination address */ struct in_addr ipi_addr; /* Header Destination address */ }; I think the idea of both is that you can specify the source address and interface of outgoing packets, and get the destination address and receive interface of incoming packets. I suppose the ipi_spec_dst in the Linux in_pktinfo is to use a different destination address for the routing table lookup; I'm not sure why you'd want to do that though. Would that seem a better interface to implement? Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message