-
Notifications
You must be signed in to change notification settings - Fork 149
Packet Filter Linux ignore VLAN tagged packets #119
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
base: master
Are you sure you want to change the base?
Conversation
e26caa3
to
949e441
Compare
If you define kea dhcp on an untagged interface that also has a tagged vlan interface on top, it will see both dhcp packets (eth0 and eth0.10). Linux has a feature for auxiliary data on raw sockets which contains data about the vlan of the packet received. Kea should only answer packets without a vlan in the aux data, since those are the data send to the attached interface. vlan data are missing on the intended interface eth0.10 but set on eth0 for the same packet. There was a discussion about this here: http://kea-users.7364.n8.nabble.com/Kea-users-KEA-DHCP-and-VLANS-td1618.html Signed-off-by: Sven Auhagen <[email protected]>
949e441
to
d0e1bb3
Compare
Very thanks. There was a discussion about this here: |
Hi, ah I did not see that ticket, thanks. |
Yes. |
Great, thank you for testing! |
Hello, Any reason why the merge of this task is still pending? |
Any ETA on getting a release with this fixed merged in ? |
I think the underlying problem is an important issue for anyone dealing with a more complex VLAN infrastructure and it should be fixed. But I don't think the proposed solution in this pull request is overly elegant: But kea already has a perfectly capable BPF/LPF filtering program in place that is currently used to discard packets of the wrong type, to the wrong port and so on, directly in the kernel. This BPF/LPF filtering program can easily be extended to also check for any vlan-tagged packets and discard them right in the kernel, before ever sending them to kea. The old dhcpd suffered from the same problem and it used a very similar BPF/LPF filtering solution. Here is how I fixed the problem for dhcpd:
I think it shouldn't be hard to adapt this to the kea BPF/LPF filter. Just the two offsets would have to be adjusted (jump offset 10 jumps to return 0, the patch offset points to the instruction with the port number). I don't have the necessary infrastructure for testing kea with this at hand right now or I would send a full pull request. |
If you define kea dhcp on an untagged interface that also has a tagged
vlan interface on top, it will see both dhcp packets (eth0 and eth0.10).
Linux has a feature for auxiliary data on raw sockets which contains
data about the vlan of the packet received.
Kea should only answer packets without a vlan in the aux data,
since those are the data send to the attached interface.
vlan data are missing on the intended interface eth0.10 but set on eth0
for the same packet.
There was a discussion about this here:
http://kea-users.7364.n8.nabble.com/Kea-users-KEA-DHCP-and-VLANS-td1618.html
Signed-off-by: Sven Auhagen [email protected]