Skip to content

Return a netmask in getifaddrs()#2456

Merged
stevenengler merged 2 commits intoshadow:mainfrom
stevenengler:getifaddrs-netmask
Oct 7, 2022
Merged

Return a netmask in getifaddrs()#2456
stevenengler merged 2 commits intoshadow:mainfrom
stevenengler:getifaddrs-netmask

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

The man page for getifaddrs() says this is allowed to be NULL, but some applications/libraries such as libuv assume that this is non-null, so we may as well return something here. It returns a netmask of /8 for localhost and /24 for the public IP.

Fixes the segfault in #2451.

@stevenengler stevenengler added the Type: Bug Error or flaw producing unexpected results label Oct 7, 2022
@stevenengler stevenengler self-assigned this Oct 7, 2022
@github-actions github-actions bot added Component: Libraries Support functions like LD_PRELOAD and logging Component: Testing Unit and integration tests and frameworks labels Oct 7, 2022
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 7, 2022

Codecov Report

Base: 42.47% // Head: 42.46% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (264c21e) compared to base (bccb1bf).
Patch coverage: 37.50% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2456      +/-   ##
==========================================
- Coverage   42.47%   42.46%   -0.02%     
==========================================
  Files         178      178              
  Lines       26051    26072      +21     
  Branches     5266     5269       +3     
==========================================
+ Hits        11066    11072       +6     
- Misses      12443    12455      +12     
- Partials     2542     2545       +3     
Flag Coverage Δ
tests 42.46% <37.50%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
src/test/ifaddrs/test_ifaddrs.rs 4.00% <0.00%> (-0.77%) ⬇️
src/lib/shim/shim_api_ifaddrs.c 66.66% <45.00%> (-10.08%) ⬇️
src/main/host/syscall/handler/random.rs 47.36% <0.00%> (-5.27%) ⬇️
src/main/core/scheduler/pools/bounded.rs 81.54% <0.00%> (-2.58%) ⬇️
src/main/utility/shm_cleanup.rs 59.55% <0.00%> (-2.25%) ⬇️
src/main/core/scheduler/thread_per_host.rs 92.53% <0.00%> (-1.50%) ⬇️
src/main/host/descriptor/pipe.rs 84.81% <0.00%> (-1.27%) ⬇️
...c/main/utility/synchronization/count_down_latch.rs 85.48% <0.00%> (-0.54%) ⬇️
src/main/host/syscall/handler/socket.rs 68.58% <0.00%> (-0.18%) ⬇️
src/main/host/memory_manager/memory_mapper.rs 71.57% <0.00%> (+0.62%) ⬆️
... and 4 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 439e467 into shadow:main Oct 7, 2022
@stevenengler stevenengler deleted the getifaddrs-netmask branch October 7, 2022 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Libraries Support functions like LD_PRELOAD and logging Component: Testing Unit and integration tests and frameworks Type: Bug Error or flaw producing unexpected results

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants