! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
weather-plugin does not adapt to new network configuration
Status:
RESOLVED: FIXED
Product:
Xfce4-weather-plugin
Component:
General

Comments

Description Andreas Büsching 2008-05-28 18:19:44 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9) Gecko/2008051202 Firefox/2.0.0.3
Build Identifier: 

the weather plugin seems to cache network configuration. I've start the plugin on a network 192.168.0.0/24 with a DNS server 192.168.0.1. After suspending the machine and waking up on a network 192.168.1.0./24 with a DNS server 192.168.1.1 the plugin still tries to reach the nameserver 192.168.0.1. A restart of the plugin fixes it. so the network configuration is okay.

I found out about by tracing the process with strace.

Used xfce-weather-plugin 0.6.2-1 (Debian lenny)




Reproducible: Always

Steps to Reproduce:
1. start the plugin in network A, with local nameserver
2. suspend machine
3. wake up in another network B (different nameserver)


Actual Results:  
plugin does not reach the server for retrieving weather informationen

Expected Results:  
see information about the weather
Comment 1 Colin Leroy 2008-05-28 19:48:50 CEST
FYI, the solution to this is to refresh nameserver info, which is cached by the libc. Doing this is quite easy:


#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>

update_network_stuff() 
{
...
    res_init();
    do_network_stuff();
...
}

HTH
Comment 2 Colin Leroy 2008-05-28 20:06:32 CEST
Created attachment 1647 
Candidate patch

This patch adds a call to res_init() when needed (resolv.conf changed). It also modifies configure.in.in to link against libresolv. It should fix this bug :)
Comment 3 Colin Leroy 2009-06-09 08:37:24 CEST
Created attachment 2396 
The patch

Same patch, without autotools changes
Comment 4 Jannis Pohlmann editbugs 2009-06-12 13:21:44 CEST
Re-assigning to Colin Leroy who is the new maintainer of the plugin.
Comment 5 Colin Leroy 2009-06-12 13:26:26 CEST
Patch applied in svn r7526.
Comment 6 Colin Leroy 2009-06-12 13:28:25 CEST
Patch applied in svn r7526.

Bug #4118

Reported by:
Andreas Büsching
Reported on: 2008-05-28
Last modified on: 2014-12-07

People

Assignee:
Colin Leroy
CC List:
2 users

Version

Version:
0.7.3 or older

Attachments

Candidate patch (12.05 KB, patch)
2008-05-28 20:06 CEST , Colin Leroy
no flags
The patch (2.42 KB, patch)
2009-06-09 08:37 CEST , Colin Leroy
no flags

Additional information