* Update cdp.py for CDPIPPrefix
if the length of IP addresses prefixes was more than one address all the following content wasn't interpreted (Raw payload). This seams to fix it
* Update cdp.py
A better approach with a list rather than packets
* Update cdp.py case error on Prefix
* Fix PEP8 formatting
* Rename IPPrefix -> CDPPrefix
---------
Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
* Fix corruption of certain packets with invalid TLS extension fields
* Use idioms
---------
Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
* Handle release tag formats in _parse_tag()
Also accommodate formal release tags, so the generated version is
correct for downstream packagers.
* Also handle release candidate format in _parse_tag()
When systemd-resolved with its LLMNR/mDNS responders enabled is run it
starts sending its probes as soon as the tun interface pops up:
```
00:36:36.643708 IP c > igmp.mcast.net: igmp v3 report, 2 group record(s)
00:36:36.644530 IP c.mdns > mdns.mcast.net.mdns: 0 [1n] ANY (QM)? c.local. (44)
00:36:36.645307 IP c.llmnr > 224.0.0.252.llmnr: UDP, length 22
```
and that interferes with the test. Since the test is interested in
ICMP packets only it can safely skip everything else.
Fixes:
```
#(006)=[failed] Send ping packets from Linux into Scapy
...
assert len(icmp4_sequences) == 3
AssertionError
```
until I figure out whether it's possible to set up slapd there by
analogy with what the scapy action on GitHub does.
It's a follow-up to https://github.com/secdev/scapy/pull/4539.
* Fix: make sure ObjectPipe does not overwrite sensible defaut name by Pipe class
* Fix: fds are non-inheritable by default since Python 3.4. It broke TermSink
* Restore sndrcv behaviour from before 53afe84
* Fix possible race condition of sndrcv
* Use much better timeout for threading
* Reduce abuse on public servers
* fix doip unit tests
* add testcase
* fix test case
* fix unit tests
* fix unit tests
* fix unit tests
* fix unit tests
---------
Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
The original testcase triggers a separate issue on 32-bit machines:
https://github.com/secdev/scapy/issues/4527 and it should probably be
tested separately. The new testcase triggers the issue fixed in
1935723c18 only:
```sh
>>> assert l[0][LDAP].summary() == "LDAP"
Traceback (most recent call last):
File "<input>", line 2, in <module>
File "scapy/scapy/packet.py", line 1692, in summary
return self._do_summary()[1]
^^^^^^^^^^^^^^^^^^
File "scapy/scapy/packet.py", line 1669, in _do_summary
ret = self.mysummary()
^^^^^^^^^^^^^^^^
File "scapy/scapy/layers/ldap.py", line 736, in mysummary
self.messageID.val,
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'val'
```
* Fix#4472: Add ability to parse multiple DoIP packets in one TCP packet via TCPSession
* update
* When not in app mode, tcp_reassemble sub-packets
---------
Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
* avoid long names not matching response packet
* unit test for long netbios hostname
* trim original request hostname not response packet hostname
* truncate name in h2i method instead
* Work if None is passed
---------
Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
* Rewrite arch/bpf
* Adapt for NetBSD
* Adapt for Darwin
* Cleanup VEthPair test
* Cleanup get_if_raw_hwaddr where not useful
* Test on all BSDs
* Some tests only work on Little endian machines
* ipsec: Fix IPsec decrypt_esp for NAT-Traversal
When having nat_header, encrypted.underlayer will return
UDP/ESP, so when decrypting IPv6 packet, the decrypt packet
will be return with nat_header (UDP), which will return a corrupted packet.
Example:
original packet:
IPv6/TCP/Raw
encrypted packet:
IPv6/UDP/ESP
Decrypted packet:
IPv6/UDP/TCP/Raw
Signed-off-by: Iman Afaneh <iafaneh@nvidia.com>
* ipsec.uts: add unit test for IPsec NAT-Traversal
Signed-off-by: Iman Afaneh <iafaneh@nvidia.com>
---------
Signed-off-by: Iman Afaneh <iafaneh@nvidia.com>
to make it possible to run the tests with `-Werror`.
Fixes
```sh
>>> assert pkt.an.rdata == b'140C768FFE28@Freebox Server._raop._tcp.local.'
Traceback (most recent call last):
File "<input>", line 2, in <module>
File "scapy/layers/dns.py", line 1256, in __getattr__
warnings.warn(
DeprecationWarning: The DNS fields 'qd', 'an', 'ns' and 'ar' are now PacketListField(s) !
```
It's a follow-up to dda902e829