Skip to content

Commit

Permalink
fix_port: Fix the field read on kernel-collector (#174)
Browse files Browse the repository at this point in the history
Fix the field read to get sport.
  • Loading branch information
thiagoftsm authored Jul 28, 2020
1 parent af5624a commit b691e28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/network_viewer_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ static __u16 set_idx_value(netdata_socket_idx_t *nsi, struct inet_sock *is)

//Read destination port
bpf_probe_read(&nsi->dport, sizeof(u16), &is->inet_dport);
bpf_probe_read(&nsi->sport, sizeof(u16), &is->inet_sport);
bpf_probe_read(&nsi->sport, sizeof(u16), &is->inet_num);
nsi->sport = ntohs(nsi->sport);

return family;
}
Expand Down

0 comments on commit b691e28

Please sign in to comment.