dhcp/dhcp-skip-vlan.patch

17 lines
731 B
Diff
Raw Normal View History

diff -up dhcp-4.3.1/common/lpf.c.vlan dhcp-4.3.1/common/lpf.c
--- dhcp-4.3.1/common/lpf.c.vlan 2014-10-08 19:06:17.963118201 +0200
+++ dhcp-4.3.1/common/lpf.c 2014-10-08 19:07:17.086276536 +0200
@@ -543,6 +543,12 @@ ssize_t receive_packet (interface, buf,
if (cmsg->cmsg_level == SOL_PACKET &&
cmsg->cmsg_type == PACKET_AUXDATA) {
struct tpacket_auxdata *aux = (void *)CMSG_DATA(cmsg);
+ /* if listening on plain interface we can see vlan traffic as well.
+ skip vlan traffic if tagged. If we are listening on vlan interfaces
+ as well we will see the traffic again but without the tag
+ */
+ if (aux->tp_vlan_tci != 0)
+ return 0;
nocsum = aux->tp_status & TP_STATUS_CSUMNOTREADY;
}
}