Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1431 +/- ##
==========================================
+ Coverage 85.11% 85.19% +0.07%
==========================================
Files 174 174
Lines 40216 40325 +109
==========================================
+ Hits 34229 34353 +124
+ Misses 5987 5972 -15
|
c055fc2 to
7b9ccf4
Compare
bcff287 to
58d544d
Compare
guedou
requested changes
May 17, 2018
Member
guedou
left a comment
There was a problem hiding this comment.
Cool PRs. I made some minor comments.
scapy/layers/l2.py
Outdated
Member
There was a problem hiding this comment.
Is it possible to catch a specific exception here? Otherwise please catch Exception
scapy/utils.py
Outdated
Member
There was a problem hiding this comment.
Same comment for except. This also applies to the others try/except blocks.
Member
Author
There was a problem hiding this comment.
You're totally right. I'll have a look.
This uses MultipleTypeField() for {hw,p}{dst,src} fields, to achieve
two goals:
- Make ARP() usable with other {hw,p}types than Ether and IP.
- Keep ARP() as simple as possible.
Notes:
- raw(ARP()) returns the same result as before.
- ARP(pytpe="IPv4") works and raw(ARP(pytpe="IPv4")) == raw(ARP())
- ARP(ptype="IPv6") now works, plen is then set to 16 and psrc &
pdst fields are IPv6 addresses:
ARP(raw(ARP(ptype="IPv6"))).pdst == "::"
Member
Author
|
@guedou fixed, thanks for your fast review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces
MultipleTypeField()pseudo Field type, and uses it to enhanceARP(). It also fixes a bug and clean some imports (see detailed commit log for more -- please do not stash this PR).In
ARP(),MultipleTypeField()are now used for{hw,p}{dst,src}fields, to achieve two goals:ARP()usable with other{hw,p}typesthan Ether and IP.ARP()as simple as possible to use.With this patch:
raw(ARP())returns the same result as before.ARP(pytpe="IPv4")works andraw(ARP(pytpe="IPv4")) == raw(ARP())ARP(ptype="IPv6")now works,plenis then set to 16 andpsrc&pdstfields are IPv6 addresses:ARP(raw(ARP(ptype="IPv6"))).pdst == "::"As always, when fixing imports in some important parts of Scapy shows that some modules imports are still a mess. I had to fix some of them, using this opportunity to remove some wildcard imports.