Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] Re: (PR#6707) Announce server on LAN
Home

[Freeciv-Dev] Re: (PR#6707) Announce server on LAN

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: andrearo@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6707) Announce server on LAN
From: rt@xxxxxxxxxxx
Date: Thu, 6 Nov 2003 05:47:29 -0800

* Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx> [031105 17:13]:
> On Wed, Nov 05, 2003 at 12:47:43PM -0800, Todd Goodman wrote:
> > * Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx> [031105 15:41]:
> > > On Wed, Nov 05, 2003 at 11:05:19AM -0800, Todd Goodman wrote:
> > > > If supported, make the SIOCADDMULTI ioctl() call to add whatever
> > > > multicast group we want to use that isn't the all-hosts (224.0.0.1)
> > > > group.
> > > > 
> > > > Then set the TTL to the configured value (default and usually 1.)
> > > 
> > > > Note that if you have multiple interfaces you really need to do an
> > > > IP_MULTICAST_IF setsockopt() first to ensure it goes out the interface
> > > > you want...
> > > 
> > > Do I understand this correctly that freeciv would have to the above
> > > paragraph if multicast is used? Independent of what multicast group is
> > > used?
> > 
> > If there were multiple interfaces on the system, then it would be a good
> > thing to do.
> > 
> > I suspect most clients would have only one interface so it doesn't
> > matter.
> > 
> > > 
> > > If yes than I think that this is clearly too much. We can't touch the
> > > interfaces of a system. You would need root privileges anyway.
> > 
> > You misunderstand how that is done.  You'd add the IP_MULTICAST_IF
> > setsockopt() call before each multicast send 
> 
> > to ensure it goes out the interface you intend.
> 
> How should freeciv decide this?

Ideally I suppose you'd let the user select one or more of the available
interfaces.

It's probably not much of an issue in most cases as most clients won't
have more than a single interface?  

> 
> > It's only for that socket so you're not messing with the interfaces
> > and I'm pretty sure you don't need root privileges (unless you need
> > them to send multicast in general.)
> 
> > > So what about the alternative plan to use broadcast? Seems simpler to
> > > me and will work with the case we discuss here (LAN). For the other
> > > case (finding servers on the internet) we have metaserver.
> > 
> > Most BSDs won't let you send to a broadcast address without root
> > privileges and I suspect the same is true of other implementations?
> 
> Uhh I think you are correct here. So the plan with the broadcast looks
> rather dead.
> 
> > Why do you want to spam other stations on the LAN who don't care about
> > Freeciv?
> 
> 1 byte UDP packets at each client startup isn't spamming in my
> eyes. People waste much more bandwidth polling their pop3 accounts.

I agree it's not much of a waste of resources.  It's more of an issue of
a host reporting an unexpected packet which triggers an admin to dig
into it further.

> 
> > It's not a problem for a home LAN of course, but if someone runs
> > Freeciv on a university or company LAN I can guarantee that there
> > are admins who will notice.
> 
> It will only send you these ping packets if the user selects the LAN
> notebook.

That's good.  I still feel that it's better not to send to the all hosts
multicast group.

> 
> > Do you want Freeciv to be known as an ill-behaved application?
> 
> I want a small solution which is portable. And if there are deficits
> with the feature it would be nice if we can give the user some
> feedback.

OK, so we use SIOCADDMULTI on all *nix's (even though it appears to be
unnecessary on Linux) based on an autoconf check for it and disable or
use an alternative for Windows?

Todd

> 
>       Raimar
> 
> -- 
>  email: rf13@xxxxxxxxxxxxxxxxx
>   Living on earth may be expensive, but it includes an annual free trip
>   around the sun.




[Prev in Thread] Current Thread [Next in Thread]