Wireless Device Connection offers wrong IP address

Bug #1041203 reported by Edwin Masters
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Charles Haley

Bug Description

Running 0.8.65 on windows 7 ultimate x64
when starting wireless device connection the ip address that is used is Ethernet adapter Local Area Connection 6 (169.254.48.57) - This is a virtual adapter created by VirtualBox as a host-only adapter for virtualbox machines.
The correct ip should be 192.168.1.65 on Ethernet adapter Local Area Connection (Realtek adapter)

windows ipconfig shows

Ethernet adapter Leaf Networks Adapter:

   Connection-specific DNS Suffix . :
   Link-local IPv6 Address . . . . . : fe80::c87b:3e9d:b708:5e37%26
   IPv4 Address. . . . . . . . . . . : 5.170.8.14
   Subnet Mask . . . . . . . . . . . : 255.0.0.0
   Default Gateway . . . . . . . . . :

Ethernet adapter Bluetooth Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix . :

Ethernet adapter Local Area Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix . :

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix . : lan
   Link-local IPv6 Address . . . . . : fe80::4f5:33dd:d9d8:b51b%10
   IPv4 Address. . . . . . . . . . . : 192.168.1.65
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.254

Ethernet adapter Local Area Connection 6:

   Connection-specific DNS Suffix . :
   Link-local IPv6 Address . . . . . : fe80::983b:3472:1d2a:3039%32
   Autoconfiguration IPv4 Address. . : 169.254.48.57
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :

when I disable the adaptor the correct IP address is obtained.
It would be great if the correct adapter IP could be chosen when wireless device connection is started

Related branches

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1041203

Changing the component for this bug.

 assignee cbhaley
 status triaged

Changed in calibre:
assignee: nobody → Charles Haley (cbhaley)
status: New → Triaged
Revision history for this message
Charles Haley (cbhaley) wrote :

To be sure -- are you saying that when the VBox adapter is enabled CC cannot connect to your machine, or that the menu line in calibre displays the "wrong" IP address but connections are still possible? I think it is the latter because the wireless driver listens on all interfaces, not just the one listed in the menu line.

In your case, it should be that a device on any of the three enabled networks with IPV4 addresses can contact calibre. I am not sure what makes any of them "wrong" other than you knowing that no device will ever be on that network. For example, if you turn on what appears to be a bluetooth PANetwork, your device should be able to connect over that even if your computer has its wireless adapter turned on.

Revision history for this message
Edwin Masters (edwinm-r) wrote : RE: [Bug 1041203] Re: Wireless Device Connection offers wrong IP address
Download full text (3.5 KiB)

Hi
I confirm that when Vbox adapter is enabled CC cannot connect to my machine and it is using the Vbox adapter IP which seems to be virtual with no network access (I believe the access only becomes active when a vbox machine is running - despite the adapter being enabled all the time)

I would be happy to try any tests etc to help resolve. As previously stated, when adapter is dissabled, all works as it should.

Regards
Edwin Masters

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Charles Haley
Sent: 24 August 2012 15:55
To: <email address hidden>
Subject: [Bug 1041203] Re: Wireless Device Connection offers wrong IP address

To be sure -- are you saying that when the VBox adapter is enabled CC cannot connect to your machine, or that the menu line in calibre displays the "wrong" IP address but connections are still possible? I think it is the latter because the wireless driver listens on all interfaces, not just the one listed in the menu line.

In your case, it should be that a device on any of the three enabled networks with IPV4 addresses can contact calibre. I am not sure what makes any of them "wrong" other than you knowing that no device will ever be on that network. For example, if you turn on what appears to be a bluetooth PANetwork, your device should be able to connect over that even if your computer has its wireless adapter turned on.

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1041203

Title:
  Wireless Device Connection offers wrong IP address

Status in calibre: e-book management:
  Triaged

