In particular embodiments of the present invention, a method for filtering packets in a switching environment is provided. In particular embodiments, the method includes receiving a packet at an input port of a switch, the switch comprising a memory and one or more output ports. The method also includes storing at least a portion of the packet in the memory and determining one or more output ports from which the packet is to be communicated from the switch. The method further includes, after beginning to determine one or more output ports from which the packet is to be communicated from the switch, determining whether the packet is an illegal packet. The method also includes, if the packet is an illegal packet, dropping the packet from the memory, and if the packet is a legal packet, communicating the packet from the determined one or more output ports.