nmap / nmap/nmap

utils_net.cc: Redudant code

Open
#3,034 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.