linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valmantas <walmis@gmail.com>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] bluetoothd-service-network fails to execute ifup	scripts from network.conf after repeated connection attempts (Patched)
Date: Wed, 30 Apr 2008 12:45:44 +0300	[thread overview]
Message-ID: <1209548744.5829.5.camel@ubuntu> (raw)
In-Reply-To: <821c07e60804292333g4271303lfade6b403acfb8b@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2363 bytes --]

Ok, so i made a proper patch. It does not execute the scripts as the
previous did, but it does properly bring up the server side bnep
interfaces after numerous connections.

Waiting for review.

oh, and here's some output:

network[19366]: Authorization succedded. New connection: bnep0
network[19366]: Bringing up interface pan0
network[19366]: Bringing up interface bnep0
network[19366]: filter_function: sender=:1.60 destination=:1.58
obj_path=/org/bluez/network interface=org.bluez.network.Manager
method=FindConnection
network[19366]: /org/bluez/network:
org.bluez.network.Manager.FindConnection()
network[19366]: filter_function: sender=:1.5 destination=(null)
obj_path=/org/freedesktop/Hal/Manager
interface=org.freedesktop.Hal.Manager method=DeviceAdded
Found user 'avahi-autoipd' (UID 103) and group 'avahi-autoipd' (GID
110).
Successfully called chroot().
Successfully dropped root privileges.
Starting with address 169.254.5.87
Callout BIND, address 169.254.5.87 on interface pan0
network[19366]: filter_function: sender=:1.5 destination=(null)
obj_path=/org/freedesktop/Hal/Manager
interface=org.freedesktop.Hal.Manager method=DeviceRemoved
network[19366]: filter_function: sender=:1.5 destination=(null)
obj_path=/org/freedesktop/Hal/Manager
interface=org.freedesktop.Hal.Manager method=DeviceRemoved
Successfully claimed IP address 169.254.5.87
network[19366]: filter_function: sender=:1.5 destination=(null)
obj_path=/org/freedesktop/Hal/Manager
interface=org.freedesktop.Hal.Manager method=DeviceAdded
hcid[19363]: link_key_request (sba=00:09:DD:50:6E:2F,
dba=00:1A:92:FF:16:0D)
network[19366]: Connection from: 00:1A:92:FF:16:0D on PSM 15
hcid[19363]: link_key_notify (sba=00:09:DD:50:6E:2F,
dba=00:1A:92:FF:16:0D)
network[19366]: Requesting authorization for 00:1A:92:FF:16:0D
UUID:00001117-0000-1000-8000-00805f9b34fb
network[19366]: Authorization succedded. New connection: bnep0
network[19366]: Bringing up interface bnep0
network[19366]: filter_function: sender=:1.61 destination=:1.58
obj_path=/org/bluez/network interface=org.bluez.network.Manager
method=FindConnection
network[19366]: /org/bluez/network:
org.bluez.network.Manager.FindConnection()
network[19366]: filter_function: sender=:1.5 destination=(null)
obj_path=/org/freedesktop/Hal/Manager
interface=org.freedesktop.Hal.Manager method=DeviceAdded


Regards, 
Valmantas Palikša

[-- Attachment #2: 008_server_bnep_ifup.patch --]
[-- Type: text/x-patch, Size: 1573 bytes --]

--- network/common.c.old	2008-04-30 12:33:43.000000000 +0300
+++ network/common.c	2008-04-30 12:29:27.000000000 +0300
@@ -71,6 +71,7 @@
 	char *devname;
 	char *script;
 	int pid;
+	int is_initialized;
 };
 
 static gint find_devname(gconstpointer a, gconstpointer b)
@@ -235,22 +236,23 @@
 	/* Check if a script is running */
 	if ((l = g_slist_find_custom(pids, devname, find_devname))) {
 		bnep = l->data;
+		if(bnep->pid != 0) {
+			if (bnep->script && !strcmp(bnep->script, "avahi-autoipd")) {
+				argv[0] = bnep->script;
+				argv[1] = devname;
+				argv[2] = "--refresh";
+				argv[3] = NULL;
+
+				flags = G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH;
+				g_spawn_async(NULL, (char **) argv, NULL, flags,
+						bnep_setup, (gpointer) devname, &pid,
+						NULL);
+			}
 
-		if (bnep->script && !strcmp(bnep->script, "avahi-autoipd")) {
-			argv[0] = bnep->script;
-			argv[1] = devname;
-			argv[2] = "--refresh";
-			argv[3] = NULL;
-
-			flags = G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH;
-			g_spawn_async(NULL, (char **) argv, NULL, flags,
-					bnep_setup, (gpointer) devname, &pid,
-					NULL);
+			return bnep->pid;
 		}
-
-		return bnep->pid;
 	}
-
+	info("Bringing up interface %s", devname);
 	sd = socket(AF_INET6, SOCK_DGRAM, 0);
 	memset(&ifr, 0, sizeof(ifr));
 	strcpy(ifr.ifr_name, devname);
@@ -264,10 +266,13 @@
 			err);
 		return -err;
 	}
+	
+	if(!id && bnep->is_initialized)
+		return bnep->pid;
 
 	bnep = g_new0(struct bnep_data, 1);
 	bnep->devname = g_strdup(devname);
-
+	bnep->is_initialized = 1;
 	if (!id)
 		goto done;
 

[-- Attachment #3: Type: text/plain, Size: 320 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2008-04-30  9:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 20:42 [Bluez-devel] bluetoothd-service-network fails to execute ifup scripts from network.conf after repeated connection attempts (Patched) Valmantas
2008-04-30  2:06 ` Luiz Augusto von Dentz
2008-04-30  6:33   ` walmis
2008-04-30  9:45     ` Valmantas [this message]
2008-04-30 18:37       ` Luiz Augusto von Dentz
2008-04-30 19:36         ` Valmantas
2008-04-30 19:38           ` Valmantas
2008-05-06 22:27           ` Luiz Augusto von Dentz
2008-05-08  5:56             ` walmis
2008-05-08  9:55               ` [Bluez-devel] BlueZ API Documentation Saurabh.Mukadam
2008-05-08 13:43               ` [Bluez-devel] bluetoothd-service-network fails to execute ifup scripts from network.conf after repeated connection attempts (Patched) Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1209548744.5829.5.camel@ubuntu \
    --to=walmis@gmail.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).