Skip to contentSkip to conversation

Can it possible to call the bridge ioctl calls from another module code...

Bridge srinivas naga vutukuri 2 participants 2 messages May 10, 2005 – May 13, 2005 Ethernet bridge

lore
Share & tools
lore
#0 lore raw

Hi,

I am using 2.4.x kernel and the kernel native bridge code
(for bridging).
I am creating Pseudo net_devices' which should be added to the bridge interfaces.
without intervention of bridge-utils (ie., brctl) to add interface from the userland,
can i able to call the br_ioctl (), br_ioctl_deviceless_stub () which is calling the static br_ioctl_deviceless () function, which is adding/deleting the interface from the
bridge. But my doubt is they are not defined as static, am thought global scope, but no where exported those function symbols, so using directly into another module is correct way of usage?

Thanks for help in advance.

best regards,
srinivas.

#1 lore raw
Quoted 15 lines · On Tue, 10 May 2005 06:23:24 +0530 srinivas naga vutukuri…

Hi,

I am using 2.4.x kernel and the kernel native bridge code
(for bridging).
I am creating Pseudo net_devices' which should be added to the bridge interfaces.
without intervention of bridge-utils (ie., brctl) to add interface from the userland,
can i able to call the br_ioctl (), br_ioctl_deviceless_stub () which is calling the static br_ioctl_deviceless () function, which is adding/deleting the interface from the
bridge. But my doubt is they are not defined as static, am thought global scope, but no where exported those function symbols, so using directly into another module is correct way of usage?

What you need to do is have a socket around and feed sock_ioctl() the appropriate request. Alternatively, you could simulate user call like the code in 2.6 br_if.c does to fake ethtool:

	strncpy(ifr.ifr_name, dev->name, IFNAMSIZ);
	ifr.ifr_data = (void __user *) &ecmd;

	old_fs = get_fs();
	set_fs(KERNEL_DS);
	err = dev_ethtool(&ifr);
	set_fs(old_fs);
	
	if (!err) {

Easier to just do something call_usermodehelper or do it all from user mode.