Date: Wed, 23 Nov 2011 19:13:34 +0400 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Qing Li <qingli@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227791 - head/sys/netinet Message-ID: <20111123151334.GC96616@FreeBSD.org> In-Reply-To: <CAGnGRdKsKMT%2BDsuj5aXbso8VCpkPiEJz-H8qsheJtPNpK13tvA@mail.gmail.com> References: <201111211410.pALEAD9B046139@svn.freebsd.org> <CAGnGRdLpWwTkfjirBYe7x-1TVOMtHiRJNX4dM-iQXwQgP3mCVQ@mail.gmail.com> <20111121195439.GE96616@FreeBSD.org> <CAGnGRdL%2BTBG7O55FnfgTmLBE8=cdZPy%2BcOdJZNgbB9P=BCdMww@mail.gmail.com> <20111122154312.GL96616@FreeBSD.org> <CAGnGRdKsKMT%2BDsuj5aXbso8VCpkPiEJz-H8qsheJtPNpK13tvA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 23, 2011 at 06:53:05AM -0800, Qing Li wrote:
Q> > first I'd like to notice that we are speaking about obsoleted interfaces.
Q>
Q> Yup, that's why you don't see me commenting on your other commits around
Q> ia_netmask stuff, do you ?
Oops, I didn't notice that one. Sorry! Can you please resend it?
Q> > Back to your comments:
Q> >
Q> > I have made a test case that proves, that usage of deleted address isn't
Q> > prevented when it is removed, but loopback route still exists.
Q> >
Q> > The test is the following run a race between this program:
Q> >
Q> > struct ifreq ifr;
Q> > int s;
Q> >
Q> > bzero(&ifr, sizeof(struct ifreq));
Q> >
Q> > strncpy(ifr.ifr_name, "igb1", sizeof ifr.ifr_name);
Q> > ifr.ifr_addr.sa_family = AF_INET;
Q> > ifr.ifr_addr.sa_len = sizeof(struct sockaddr_in);
Q> > ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr = inet_addr("10.0.0.1");
Q> >
Q> > s = socket(AF_INET, SOCK_DGRAM, 0);
Q> >
Q> > for (;;)
Q> > ioctl(s, SIOCSIFADDR, &ifr);
Q> >
Q> > And this script:
Q> >
Q> > while (true); do nc -z 10.0.0.1 22 || echo Fail; done
Q> >
Q>
Q> I am not sure if this test scenario is valid.
Q>
Q> The loopback route is wiped at line #853 and then quickly inserted back at
Q> line #936 because you are SIOCSIFADDR the same address over and over again.
But during the procedure there is a state when we do not have this address,
but still we receive traffic to it. That is the thing I don't like.
If you really insist on this, let's shift in_ifscrub() down below as it was.
Since it affects only obsoleted SIOCSIFADDR, I'd better just ignore that
behavior rather than stand on its incorrectness.
--
Totus tuus, Glebius.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111123151334.GC96616>
