Displaying 17 results from an estimated 17 matches for "ifr_ifindex".
2007 Apr 18
0
[Bluez-devel] Re: [Bridge] bridging bluetooth bnep deviceswith kernel 2.6.6-*
The ifreq structure to br_dev_do_ioctl() gives you the interface index
(rq->ifr_ifindex) which is currently not being used.
May be it can help..
-Kishore
>>> David Woodhouse <dwmw2@infradead.org> 05/19/04 10:30PM >>>
On Tue, 2004-05-18 at 15:36 -0700, Stephen Hemminger wrote:
> Hmm, since all the blue tooth devices have the same address.
> Deleting th...
2006 Aug 02
0
no PROMISC mode ..
...t will just request to be
removed to that membership, decreasing the counter.
The code nowadays is fairly close to this :
-----
struct packet_mreq mr;
[.....]
memset(&mr,0,sizeof(mr));
mr.mr_ifindex = ifr.ifr_ifindex;
mr.mr_type = PACKET_MR_PROMISC;
setsockopt(sock, SOL_PACKET, PACKET_ADD_MEMBERSHIP, (char
*)&mr, sizeof(mr));
-----
That would explain why I can''t see it with ip or older ifconfig, any
call set by ioctl(SIOCGIFFLAGS) can only bee seen by t...
2007 Apr 18
1
[Bridge] Little problem with 1.x versions (if_indextoname)
Hi,
I have used bridge-utils 0.9.6 so far in a kernel 2.4.26, uClibc and ppc environment.
When I use version 1.0.3 I have the problem that I do not see the brige with the 'brctl show' command if it is not fully set up. It was working with 0.9.6.
I tracked the problem down to an 'incompatibility' in bridge/uClibc/kernel.
0.9.6 uses its own if_indextoname function which uses the
2007 Aug 13
2
Policy routing question
Hi,
I have a testing multihome setup, with the default gateway being one of
the links and using policy routing to honor requests for a specific
link. Everything works as expected when I request a specific IP to bind
to. But if I request a specific interface things fall apart in ways that
I can not explain:
default gw (WORKS)
----------
rabbit@Thesaurus:~$ ping -c 1 yahoo.com
PING yahoo.com
2007 Apr 18
0
[Bridge] [PATCH] (9/11) bridge -- new ioctl interface for 32/64 compatiablity
...}
+ return -EOPNOTSUPP;
+}
+
+int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+{
+ struct net_bridge *br = netdev_priv(dev);
+
+ switch(cmd) {
+ case SIOCDEVPRIVATE:
+ return old_dev_ioctl(dev, rq, cmd);
+
+ case SIOCBRADDIF:
+ case SIOCBRDELIF:
+ return add_del_if(br, rq->ifr_ifindex, cmd == SIOCBRADDIF);
+
+ }
+
+ printk(KERN_DEBUG "Bridge does not support ioctl 0x%x\n", cmd);
return -EOPNOTSUPP;
}
diff -Nru a/net/bridge/br_private.h b/net/bridge/br_private.h
--- a/net/bridge/br_private.h 2004-05-20 14:46:10 -07:00
+++ b/net/bridge/br_private.h 2004-05-20 14:46:10...
2009 Nov 02
0
[PATCHv4 3/6] qemu/net: add raw backend
...req.ifr_name, ifname, IFNAMSIZ-1);
+ ret = ioctl(fd, SIOCGIFINDEX, &req);
+ if (ret < 0)
+ fprintf(stderr, "SIOCGIFINDEX failed\n");
+
+ memset(&lladdr, 0, sizeof(lladdr));
+ lladdr.sll_family = AF_PACKET;
+ lladdr.sll_protocol = htons(ETH_P_ALL);
+ lladdr.sll_ifindex = req.ifr_ifindex;
+ ret = bind(fd, (const struct sockaddr *)&lladdr, sizeof(lladdr));
+ if (ret < 0)
+ fprintf(stderr, "bind failed\n");
+
+ /* set iface to promiscuous mode (packets sent to the VM MAC) */
+ if (promisc) {
+ ret = ioctl(fd, SIOCGIFFLAGS, &req);
+ if (ret < 0)
+ perror(&...
2009 Nov 02
0
[PATCHv4 3/6] qemu/net: add raw backend
...req.ifr_name, ifname, IFNAMSIZ-1);
+ ret = ioctl(fd, SIOCGIFINDEX, &req);
+ if (ret < 0)
+ fprintf(stderr, "SIOCGIFINDEX failed\n");
+
+ memset(&lladdr, 0, sizeof(lladdr));
+ lladdr.sll_family = AF_PACKET;
+ lladdr.sll_protocol = htons(ETH_P_ALL);
+ lladdr.sll_ifindex = req.ifr_ifindex;
+ ret = bind(fd, (const struct sockaddr *)&lladdr, sizeof(lladdr));
+ if (ret < 0)
+ fprintf(stderr, "bind failed\n");
+
+ /* set iface to promiscuous mode (packets sent to the VM MAC) */
+ if (promisc) {
+ ret = ioctl(fd, SIOCGIFFLAGS, &req);
+ if (ret < 0)
+ perror(&...
2009 Aug 13
0
[PATCHv2 3/3] qemu-kvm: vhost-net implementation
...eq, 0, sizeof(req));
+ strncpy(req.ifr_name, ifname, IFNAMSIZ-1);
+ r = ioctl(net->sock, SIOCGIFINDEX, &req);
+ if (r < 0)
+ return -errno;
+
+ memset(&lladdr, 0, sizeof(lladdr));
+ lladdr.sll_family = AF_PACKET;
+ lladdr.sll_protocol = htons(ETH_P_ALL);
+ lladdr.sll_ifindex = req.ifr_ifindex;
+ r = bind(net->sock, (const struct sockaddr *)&lladdr, sizeof(lladdr));
+ if (r < 0)
+ return -errno;
+
+ r = ioctl(net->dev.control, VHOST_NET_SET_SOCKET, &net->sock);
+ if (r < 0)
+ return -errno;
+ return 0;
+}
diff --git a/hw/vhost_net.h b/hw/vhost_net.h
new file mod...
2009 Aug 13
0
[PATCHv2 3/3] qemu-kvm: vhost-net implementation
...eq, 0, sizeof(req));
+ strncpy(req.ifr_name, ifname, IFNAMSIZ-1);
+ r = ioctl(net->sock, SIOCGIFINDEX, &req);
+ if (r < 0)
+ return -errno;
+
+ memset(&lladdr, 0, sizeof(lladdr));
+ lladdr.sll_family = AF_PACKET;
+ lladdr.sll_protocol = htons(ETH_P_ALL);
+ lladdr.sll_ifindex = req.ifr_ifindex;
+ r = bind(net->sock, (const struct sockaddr *)&lladdr, sizeof(lladdr));
+ if (r < 0)
+ return -errno;
+
+ r = ioctl(net->dev.control, VHOST_NET_SET_SOCKET, &net->sock);
+ if (r < 0)
+ return -errno;
+ return 0;
+}
diff --git a/hw/vhost_net.h b/hw/vhost_net.h
new file mod...
2009 Aug 17
1
[PATCHv3 3/4] qemu-kvm: vhost-net implementation
...eq, 0, sizeof(req));
+ strncpy(req.ifr_name, ifname, IFNAMSIZ-1);
+ r = ioctl(net->sock, SIOCGIFINDEX, &req);
+ if (r < 0)
+ return -errno;
+
+ memset(&lladdr, 0, sizeof(lladdr));
+ lladdr.sll_family = AF_PACKET;
+ lladdr.sll_protocol = htons(ETH_P_ALL);
+ lladdr.sll_ifindex = req.ifr_ifindex;
+ r = bind(net->sock, (const struct sockaddr *)&lladdr, sizeof(lladdr));
+ if (r < 0)
+ return -errno;
+
+ r = ioctl(net->dev.control, VHOST_NET_SET_SOCKET, &net->sock);
+ if (r < 0)
+ return -errno;
+ return 0;
+}
diff --git a/hw/vhost_net.h b/hw/vhost_net.h
new file mod...
2009 Aug 17
1
[PATCHv3 3/4] qemu-kvm: vhost-net implementation
...eq, 0, sizeof(req));
+ strncpy(req.ifr_name, ifname, IFNAMSIZ-1);
+ r = ioctl(net->sock, SIOCGIFINDEX, &req);
+ if (r < 0)
+ return -errno;
+
+ memset(&lladdr, 0, sizeof(lladdr));
+ lladdr.sll_family = AF_PACKET;
+ lladdr.sll_protocol = htons(ETH_P_ALL);
+ lladdr.sll_ifindex = req.ifr_ifindex;
+ r = bind(net->sock, (const struct sockaddr *)&lladdr, sizeof(lladdr));
+ if (r < 0)
+ return -errno;
+
+ r = ioctl(net->dev.control, VHOST_NET_SET_SOCKET, &net->sock);
+ if (r < 0)
+ return -errno;
+ return 0;
+}
diff --git a/hw/vhost_net.h b/hw/vhost_net.h
new file mod...
2009 Aug 10
0
[PATCH 3/3] qemu-kvm: vhost-net implementation
...eq, 0, sizeof(req));
+ strncpy(req.ifr_name, ifname, IFNAMSIZ-1);
+ r = ioctl(net->sock, SIOCGIFINDEX, &req);
+ if (r < 0)
+ return -errno;
+
+ memset(&lladdr, 0, sizeof(lladdr));
+ lladdr.sll_family = AF_PACKET;
+ lladdr.sll_protocol = htons(ETH_P_ALL);
+ lladdr.sll_ifindex = req.ifr_ifindex;
+ r = bind(net->sock, (const struct sockaddr *)&lladdr, sizeof(lladdr));
+ if (r < 0)
+ return -errno;
+
+ r = ioctl(net->dev.control, VHOST_NET_SET_SOCKET, &net->sock);
+ if (r < 0)
+ return -errno;
+ return 0;
+}
diff --git a/hw/vhost_net.h b/hw/vhost_net.h
new file mod...
2009 Aug 10
0
[PATCH 3/3] qemu-kvm: vhost-net implementation
...eq, 0, sizeof(req));
+ strncpy(req.ifr_name, ifname, IFNAMSIZ-1);
+ r = ioctl(net->sock, SIOCGIFINDEX, &req);
+ if (r < 0)
+ return -errno;
+
+ memset(&lladdr, 0, sizeof(lladdr));
+ lladdr.sll_family = AF_PACKET;
+ lladdr.sll_protocol = htons(ETH_P_ALL);
+ lladdr.sll_ifindex = req.ifr_ifindex;
+ r = bind(net->sock, (const struct sockaddr *)&lladdr, sizeof(lladdr));
+ if (r < 0)
+ return -errno;
+
+ r = ioctl(net->dev.control, VHOST_NET_SET_SOCKET, &net->sock);
+ if (r < 0)
+ return -errno;
+ return 0;
+}
diff --git a/hw/vhost_net.h b/hw/vhost_net.h
new file mod...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...f_name, const char *br_name)
+{
+ int ifidx;
+ struct ifreq ifr;
+
+ if (!*br_name)
+ errx(1, "must specify bridge name");
+
+ ifidx = if_nametoindex(if_name);
+ if (!ifidx)
+ errx(1, "interface %s does not exist!", if_name);
+
+ strncpy(ifr.ifr_name, br_name, IFNAMSIZ);
+ ifr.ifr_ifindex = ifidx;
+ if (ioctl(fd, SIOCBRADDIF, &ifr) < 0)
+ err(1, "can't add %s to bridge %s", if_name, br_name);
+}
+
+static void configure_device(int fd, const char *devname, u32 ipaddr,
+ unsigned char hwaddr[6])
+{
+ struct ifreq ifr;
+ struct sockaddr_in *sin = (struct so...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...f_name, const char *br_name)
+{
+ int ifidx;
+ struct ifreq ifr;
+
+ if (!*br_name)
+ errx(1, "must specify bridge name");
+
+ ifidx = if_nametoindex(if_name);
+ if (!ifidx)
+ errx(1, "interface %s does not exist!", if_name);
+
+ strncpy(ifr.ifr_name, br_name, IFNAMSIZ);
+ ifr.ifr_ifindex = ifidx;
+ if (ioctl(fd, SIOCBRADDIF, &ifr) < 0)
+ err(1, "can't add %s to bridge %s", if_name, br_name);
+}
+
+static void configure_device(int fd, const char *devname, u32 ipaddr,
+ unsigned char hwaddr[6])
+{
+ struct ifreq ifr;
+ struct sockaddr_in *sin = (struct so...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...e, const char *br_name)
+{
+ int r, ifidx;
+ struct ifreq ifr;
+
+ if (!*br_name)
+ errx(1, "must specify bridge name");
+
+ ifidx = if_nametoindex(if_name);
+ if (!ifidx)
+ errx(1, "interface %s does not exist!\n", if_name);
+
+ strncpy(ifr.ifr_name, br_name, IFNAMSIZ);
+ ifr.ifr_ifindex = ifidx;
+ r = ioctl(fd, SIOCBRADDIF, &ifr);
+ if (r != -1)
+ return;
+
+ switch (errno) {
+ case ENODEV:
+ errx(1, "bridge %s does not exist!\n", br_name);
+ case EBUSY:
+ errx(1, "device %s is already a member of a bridge; "
+ "can't enslave it to bridge %s.\...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...e, const char *br_name)
+{
+ int r, ifidx;
+ struct ifreq ifr;
+
+ if (!*br_name)
+ errx(1, "must specify bridge name");
+
+ ifidx = if_nametoindex(if_name);
+ if (!ifidx)
+ errx(1, "interface %s does not exist!\n", if_name);
+
+ strncpy(ifr.ifr_name, br_name, IFNAMSIZ);
+ ifr.ifr_ifindex = ifidx;
+ r = ioctl(fd, SIOCBRADDIF, &ifr);
+ if (r != -1)
+ return;
+
+ switch (errno) {
+ case ENODEV:
+ errx(1, "bridge %s does not exist!\n", br_name);
+ case EBUSY:
+ errx(1, "device %s is already a member of a bridge; "
+ "can't enslave it to bridge %s.\...