Opened 28 hours ago

Last modified 14 hours ago

#19432 new enhancement

getnetent() looks for the networks(5) file in /etc

Reported by: dovsienko Owned by: axeld
Priority: low Milestone: R1/beta6
Component: Network & Internet/IPv4 Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Haiku among other BSD-derived code includes a set of getnet*() functions (which are still in POSIX as of the 2024 edition). In my basic test getnetbyname() works as expected if the Haiku host is configured for it, which means creating /etc/networks and filling it in. The file does not exist by default because in Haiku network configuration files reside in /boot/system/settings/network/. This is because the location is hard-coded in src/system/libnetwork/netresolv/net/getnetent.c:

#ifndef _PATH_NETWORKS
#define      _PATH_NETWORKS  "/etc/networks"
#endif

It would be more consistent to place the networks(5) file next to hosts(5) and protocols(5) (for example, see B_SYSTEM_DATA_DIRECTORY in src/system/libnetwork/netresolv/net/getprotoent_r.c).

Change History (1)

comment:1 by waddlesplash, 14 hours ago

Milestone: UnscheduledR1/beta6
Note: See TracTickets for help on using tickets.