Bug description:
  Running 0.8.65 on windows 7 ultimate x64
  when starting wireless device connection the ip address that is used is Ethernet adapter Local Area Connection 6 (169.254.48.57) - This is a virtual adapter created by VirtualBox as a host-only adapter for virtualbox machines.
  The correct ip should be 192.168.1.65 on Ethernet adapter Local Area Connection (Realtek adapter)

  windows ipconfig shows

  Ethernet adapter Leaf Networks Adapter:

     Connection-specific DNS Suffix . :
     Link-local IPv6 Address . . . . . : fe80::c87b:3e9d:b708:5e37%26
     IPv4 Address. . . . . . . . . . . : 5.170.8.14
     Subnet Mask . . . . . . . . . . . : 255.0.0.0
     Default Gateway . . . . . . . . . :

  Ethernet adapter Bluetooth Network Connection:

     Media State . . . . . . . . . . . : Media disconnected
     Connection-specific DNS Suffix . :

  Ethernet adapter Local Area Connection 2:

     Media State . . . . . . . . . . . : Media disconnected
     Connection-specific DNS Suffix . :

  Ethernet adapter Local Area Connection:

     Connection-specific DNS Suffix . : lan
     Link-local IPv6 Address . . . . . : fe80::4f5:33dd:d9d8:b51b%10
     IPv4 Address. . . . . . . . . . . : 192.168.1.65
     Subnet Mask . . . . . . . . . . . : 255.255.255.0
     Default Gateway . . . . . . . . . : 192.168.1.254

  Ethernet adapter Local Area Connection 6:

     Connection-specific DNS Suffix . :
     Link-local IPv6 Address . . . . . : fe80::983b:3472:1d2a:3039%32
     Autoconfiguration IPv4 Address. . : 169.254.48....

Read more...

Revision history for this message
Charles Haley (cbhaley) wrote :

OK, assuming that you didn't enter the wrong fixed IP address into CC then we have a python or windows bug. The driver is explicitly asking to listen on all active interfaces. If it is not, then the network subsystem is broken.

The assumption is required because the IP address entered into CC must be on the network that CC is on, almost certainly the 192.168 one. If you entered the 169... one into CC, it will not work.

I remember that the content server was recently changed to permit specifying an IP address to listen on. My guess is that Kovid was working around a similar problem. I will add an option to the device driver to do the same thing. Once that is released, then you can enter the address of the "right" adapter to force the networking subsystem to listen to that.

Revision history for this message
Edwin Masters (edwinm-r) wrote :
Download full text (3.4 KiB)

Hi Charles

That would be Spot on

Because two adapters are active, I just think it picks up the wrong one ( I wonder in what order it looks for and decided on active adapter IP's)

Your adding an option to either select which IP or enter correct IP would be great

Regards
Edwin

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Charles Haley
Sent: 24 August 2012 18:30
To: <email address hidden>
Subject: [Bug 1041203] Re: Wireless Device Connection offers wrong IP address

OK, assuming that you didn't enter the wrong fixed IP address into CC then we have a python or windows bug. The driver is explicitly asking to listen on all active interfaces. If it is not, then the network subsystem is broken.

The assumption is required because the IP address entered into CC must be on the network that CC is on, almost certainly the 192.168 one. If you entered the 169... one into CC, it will not work.

I remember that the content server was recently changed to permit specifying an IP address to listen on. My guess is that Kovid was working around a similar problem. I will add an option to the device driver to do the same thing. Once that is released, then you can enter the address of the "right" adapter to force the networking subsystem to listen to that.

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1041203

Title:
  Wireless Device Connection offers wrong IP address

Status in calibre: e-book management:
  Triaged

Bug description:
  Running 0.8.65 on windows 7 ultimate x64
  when starting wireless device connection the ip address that is used is Ethernet adapter Local Area Connection 6 (169.254.48.57) - This is a virtual adapter created by VirtualBox as a host-only adapter for virtualbox machines.
  The correct ip should be 192.168.1.65 on Ethernet adapter Local Area Connection (Realtek adapter)

  windows ipconfig shows

  Ethernet adapter Leaf Networks Adapter:

     Connection-specific DNS Suffix . :
     Link-local IPv6 Address . . . . . : fe80::c87b:3e9d:b708:5e37%26
     IPv4 Address. . . . . . . . . . . : 5.170.8.14
     Subnet Mask . . . . . . . . . . . : 255.0.0.0
     Default Gateway . . . . . . . . . :

  Ethernet adapter Bluetooth Network Connection:

     Media State . . . . . . . . . . . : Media disconnected
     Connection-specific DNS Suffix . :

  Ethernet adapter Local Area Connection 2:

     Media State . . . . . . . . . . . : Media disconnected
     Connection-specific DNS Suffix . :

  Ethernet adapter Local Area Connection:

     Connection-specific DNS Suffix . : lan
     Link-local IPv6 Address . . . . . : fe80::4f5:33dd:d9d8:b51b%10
     IPv4 Address. . . . . . . . . . . : 192.168.1.65
     Subnet Mask . . . . . . . . . . . : 255.255.255.0
     Default Gateway . . . . . . . . . : 192.168.1.254

  Ethernet adapter Local Area Connection 6:

     Connection-specific DNS Suffix . :
     Link-local IPv6 Address . . . . . : fe80::983b:3472:1d2a:3039%32
     Autoconfiguration IPv4 Address. . : 169.254.48.57
     Subnet Mask . . . . . . . . . . . : 255.255.0.0
     Default Gateway . . . . . . . . . :

  when I di...

Read more...

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1041203

The reason for the twek to the content server was to enable listening on
IPv6 interfaces, and to allow peolple that did not want it listening on
all interfaces to choose a specific one. I haven't seen a report of this problem before.

Revision history for this message
Terry Chun (docterry) wrote :

I have been trying to figure this problem out as well. The server has worked in the past, but not in recent versions.

I haven't been able to force Calibre to use my PC's IP address, it always chooses the VB address (192.168.56.1) instead.

This would be a great option to have in the settings (or tweaks)!

Revision history for this message
Charles Haley (cbhaley) wrote :

@docterry: I am confused. What server are we talking about? And when you say "it always chooses the VB address", what is doing this choosing?

This bug report is about the wireless device driver. The driver listens on all interfaces. It is true that the IP address displayed on the menu could have been one of the VB interfaces, but this has been changed in the latest calibre release. It now displays all the IP addresses. Adding an option to force the wireless driver to listen on only one interface doesn't seem to add very much. If you know the IP address to enter into such an option, then you know the IP address to enter into calibre companion.

If you are talking about the content server, then you should file a separate report.

Revision history for this message
Charles Haley (cbhaley) wrote :

I think I finally understand what is going on.

It is true that the wireless device driver listens on all IP addresses. It is also true that mDNS responds on all IP addresses. However, what I just worked out by going through the mDNS code is that mDNS always responds with the same IP address regardless of by which interface the question arrived. This means that mDNS responses can be totally wrong, directing the client to use an IP address that the client cannot "see".

There are three things I need to do to improve this situation.

1) The client (calibre companion) makes queries in two ways, over mDNS and using a broadcast scheme. Currently, if responses are received over both schemes, mDNS wins. We will change the client so that broadcast wins.

2) Change calibre's mDNS setup so that the service IP address can be supplied by the server (content server or wireless driver).

3) Change the wireless driver to add an option to specify which IP address mDNS should provide to clients.

The first will be out in the next day or two. The second and third should be ready for release by the end of this week.

Do note that none of the above affects use of fixed IP addresses in the client to work around the problem.

Revision history for this message
Charles Haley (cbhaley) wrote :

Changes submitted.

Changed in calibre:
status: Triaged → Fix Committed
Revision history for this message
Charles Haley (cbhaley) wrote :

Fixed in branch lp:calibre. The fix will be in the next release. calibre is usually released every Friday.

Changed in calibre:
status: Fix Committed → Fix Released
Revision history for this message
Shannara (shannara) wrote :

It looks like this bug has regressed. In version 1.14 64bit, the wireless component (and the regular network component) still doesn't listen to the correct ip address.

Revision history for this message
Robert Mitchell (rmm200) wrote :

This also sounds like my bug with 2.16 64 on Vista Ultimate.
Content server picks IP address of VMWare Adapter, and can not communicate outside of it's PC.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.