utils_net.cc: Redudant code
Open
Nobody has claimed this yet.
Nping
- Dominant language
- C
- Stars
- 13.6k
- Forks
- 2.9k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
https://github.com/nmap/nmap/blob/fd80921926527e6668d76b5696f0d6c054ca6d29/nping/utils_net.cc#L496-L509
What's the point of defining
struct sockaddr_storage src
then filling with 16 zeros
memset(&src, 0, sizeof(struct sockaddr_in) );
and not using as 4th parameter in:
result=route_dst(dst, &rnfo, NULL, NULL);
Version info (please complete the following information):
- master branch
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect nping/utils_net.cc around lines 496-509, including the sockaddr_storage src initialization and the route_dst call. Determine whether the initialization is unused or intended as the fourth argument, then verify that the redundant code is resolved without changing route calculation behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- networking
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100