Date: Sun, 07 Jan 2024 17:52:40 +0000 From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 258874] route add -inet 240/4 results in 0.0.0.0/4 127.0.0.1 UGRS lo0 Message-ID: <bug-258874-7501-RyiwnyIJhs@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-258874-7501@https.bugs.freebsd.org/bugzilla/> References: <bug-258874-7501@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258874 paul vixie <paul@redbarn.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul@redbarn.org --- Comment #10 from paul vixie <paul@redbarn.org> --- in inet_addr(3) we see this text: INTERNET ADDRESSES Values specified using the =E2=80=98.=E2=80=99 notation take one of th= e following forms: a.b.c.d a.b.c a.b a When four parts are specified, each is interpreted as a byte of data a= nd assigned, from left to right, to the four bytes of an Internet address. Note that when an Internet address is viewed as a 32-bit integer quant= ity on the VAX the bytes referred to above appear as =E2=80=9Cd.c.b.a=E2= =80=9D. That is, VAX bytes are ordered from right to left. When a three part address is specified, the last part is interpreted a= s a 16-bit quantity and placed in the least significant two bytes of the network address. When a two part address is supplied, the last part is interpreted as a 24-bit quantity and placed in the least significant three bytes of the network address. When only one part is given, the value is stored directly in the netwo= rk address without any byte rearrangement. this is echoed by inet_net_ntop(3) -- same text. so, i never liked this or understood it, and i did not preserve this syntax= in inet_pton(), but it's still documented, and i think we ought to either make sure it isn't documented and never works anywhere, or that "route" should support it. i did preserve this in inet_net_pton(), so if "route" were to just use that, then these examples (10/8 or even just 10) would work as seems to still be expected. separately, inet_network() probably should use inet_net_pton() no= w. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-258874-7501-RyiwnyIJhs>