Bug 112142 - Misc/getIP function fails to return ip address
Summary: Misc/getIP function fails to return ip address
Status: RESOLVED UNMAINTAINED
Alias: None
Product: superkaramba
Classification: Miscellaneous
Component: general (show other bugs)
Version: 0.37-RC2
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Ryan Nickell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-07 06:11 UTC by Niko Mirthes
Modified: 2014-08-17 08:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niko Mirthes 2005-09-07 06:11:20 UTC
Version:           0.37-RC2 (using KDE KDE 3.4.2)
Installed from:    Fedora RPMs
Compiler:          gcc 4.0.1 
OS:                Linux

karamba.getIp(widget, "interface_name") seems to fail, returning Disconnected whether the specified interface (eth0, ppp0, etc) is up or not. I've checked and double-checked, and afaict I am passing it a valid interface name.

I've made a test theme available here:

http://personal.nbnet.nb.ca/strawman/getIP-Test/

This seems to demonstrate the problem, at least for me.
Comment 1 Ryan Nickell 2005-09-07 06:38:23 UTC
This was verified with the posted test theme.
Comment 2 Ryan Nickell 2005-09-08 01:12:59 UTC
In the test theme, the function was being called incorrectly.

interface="ppp0"
currentIP = karamba.getIp(widget, "interface")

It should have been like this:
interface="ppp0"
currentIP = karamba.getIp(widget, interface)

Comment 3 Niko Mirthes 2005-09-08 05:32:18 UTC
I've fixed the mistake in the python script, and found the problem. Once superkaramba is patched to print some debugging messages when using Misc/getIP, it prints:

misc_python.getIp ignoring LOOOPBACK ifr_name: lo
misc_python.getIp ignoring BROADCAST address ifr_name: ppp0

Since I use pppoe, my NIC is never assigned and ipv4 address (it does get an ipv6 address) even though eth0 is created. If I assign eth0 an ipv4 address, Misc/getIP grabs it with no trouble.

misc_python.getIp ignoring LOOOPBACK ifr_name: lo
misc_python.getIp Checking ifr_name: eth0  device_name: eth0
misc_python.getIp found match device_name: eth0

The fixed (i think) python script, theme, and a patch derived from a more verbose copy of misc_python.cpp from Ryan are here:

http://personal.nbnet.nb.ca/strawman/getIP-Test/
Comment 4 Ryan Nickell 2005-09-08 06:09:25 UTC
This is being reopened because further investigation shows that pppoe isn't recognized correctly on ppp0.  Notice how there are two ip's listed for ppp0.
The 'inet addr' is the one that shows up to external connections.

Here's the users ifconfig output:

eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet6 addr: xxxx::xxx:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:65473 errors:0 dropped:0 overruns:0 frame:0
          TX packets:48665 errors:0 dropped:0 overruns:0 carrier:0
          collisions:55 txqueuelen:1000
          RX bytes:76853188 (73.2 MiB)  TX bytes:5396295 (5.1 MiB)
          Interrupt:11 Base address:0xd800
 
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2352 (2.2 KiB)  TX bytes:2352 (2.2 KiB)
 
ppp0      Link encap:Point-to-Point Protocol
          inet addr:xxx.xxx.xxx.xxx  P-t-P:xxx.xxx.xxx.xxx  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:62983 errors:0 dropped:0 overruns:0 frame:0
          TX packets:46170 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:75318096 (71.8 MiB)  TX bytes:4230717 (4.0 MiB)