Skip to content

Fix L3 timestamps#2426

Merged
guedou merged 4 commits intosecdev:masterfrom
gpotter2:tmstps
Feb 2, 2020
Merged

Fix L3 timestamps#2426
guedou merged 4 commits intosecdev:masterfrom
gpotter2:tmstps

Conversation

@gpotter2
Copy link
Copy Markdown
Member

@gpotter2 gpotter2 commented Jan 21, 2020

Credits for the timestamp bug to Ron Henderson

fix #2423
fix #2425
fix #2277
fix #2429

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 21, 2020

Codecov Report

Merging #2426 into master will decrease coverage by 0.1%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master    #2426      +/-   ##
==========================================
- Coverage   87.24%   87.14%   -0.11%     
==========================================
  Files         243      242       -1     
  Lines       50760    49861     -899     
==========================================
- Hits        44286    43451     -835     
+ Misses       6474     6410      -64
Impacted Files Coverage Δ
scapy/arch/bpf/supersocket.py 27.87% <0%> (-47.58%) ⬇️
scapy/arch/common.py 73.43% <0%> (-15.96%) ⬇️
scapy/data.py 92.51% <100%> (ø) ⬆️
scapy/arch/linux.py 76.44% <100%> (-0.45%) ⬇️
scapy/supersocket.py 74.17% <50%> (-1.08%) ⬇️
scapy/arch/pcapdnet.py 65.78% <80%> (-3.78%) ⬇️
scapy/layers/dhcp6.py 64.18% <0%> (-21.58%) ⬇️
scapy/arch/bpf/core.py 81.37% <0%> (-5.89%) ⬇️
scapy/layers/tls/automaton_srv.py 73.18% <0%> (-4.98%) ⬇️
... and 78 more

Copy link
Copy Markdown
Member

@guedou guedou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Copy Markdown
Member

@p-l- p-l- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @gpotter2. I have two minor (but I think useful) suggestions.

# From asm/socket.h
SO_ATTACH_FILTER = 26
SO_TIMESTAMPNS = 35
SO_TIMESTAMPNS = 35 # SO_TIMESTAMPNS_OLD: not 2038 safe
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://github.com/torvalds/linux/blob/a2d79c7174aeb43b13020dd53d85a7aefdd9f3e5/include/uapi/asm-generic/socket.h#L109-L115

  • SO_TIMESTAMPNS_OLD = 35 returns timespecs that use long to store the date = not 2038 safe
  • SO_TIMESTAMPNS_NEW returns timespecs that are long long
  • SO_TIMESTAMPNS defaults for the old one

We would use the "NEW" one but it's very recent and isn't supported well yet.
https://lwn.net/Articles/776219/

@gpotter2
Copy link
Copy Markdown
Member Author

gpotter2 commented Feb 2, 2020

Should be ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

3 participants