The "NextProtocol" field was added as an unconditional field which made the
VXLAN packet header consume an additional 8-bts when used in a Legacy VXLAN
deployments (flags=0x08) or in GPID deployments (flags=0x88). The resulting
regression caused incorrect parsing of subsequent headers. For example, if an
Ethernet header followed the VXLAN header then it would not be interpreted as
an Ethernet header. The actually interpretation would depend on what value was
stored in the Ether.dst field.
This change updates the field layout specification such that the NextProtocol
field is conditional on flags=0x04, and shortens the reserved field by 8-bits
if that condition is true.
fixes bug #281
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Add support for draft-ietf-sfc-nsh-05.txt
Original commit by: Christophe Fontaine <christophe.fontaine@qosmos.com>
Signed-off-by: Gabriel Ganne <gabriel.ganne@qosmos.com>
Since part of the previously reserved Bytes are now used to annouce
the next header, this also updates the vxlan unit tests.
Original commit by: Christophe Fontaine <christophe.fontaine@qosmos.com>
Signed-off-by: Gabriel Ganne <gabriel.ganne@qosmos.com>
When interface names are longer than 7 characters, netstat will truncate
them to the first 7 chars which leads to looking up an invalid interface
name.
We attempt to guess the name of the interface based on the output of
ifconfig -l. If there is only one candidate we consider it, otherwise we
ignore it.
* Fix missing import and mixup result / status in L2Cap Conn Resp
in scapy/layers/bluetooth.py
* Delete bluetooth.py
* fix missing import and mixup of result/status in L2Cap ConnResp
* Delete bluetooth.patch
* fixed missing import and mixup of result/status in L2Cap ConnResp
* Update bluetooth.py
* References to the 'Raw' class were replaced by conf.raw_layer.
* Fix potential infinite loop in NTPExtPacketListField::getfield() + typo.
* Added regression test (Extension dissection test).
* layers/vxlan: add group policy extension support
This is based on the following draft RFC:
http://tools.ietf.org/html/draft-smith-vxlan-group-policy-00
Add more unit tests in regression.uts.
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
* Move VXLAN to layers
VXLAN has an official RFC: http://tools.ietf.org/html/rfc7348
It should be in automatically loaded layers.
Move tests to regression.uts.
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
* load_contrib: fallback to layers when contrib not found
Useful when a scapy.contrib module has been moved to scapy.layers.
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
By default, only a NullHandler is added to the 'scapy' logger. This
allows third party applications that use scapy as a library to control
the logging of scapy messages.
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
Some symbols are "internal" to modules (__all__, __file__, __doc__,
__package__, etc.) they should *not* be replaced by the one from other
modules.
The "from xxx import *" python syntax construct takes this into account
and only imports the "public" symbols (i.e., those whose name does not
start with an underscore). When a __all__ symbol is defined in a module
(it should be a list of strings), the "from xxx import *" construct only
imports the names listed in xxx.__all__.
Avoid shadowing module specific symbols when dynamically loading layers
and other modules by only importing "public" symbols.
Fix importing the "tls" layer along the way (remove erroneous __all__
definition).
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
When using scapy as a third party library, we do not "benefit" from the
loading routine that puts all symbols in the __builtin__ namespace. This
implies that all modules must be "importable" without any errors for
undefined symbols.
This patch fixes importing every scapy module individually. Some
circular imports were fixed (between inet6 and dhcp6).
Most errors were detected by using pylint with the right configuration
(scapy produces a *lot* of errors). Other errors were detected with the
following shell script:
export PYTHONPATH=".:$PYTHONPATH"
for f in $(find scapy/ -name '*.py'); do
f=${f%/__init__.py}
module=$(echo ${f%.py} | sed 's,/,.,g')
python -c "import $module; print $module"
done
Also, replace all implicit relative imports by absolute imports to avoid
surprises with some python versions.
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>