Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Mar 2002 17:50:36 +0200
From:      Peter Pentchev <roam@ringlet.net>
To:        Backend Chan <backend@mail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: error handling in in_ifinit()
Message-ID:  <20020322175036.A329@straylight.oblivion.bg>
In-Reply-To: <20020322145053.46711.qmail@mail.com>; from backend@mail.com on Fri, Mar 22, 2002 at 09:50:53AM -0500
References:  <20020322145053.46711.qmail@mail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--nFreZHaLTZJo0R7j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 22, 2002 at 09:50:53AM -0500, Backend Chan wrote:
>=20
> In the newest 4-stable kernel whose source codes are synchronized by cvsu=
p,
> it would fail if trying to add an alias address whose network and netmask
> are the same as the orignal one on that network interface:
>=20
> # uname -a
> FreeBSD intra.example.com 4.5-STABLE FreeBSD 4.5-STABLE #5: Fri Mar 22
> 13:45:41 CST 2002    root@intra.example.com:/usr/src/sys/compile/SERVER i=
386
> # ifconfig xl0 inet 192.168.1.100 netmask 0xffffff00
> # ifconfig xl0 inet 192.168.1.101 netmask 0xffffff00 alias
> ifconfig: ioctl (SIOCDIFADDR): File exists
>=20
> But it worked for 4.4-Release (I'd tested):
>=20
> #uname -a
> FreeBSD bsd.example.com 4.4-RELEASE FreeBSD 4.4-RELEASE # 17: Fri Mar 22
> 12:09:36 CST 2002    root@bsd.example.com:/usr/src/sys/compile/SERVER i386
> # ifconfig xl0 inet 192.168.1.100 netmask 0xffffff00
> # ifconfig xl0 inet 192.168.1.101 netmask 0xffffff00 alias
> # ifconfig xl0
> xl0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
[snip]
>         inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
>         inet6 fe80::201:2ff:fe80:2a8b%xl0 prefixlen 64 scopeid 0x2=20
>         inet 192.168.1.101 netmask 0xffffff00 broadcast 255.255.255.0
>=20
> Below is a workground patch:
[snip patch]
>=20
> Should it be done so?

Not really.

The ifconfig(8) manual page has documented this since.. well, for a LONG ti=
me:

  alias   Establish an additional network address for this interface.  This
          is sometimes useful when changing network numbers, and one wishes
          to accept packets addressed to the old interface.  If the address
          is on the same subnet as the first network address for this
          interface, a netmask of 0xffffffff has to be specified.

This is also covered in the FreeBSD FAQ, chapter 12 - "Networking",
question 12.2 - "How do I set up Ethernet aliases?".

The correct setup is to use a netmask of 0xffffffff (255.255.255.255)
for the alias.

G'luck,
Peter

--=20
Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This would easier understand fewer had omitted.

--nFreZHaLTZJo0R7j
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjybUswACgkQ7Ri2jRYZRVOe0gCguY9ym5Eum2D6TCM+NVLAGSW7
HyMAnApPlFR5srFNEgb0OS/RsSd2sUjz
=cdrS
-----END PGP SIGNATURE-----

--nFreZHaLTZJo0R7j--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020322175036.A329>