Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.2] Handle special FIRSTNET behavior on NetBSD #154

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions etc/atalkd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ static void as_timer(int sig _U_)
LOG(log_info, logtype_atalkd, "config for no router" );

if ( iface->i_flags & IFACE_PHASE2 ) {
iface->i_rt->rt_firstnet = 0;
iface->i_rt->rt_firstnet = htons( OS_STARTUP_FIRSTNET );
iface->i_rt->rt_lastnet = htons( STARTUP_LASTNET );
setaddr( iface, IFACE_PHASE2, iface->i_addr.sat_addr.s_net, iface->i_addr.sat_addr.s_node,
0, htons( STARTUP_LASTNET ));
htons( OS_STARTUP_FIRSTNET ), htons( STARTUP_LASTNET ));
}
if ( looproute( iface, RTMP_ADD ) ) { /* -1 or 1 */
LOG(log_error, logtype_atalkd, "as_timer: can't route %u.%u to loopback: %s",
Expand Down
7 changes: 7 additions & 0 deletions etc/atalkd/rtmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ struct rtmp_tuple {
#define STARTUP_FIRSTNET 0xff00
#define STARTUP_LASTNET 0xfffe

/* On NetBSD, Net 0 is reserved for lo0, it can't be used on other interfaces. */
#ifndef __NetBSD__
#define OS_STARTUP_FIRSTNET 0
#else
#define OS_STARTUP_FIRSTNET 1
#endif

extern int rtfd;
struct rtmptab *newrt (const struct interface *);
void rtmp_delzonemap (struct rtmptab *);
Expand Down