Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 PDU/packet does not go through the interface specified in PacketSender::send() #394

Open
gbappneta opened this issue Mar 18, 2020 · 1 comment

Comments

@gbappneta
Copy link

In the code snippet below, the IPv6 packet is built and, although "eth0" is specified in the call to PacketSender::send(), the packet goes out "eth1". Is this a missing feature or a bug? If it is a missing feature, is there any intention of adding it in a near future?
Looking at the documentation I found an example where an EthernetII+IPv6 PDU is used instead of an IPv6 PDU in order to send the packet through a particular interface.
I have not tried the EthernetII+IPv6 PDU alternative as it presents an extra level of trouble (it seems to require that the source and destination MAC addresses to be populated)

IPv6 &UDPv6Probe::send() {
	PacketSender sender;
	IPv6* ipv6_pkt;
	// Forge just builds an IPv6 UDP packet
	ipv6_pkt = forge();
	sender.send(*ipv6_pkt, "eth0");
	return *ipv6_pkt;
}

OS = Debian Stretch

@mfontanini
Copy link
Owner

As the documentation states explicitly specifying an interface will only work if you're sending a packet that contains a link layer PDU. When you're sending a l3 packet, the kernel will decide which interface to use on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants