Ticket #159 (closed defect: fixed)

Opened 2 months ago

Last modified 4 weeks ago

bind interface detection is broken

Reported by: trickie Assigned to: dev
Priority: major Milestone: 0.6
Component: Core Version:
Keywords: Cc:

Description (Last modified by dev)

When detecting the interface to bind to, at the moment coherence tries to parse /proc/net/route and then fallback to parsing netstat output (this is on linux), if you didn't supply the interface to bind to in config. The test when picking an interface while parsing /proc/net/route in the function get_host_address should look for the destination '00000000' (like when parsing netstat output) or at least exclude the 'lo' interface. I have a bridge interface for various physical interfaces and when currently taking the first non-0.0.0.0 gateway it always binds to 'lo', so i cannot use the rhythmbox plugin successfully as it does not look for user config and fallbacks to interface detection.

Attachments

0.5.8-bind_if_detection.patch (0.5 kB) - added by trickie on 11.11.2008 07:19:02.
patch for interface detection

Change History

09.11.2008 14:04:09 changed by trickie

09.11.2008 14:04:42 changed by trickie

ha, broke it again, but i think it works :)

(in reply to: ↑ description ) 10.11.2008 23:13:42 changed by dev

  • status changed from new to assigned.
  • description changed.
  • milestone set to 0.6.

Replying to trickie:

When detecting the interface to bind to, at the moment coherence tries to parse /proc/net/route and then fallback to parsing netstat output (this is on linux), if you didn't supply the interface to bind to in config. The test when picking an interface while parsing /proc/net/route in the function get_host_address should look for the destination '00000000' (like when parsing netstat output) or at least exclude the 'lo' interface. I have a bridge interface for various physical interfaces and when currently taking the first non-0.0.0.0 gateway it always binds to 'lo', so i cannot use the rhythmbox plugin successfully as it does not look for user config and fallbacks to interface detection.

(follow-up: ↓ 5 ) 10.11.2008 23:15:29 changed by dev

  • description changed.

Hi,

I have a bridge interface for various physical interfaces and when > currently taking the first non-0.0.0.0 gateway it always binds to 'lo', so i cannot use the rhythmbox plugin successfully as it does not look for user config and fallbacks to interface detection.

ok, ic. Could you pls attach the output of /proc/net/route here, so I can use that for the unit-tests.

And yes, the rb plugin needs some via the plugin-ui accessible config options.

(in reply to: ↑ 4 ) 11.11.2008 07:17:28 changed by trickie

Replying to dev:

Hi,

I have a bridge interface for various physical interfaces and when > currently taking the first non-0.0.0.0 gateway it always binds to 'lo', so i cannot use the rhythmbox plugin successfully as it does not look for user config and fallbacks to interface detection.

ok, ic. Could you pls attach the output of /proc/net/route here, so I can use that for the unit-tests.

Sure thing.

Iface   Destination     Gateway         Flags   RefCnt  Use     Metric  Mask            MTU     Window  IRTT                                                       
br0     0001A8C0        00000000        0001    0       0       0       00FFFFFF        0       0       0                                                                                
lo      0000007F        0100007F        0003    0       0       0       000000FF        0       0       0                                                                                 
br0     00000000        FE01A8C0        0003    0       0       7       00000000        0       0       0

And yes, the rb plugin needs some via the plugin-ui accessible config options.

11.11.2008 07:18:37 changed by trickie

I also attached the patch that works quite well for me.

11.11.2008 07:19:02 changed by trickie

  • attachment 0.5.8-bind_if_detection.patch added.

patch for interface detection

11.12.2008 22:29:05 changed by dev

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [1038]) applying patch from trickie, thx!

closes #159