Setting source address - sendmsg(), PKTINFO

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

 



Hello,

I need a help with setting source address for outgoing UDP datagrams.

I have a PF_INET6 socket bound to "::" (unspecified address) and a port.
That allows me to accept both IPv4 and IPv6 UDP datagrams.

Now I want to send a UDP/IPv4 datagram with some specific IP address and the port bound
to the above socket. But I am not able to do it.

All ways, I used, failed.
1. I tried to specify source address via ancillary data (IPV6_PKTINFO) to sendmsg()
  This doesn't work because IPV6_PKTINFO is not supported for IPv4-mapped addresses.
2.Tried to create a new socket and bind it to the required source address and port
  This doesn't work either because it's not possible to create completly duplicate binding.
 Note: This is possible on Solaris, as the first address is unspecified (::) !

Is there any solution to my problem?

Jiri Klimes


--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux