stable/9 -> stable/10 upgrade: No longer able to use loopback alias addresses as source addresses

Jase Thew jase at FreeBSD.org
Thu Dec 5 19:30:53 UTC 2013


Hi folks,

I've recently upgraded one of my test machines from stable/9 to
stable/10 and have found that I'm no longer able to use loopback alias
addresses as source addresses. When attempting to do so, I'm receiving
"Can't assign requested address" errors. I've also confirmed this in an
up-to-date HEAD VM.

└[~]> ifconfig lo0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        inet 127.0.1.1 netmask 0xffffffff
        inet 127.0.1.2 netmask 0xffffffff
        inet 127.0.1.3 netmask 0xffffffff
        inet 127.0.1.4 netmask 0xffffffff
        inet 127.0.1.5 netmask 0xffffffff
        inet 127.0.1.6 netmask 0xffffffff
        inet 127.0.1.7 netmask 0xffffffff
        inet 127.0.1.8 netmask 0xffffffff
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

└[~]> netstat -rn -f inet | grep lo0
88.198.54.184      link#1             UHS         0        0    lo0
127.0.0.1          link#2             UH          0      172    lo0
127.0.1.1          link#2             UH          0        0    lo0
127.0.1.2          link#2             UH          0        0    lo0
127.0.1.3          link#2             UH          0        0    lo0
127.0.1.4          link#2             UH          0        0    lo0
127.0.1.5          link#2             UH          0        0    lo0
127.0.1.6          link#2             UH          0        0    lo0
127.0.1.7          link#2             UH          0        0    lo0
127.0.1.8          link#2             UH          0        0    lo0

From a ktrace of telnet -4 -s 127.0.1.2 google.co.uk 80 :

  2127 telnet   CALL  socket(PF_INET,SOCK_STREAM,IPPROTO_TCP)
  2127 telnet   RET   socket 3
  2127 telnet   CALL  getuid
  2127 telnet   RET   getuid 0
  2127 telnet   CALL  setuid(0)
  2127 telnet   RET   setuid 0
  2127 telnet   CALL  setsockopt(0x3,0,0x3,0x61e790,0x4)
  2127 telnet   RET   setsockopt 0
  2127 telnet   CALL  bind(0x3,0x8034160f0,0x10)
  2127 telnet   STRU  struct sockaddr { AF_INET, 127.0.1.2:0 }
  2127 telnet   RET   bind 0
  2127 telnet   CALL  connect(0x3,0x8034161f0,0x10)
  2127 telnet   STRU  struct sockaddr { AF_INET, 173.194.112.88:80 }
  2127 telnet   RET   connect -1 errno 49 Can't assign requested address

With pretty much an identical lo0 setup on stable/8 and stable/9, this
works correctly.

Is this change of behaviour by design (and if so, how is one able to use
loopback jails and have them be able to contact the outside world short
of using some kind of proxy), or is this a bug?

Regards,

-- 
Jase Thew
jase at FreeBSD.org
FreeBSD Ports Committer


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1029 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20131205/2dbef5dd/attachment.sig>


More information about the freebsd-stable mailing list