[nos-bbs] Situation: ifconfig port netmask <format>

Barry Siegfried k2mf at nnj.k2mf.ampr.org
Fri Sep 22 15:48:38 EDT 2006


["(Skip) K8RRA" <k8rra at ameritech.net> wrote]:

> On Fri, 2006-09-22 at 10:15 -0500, Maiko Langelaar (ve4klm) wrote:
>
> > On Thu, 14 Sep 2006, K8RRA (Skip) wrote:
> >
> > > ifconfig tun0 netmask 0xff000000
> >
> > Generates correct behaviour
> >
> > > ifconfig tun0 netmask 255.0.0.0
> >
> > Is wrong in the sense that it is not documented that way, also I
> > took a look at the code. The passed address argument is directly
> > handed to the htol (hex to long) conversion function. So definitely
> > one is not supposed to use the decimal number convention when passing
>
> I will document per:
>
> "decimal format per 255.255... is not supported for this command,
> hex format 0xf... MUST be used."
>
> When (if) you change it I'll add to the effect:
> "prior to version 2.0X"  where you choose X.
>
> I'll watch the change notes...

Maiko... I'm sure you know that the change is trivial but I'll give
it to you real quickly here.  In ifnetmask() simply change:

	ifp->netmask = htol(argv[1]);

to:

	ifp->netmask = (isaddr(argv[1])) ? aton(argv[1]) : htol(argv[1]);

and you should be good to go with either the address form 255.0.0.0
or the hex form 0xff000000 as an argument to the 'ifconfig <interface>
netmask [<netmask>]' command.

73, de Barry, K2MF >>
           o
          <|>      Barry Siegfried
+---------/-\---------------------------+
| Internet | bgs at mfnos.net              |
| HomePage | http://www.mfnos.net/~bgs  |
+----------+----------------------------+
| Amprnet  | k2mf at nnj.k2mf.ampr.org     |
| PBBS     | k2mf at k2ge.#cnj.nj.usa.noam |
+----------+----------------------------+




More information about the nos-bbs mailing list