- Use getaddrinfo to replace gethostbyname.
- Use getnameinfo with NI_NAMEREQD flag to replace gethostbyaddr.
Details
Details
showhosts function will be used when type show [ports|hosts] option and changeitems function will be used when use ignore [items] option. inetname function are always use. So I compare the command output before revised and after and it seem process normally.
$ systat -netstat :ignore 8.8.8.8 :show hosts !dns.google !8.8.8.8 // Second output
I ignore DNS server of google and can see it ignore successfully. In second output, it also show the ignore IP successfully, but it sometimes show the above output 8.8.8.8 which due to the fail of resolve IP (This happened on both revise and not revised code). I don't know why.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 58559 Build 55447: arc lint + arc unit
Event Timeline
Comment Actions
Update according Hiroki advise in D45594
- Use "result" instead of "status" name to store the value of getaddrinfo() function. I don't use "error" because it has already error() function in the code.
- Use compound literals instead of "hints" variable.