Subject: Re: Why netmask 255.255.255.255 is needed for PPP
To: None <current-users@NetBSD.ORG, tron@lyssa.owl.de>
From: Paul Shupak <paul@plectere.com>
List: current-users
Date: 11/22/1996 08:28:34
You are correct that in many enviroments the netmask MUST be set
to 255.255.255.255. The following change allows that value to be set by
pppd's "options" ( either in a file or on the command line ).
Paul Shupak
*** /usr/src/usr.sbin/pppd/options.c Sun Apr 14 18:56:23 1996
--- /usr/src/usr.sbin/pppd/options.c-ORIG Fri Nov 22 07:53:23 1996
***************
*** 1477,1490 ****
setnetmask(argv)
char **argv;
{
! struct in_addr mask;
! if ( !inet_aton(*argv, &mask) || (netmask & ~mask.s_addr) != 0) {
fprintf(stderr, "Invalid netmask %s\n", *argv);
return 0;
}
! netmask = mask.s_addr;
return (1);
}
--- 1477,1490 ----
setnetmask(argv)
char **argv;
{
! u_int32_t mask;
! if ((mask = inet_addr(*argv)) == -1 || (netmask & ~mask) != 0) {
fprintf(stderr, "Invalid netmask %s\n", *argv);
return 0;
}
! netmask = mask;
return (1);
}