Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jun 1997 19:29:07 +1000
From:      David Nugent <davidn@unique.usn.blaze.net.au>
To:        freebsd-hackers@freebsd.org
Subject:   bind and aliases
Message-ID:  <199706160929.TAA08450@unique.usn.blaze.net.au>

next in thread | raw e-mail | index | archive | help
I'm attempting to set up a server and seem to have a problem.
I can't get the (UDP based) server running when binding to a
specific address, but it does work just fine when binding to
any.

The executable is a BSD binary (actually, this is Id's
unixded, the dedicated quake server). It has a command line
option to bind to a specific address so that you can run
multiple servers on the same machine using the default udp
port. ktrace shows the following:

  4703 unixded  CALL  socket(0x2,0x2,0x11)

Aka, socket(PF_INET, SOCK_DGRAM, 16)

[hmm, no protocol 16 defined in /etc/protocols...]

  4703 unixded  RET   socket 6
  4703 unixded  CALL  ioctl(0x6,FIONBIO,0xefbfd73c)
  4703 unixded  RET   ioctl 0
  4703 unixded  CALL  write(0x1,0x961000,0x31)
  4703 unixded  GIO   fd 1 wrote 49 bytes
       "Binding to IP Interface Address of 203.17.53.241
       "
  4703 unixded  RET   write 49/0x31

Call to bind follows:-

  4703 unixded  CALL  bind(0x6,0xefbfd740,0x10)
  4703 unixded  RET   bind -1 errno 49 Can't assign requested address
  4703 unixded  CALL  close(0x6)
  4703 unixded  RET   close 0
  4703 unixded  CALL  write(0x2,0xefbfd080,0x28)
  4703 unixded  GIO   fd 2 wrote 40 bytes
       "UDP_Init: Unable to open control socket
       "

But bind(2) failes with errno 49, which suggests that there's no
interface with this address. However, even the default ip address
on the ed0 interface won't work here. This is its ifconfig:

ed0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	inet 203.17.53.17 netmask 0xfffffff0 broadcast 203.17.53.31
	inet 203.17.53.241 netmask 0xffffffff broadcast 203.17.53.241
	inet 203.17.53.242 netmask 0xffffffff broadcast 203.17.53.242
	inet 203.17.53.243 netmask 0xffffffff broadcast 203.17.53.243
	ether 00:00:c0:d5:a5:10 

Anyone have any ideas?  I first tried this under -current as of
May 14th or thereabouts, but just updated to yesterday's -current
and the result is the same. What's worse is that I know this works
ok for tcp sockets since I've recently been using bind(2) on
specific addresses in code I'm working on.

Regards,
David




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