Page MenuHomeFreeBSD

arp: remove gethostby*() calls
Needs ReviewPublic

Authored by bses30074_gmail.com on Fri, Jun 14, 11:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 16, 4:34 PM
Unknown Object (File)
Fri, Jun 14, 8:24 PM
Subscribers

Details

Reviewers
hrs
lwhsu
Summary
  1. Use getaddrinfo to replace gethostbyname and use for loop to loop the address list and copy the first meet ipv4 address.
  2. Use getnameinfo to replace gethostbyaddr.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 58183
Build 55071: arc lint + arc unit

Event Timeline

usr.sbin/arp/arp.c
262–263

Should I use memset to replace the bzero function?

bses30074_gmail.com retitled this revision from arp: remove "gethostby*" function to arp: remove gethostby*() calls.Sun, Jun 16, 3:03 AM
bses30074_gmail.com edited the summary of this revision. (Show Details)

Revise error code

We should use EAI_AGAIN instead of TRY_AGAIN error code while using getnameinfo.