Skip to content

Move host networking to new NetworkNamespace object#2607

Merged
stevenengler merged 4 commits intoshadow:mainfrom
stevenengler:move-host-networking
Dec 14, 2022
Merged

Move host networking to new NetworkNamespace object#2607
stevenengler merged 4 commits intoshadow:mainfrom
stevenengler:move-host-networking

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

This serves two main purposes:

  1. Consolidate the host's networking-related code into a new structure.
  2. When we have a function like Socket::bind() that needs to be able to associate the socket with a network interface, we can pass it just this NetworkNamespace object instead of needing to pass the entire Host. This provides better encapsulation.

@stevenengler stevenengler self-assigned this Dec 13, 2022
@github-actions github-actions bot added the Component: Main Composing the core Shadow executable label Dec 13, 2022
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 13, 2022

Codecov Report

Base: 67.37% // Head: 67.48% // Increases project coverage by +0.10% 🎉

Coverage data is based on head (4d2fbc8) compared to base (7f3d166).
Patch coverage: 83.44% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2607      +/-   ##
==========================================
+ Coverage   67.37%   67.48%   +0.10%     
==========================================
  Files         198      199       +1     
  Lines       29180    29199      +19     
  Branches     5739     5735       -4     
==========================================
+ Hits        19661    19705      +44     
+ Misses       4968     4931      -37     
- Partials     4551     4563      +12     
Flag Coverage Δ
tests 67.48% <83.44%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/network/mod.rs 100.00% <ø> (ø)
src/main/host/network_interface.rs 76.92% <28.57%> (-7.86%) ⬇️
src/main/network/net_namespace.rs 85.85% <85.85%> (ø)
src/main/host/host.rs 80.66% <86.04%> (-0.11%) ⬇️
src/main/host/syscall/handler/socket.rs 65.60% <100.00%> (-0.85%) ⬇️
src/main/host/timer.rs 90.08% <0.00%> (-6.62%) ⬇️
src/main/core/logger/shadow_logger.rs 67.25% <0.00%> (-2.93%) ⬇️
src/main/utility/shm_cleanup.rs 59.09% <0.00%> (-2.28%) ⬇️
src/main/host/memory_manager/memory_copier.rs 73.33% <0.00%> (-2.23%) ⬇️
src/main/core/scheduler/thread_per_core.rs 88.11% <0.00%> (-1.40%) ⬇️
... and 17 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stevenengler stevenengler merged commit 3fbe804 into shadow:main Dec 14, 2022
@stevenengler stevenengler deleted the move-host-networking branch December 14, 2022 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants