Currently we are proposing following data structure for IPV4_PKTINFO
struct in4_pktinfo {
struct in_addr ipi_addr; /* src/dst IP address */
struct in_addr ipi_spec_dst; /* src address matched */
unsigned int ipi_ifindex; /* send/recv interface
index */
};
This is different than IPV6_PKTINFO (RFC 3542) but same as linux . RFC
3542 does not the matched address (ipi_spec_dst). Is having the matched
address useful and also should we change the structure names to be
ipi4_* to be compatibe with ipi6_* ?
Rao.
Rao Shoaib wrote:
Hullo,
Following is a proposal to add support to specify source address and
outgoing interface using IP_PKTINFO for UDP packets on AF_INET
sockets. Please send in your comments by COB Friday April 28.
Thanks.
Rao.
/*********************************************************************************************************************/
Currently Solaris does not provide a mechanism to set the IP source
address for UDP packets on AF_INET (IPv4) sockets. This is a hazard
for implementors of UDP-based services on Solaris, as it's
substantially difficult to get RFC 1123-compliant behavior correct,
and many applications (including those shipped with Solaris) fail to
do so. See CR 4773220 for details.
This project implements such a feature in Solaris
The options described here apply to both 3SOCKET and 3XNET
interfaces. Only 3XNET interfaces, though, have the ancillary data
feature.
The following IPPROTO_IP boolean option may be set or cleared with
setsockopt() or retrieved with getsockopt():
IP_RECVPKTINFO Enable/disable receipt of the index of the
interface the packet arrived
on, the local
address that was matched for
reception, and of
the inbound packet's actual
destination
address. Takes boolean as the
parameter.
The following IPPROTO_IP option may be set or retrieved as sticky
options with setsockopt/getsockopt or as ancillary data to a
sendmsg(3XNET) system call:
IP_PKTINFO Set the source address and/or interface out
which the packet(s) will be sent.
Takes a
struct in4_pktinfo as the parameter.
The symbols and structure are defined as:
/*
* New IP source address options
*/
#define IP_PKTINFO 0x1a /* source address info*/
#define IP_RCVPKTINFO 0x1b /* receive pkt info */
struct in4_pktinfo {
struct in_addr ipi_addr; /* src/dst IP
address */
struct in_addr ipi_spec_dst; /* src address matched */
unsigned int ipi_ifindex; /* send/recv interface
index */
};
Differences between Solaris and Linux:
This implementation is not compatible with the Linux
implementation of
IP_PKTINFO. However it is compatible with the IPV6_PKTINFO options
as described in RFC 3542 for UDP.
Other things not implemented (but that might have been expected):
We will not be extending the existing IPV6_PKTINFO feature to
cover IPv4 packets using IPv4-mapped addresses. There are many
things that just don't work with IPv4-mapped addresses (such as
multicast), that render this old transition mechanism unsuitable
for anything but the most trivial of stand-alone services. Thus,
we will instead update the documentation to let customers know
that they should open multiple sockets (using the IPV6_V6ONLY
option) instead, and use inetd's built-in multiple-socket support
when possible, and should not rely on robust v4mapped extensions.
_______________________________________________
networking-discuss mailing list
[email protected]
_______________________________________________
networking-discuss mailing list
[email protected]