search for: iff_promisc

Displaying 20 results from an estimated 54 matches for "iff_promisc".

2015 Oct 28
2
[PATCH v2 1/3] virtio_net: Stop doing DMA from the stack
...allmulti; + u8 *cmdbyte; struct virtio_net_ctrl_mac *mac_data; struct netdev_hw_addr *ha; int uc_count; @@ -1163,22 +1179,25 @@ static void virtnet_set_rx_mode(struct net_device *dev) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) return; - promisc = ((dev->flags & IFF_PROMISC) != 0); - allmulti = ((dev->flags & IFF_ALLMULTI) != 0); + cmdbyte = kmalloc(sizeof(*cmdbyte), GFP_ATOMIC); + if (!cmdbyte) + return; - sg_init_one(sg, &promisc, sizeof(promisc)); + sg_init_one(sg, cmdbyte, sizeof(*cmdbyte)); + *cmdbyte = ((dev->flags & IFF_PROMISC) != 0);...
2015 Oct 28
2
[PATCH v2 1/3] virtio_net: Stop doing DMA from the stack
...allmulti; + u8 *cmdbyte; struct virtio_net_ctrl_mac *mac_data; struct netdev_hw_addr *ha; int uc_count; @@ -1163,22 +1179,25 @@ static void virtnet_set_rx_mode(struct net_device *dev) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) return; - promisc = ((dev->flags & IFF_PROMISC) != 0); - allmulti = ((dev->flags & IFF_ALLMULTI) != 0); + cmdbyte = kmalloc(sizeof(*cmdbyte), GFP_ATOMIC); + if (!cmdbyte) + return; - sg_init_one(sg, &promisc, sizeof(promisc)); + sg_init_one(sg, cmdbyte, sizeof(*cmdbyte)); + *cmdbyte = ((dev->flags & IFF_PROMISC) != 0);...
2009 Apr 21
2
[Bridge] NIC unicast macs table manipulation by bridge
Using a Linux bridge I see that none of the interfaces is set to promiscuous mode but on the other hand I don't see any dev_unicast_xxx calls in the bridge code... for the case of one of the interfaces being a physical NIC (e.g eth1), what's the magic that makes the NIC RX filtering be willing to accept frames whos dest mac isn't the NIC "primary" unicast mac? Also is there
2015 Oct 28
0
[PATCH v2 1/3] virtio_net: Stop doing DMA from the stack
...virtio_net_ctrl_mac *mac_data; > struct netdev_hw_addr *ha; > int uc_count; > @@ -1163,22 +1179,25 @@ static void virtnet_set_rx_mode(struct net_device *dev) > if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) > return; > > - promisc = ((dev->flags & IFF_PROMISC) != 0); > - allmulti = ((dev->flags & IFF_ALLMULTI) != 0); > + cmdbyte = kmalloc(sizeof(*cmdbyte), GFP_ATOMIC); > + if (!cmdbyte) > + return; Here the error is ignored, rx mode will be incorrect. OTOH it looks like that's already the case. > > - sg_init_one(sg, &am...
2007 Apr 18
2
[Bridge] tg3 bridge problems
Hello, I've got a very strange problem. Lately I've been setting up my linux servers for network (layer2) redundancy with a bridge interface containing two ethernet interfaces connecting to two switches. So far I didn't have any problems with it, but now a very strange thing happens with a new server I'm installing. The server is an ibm x346 having two onboard BCM5721 cards, the
2006 Aug 02
0
no PROMISC mode ..
...e it''s using a single flag set. That was working on kernels linux <2.1.x. (2.0 etc.) Basically the mechanism was : --- strncpy(ifr.ifr_name, our_device, IFNAMSIZ); ioctl(sock, SIOCGIFFLAGS, &ifr); ifr.ifr_flags |= IFF_PROMISC; ioctl(sock, SIOCSIFFLAGS, &ifr); --- And only one could set the IFF_PROMISC, because if another process decided to set it too, then it was cleared... - Now, with kernels 2.2 and onwards, we have a different implementation of it, there''s a counter o...
2018 Apr 19
1
[PATCH v2 net 1/3] virtio_net: split out ctrl buffer
...(!virtnet_send_command(vi, VIRTIO_NET_CTRL_MQ, VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET, &sg)) { @@ -1653,22 +1657,22 @@ static void virtnet_set_rx_mode(struct net_device *dev) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) return; - vi->ctrl_promisc = ((dev->flags & IFF_PROMISC) != 0); - vi->ctrl_allmulti = ((dev->flags & IFF_ALLMULTI) != 0); + vi->ctrl->promisc = ((dev->flags & IFF_PROMISC) != 0); + vi->ctrl->allmulti = ((dev->flags & IFF_ALLMULTI) != 0); - sg_init_one(sg, &vi->ctrl_promisc, sizeof(vi->ctrl_promisc)); + sg_...
2015 Oct 28
0
[PATCH v3 1/3] virtio_net: Stop doing DMA from the stack
...allmulti; + u8 *cmdbyte; struct virtio_net_ctrl_mac *mac_data; struct netdev_hw_addr *ha; int uc_count; @@ -1163,22 +1179,25 @@ static void virtnet_set_rx_mode(struct net_device *dev) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) return; - promisc = ((dev->flags & IFF_PROMISC) != 0); - allmulti = ((dev->flags & IFF_ALLMULTI) != 0); + cmdbyte = kmalloc(sizeof(*cmdbyte), GFP_ATOMIC); + if (!cmdbyte) + return; - sg_init_one(sg, &promisc, sizeof(promisc)); + sg_init_one(sg, cmdbyte, sizeof(*cmdbyte)); + *cmdbyte = ((dev->flags & IFF_PROMISC) != 0);...
2015 Oct 28
0
[PATCH v3 1/3] virtio_net: Stop doing DMA from the stack
...virtio_net_ctrl_mac *mac_data; > struct netdev_hw_addr *ha; > int uc_count; > @@ -1163,22 +1179,25 @@ static void virtnet_set_rx_mode(struct net_device *dev) > if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) > return; > > - promisc = ((dev->flags & IFF_PROMISC) != 0); > - allmulti = ((dev->flags & IFF_ALLMULTI) != 0); > + cmdbyte = kmalloc(sizeof(*cmdbyte), GFP_ATOMIC); > + if (!cmdbyte) > + return; > > - sg_init_one(sg, &promisc, sizeof(promisc)); > + sg_init_one(sg, cmdbyte, sizeof(*cmdbyte)); > > + *cmdbyte =...
2015 Oct 30
1
[PATCH v4 1/6] virtio-net: Stop doing DMA from the stack
...; - u8 promisc, allmulti; struct virtio_net_ctrl_mac *mac_data; struct netdev_hw_addr *ha; int uc_count; @@ -1163,22 +1167,22 @@ static void virtnet_set_rx_mode(struct net_device *dev) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) return; - promisc = ((dev->flags & IFF_PROMISC) != 0); - allmulti = ((dev->flags & IFF_ALLMULTI) != 0); + vi->ctrl_promisc = ((dev->flags & IFF_PROMISC) != 0); + vi->ctrl_allmulti = ((dev->flags & IFF_ALLMULTI) != 0); - sg_init_one(sg, &promisc, sizeof(promisc)); + sg_init_one(sg, &vi->ctrl_promisc, sizeo...
2018 Apr 19
3
[PATCH net] virtio_net: split out ctrl buffer
...(!virtnet_send_command(vi, VIRTIO_NET_CTRL_MQ, VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET, &sg)) { @@ -1653,22 +1657,22 @@ static void virtnet_set_rx_mode(struct net_device *dev) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) return; - vi->ctrl_promisc = ((dev->flags & IFF_PROMISC) != 0); - vi->ctrl_allmulti = ((dev->flags & IFF_ALLMULTI) != 0); + vi->ctrl->promisc = ((dev->flags & IFF_PROMISC) != 0); + vi->ctrl->allmulti = ((dev->flags & IFF_ALLMULTI) != 0); - sg_init_one(sg, &vi->ctrl_promisc, sizeof(vi->ctrl_promisc)); + sg_...
2015 Oct 30
0
[PATCH v4 1/6] virtio-net: Stop doing DMA from the stack
...virtio_net_ctrl_mac *mac_data; > struct netdev_hw_addr *ha; > int uc_count; > @@ -1163,22 +1167,22 @@ static void virtnet_set_rx_mode(struct net_device *dev) > if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) > return; > > - promisc = ((dev->flags & IFF_PROMISC) != 0); > - allmulti = ((dev->flags & IFF_ALLMULTI) != 0); > + vi->ctrl_promisc = ((dev->flags & IFF_PROMISC) != 0); > + vi->ctrl_allmulti = ((dev->flags & IFF_ALLMULTI) != 0); > > - sg_init_one(sg, &promisc, sizeof(promisc)); > + sg_init_one(sg, &a...
2008 Jul 12
4
[PATCH] tun: Fix/rewrite packet filtering logic
...- the packet is multicast and - * - we are multicast promiscous. - * - we belong to the multicast group. - */ - skb_copy_from_linear_data(skb, addr, min_t(size_t, sizeof addr, - skb->len)); - bit_nr = ether_crc(sizeof addr, addr) >> 26; - if ((tun->if_flags & IFF_PROMISC) || - memcmp(addr, tun->dev_addr, sizeof addr) == 0 || - memcmp(addr, ones, sizeof addr) == 0 || - (((addr[0] == 1 && addr[1] == 0 && addr[2] == 0x5e) || - (addr[0] == 0x33 && addr[1] == 0x33)) && - ((tun->if_flags & IFF_ALLMULTI) || -...
2008 Jul 12
4
[PATCH] tun: Fix/rewrite packet filtering logic
...- the packet is multicast and - * - we are multicast promiscous. - * - we belong to the multicast group. - */ - skb_copy_from_linear_data(skb, addr, min_t(size_t, sizeof addr, - skb->len)); - bit_nr = ether_crc(sizeof addr, addr) >> 26; - if ((tun->if_flags & IFF_PROMISC) || - memcmp(addr, tun->dev_addr, sizeof addr) == 0 || - memcmp(addr, ones, sizeof addr) == 0 || - (((addr[0] == 1 && addr[1] == 0 && addr[2] == 0x5e) || - (addr[0] == 0x33 && addr[1] == 0x33)) && - ((tun->if_flags & IFF_ALLMULTI) || -...
2007 Apr 18
4
[Bridge] Is bridgeing possible with kernel 2.6.10
Hi I didn't get bridgeing to work with Linux kernel 2.6.10 (coldfire 5485) yet. When i try to configure bridgeing with "brctl", everything seems to be ok, but i if i try to ping through my bridge, i see ARP-Request arriving on the other side, but the ARP-Responses do not go back through the bridge. Now i could read in
2009 Nov 02
0
[PATCHv4 3/6] qemu/net: add raw backend
..., 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("SIOCGIFFLAGS failed\n"); + req.ifr_flags |= IFF_PROMISC; + ret = ioctl(fd, SIOCSIFFLAGS, &req); + if (ret < 0) + fprintf(stderr, "SIOCSIFFLAGS to promiscous failed\n"); + } + + ret = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); + if (ret < 0) + fprintf(stderr, "O_NONBLOCK set failed\n"); + + return fd; +} + +st...
2009 Nov 02
0
[PATCHv4 3/6] qemu/net: add raw backend
..., 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("SIOCGIFFLAGS failed\n"); + req.ifr_flags |= IFF_PROMISC; + ret = ioctl(fd, SIOCSIFFLAGS, &req); + if (ret < 0) + fprintf(stderr, "SIOCSIFFLAGS to promiscous failed\n"); + } + + ret = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); + if (ret < 0) + fprintf(stderr, "O_NONBLOCK set failed\n"); + + return fd; +} + +st...
2023 May 24
1
[PATCH V3 net-next 1/2] virtio-net: convert rx mode setting to use workqueue
...ist sg[2]; struct virtio_net_ctrl_mac *mac_data; struct netdev_hw_addr *ha; @@ -2356,6 +2378,8 @@ static void virtnet_set_rx_mode(struct net_device *dev) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) return; + rtnl_lock(); + vi->ctrl->promisc = ((dev->flags & IFF_PROMISC) != 0); vi->ctrl->allmulti = ((dev->flags & IFF_ALLMULTI) != 0); @@ -2373,14 +2397,19 @@ static void virtnet_set_rx_mode(struct net_device *dev) dev_warn(&dev->dev, "Failed to %sable allmulti mode.\n", vi->ctrl->allmulti ? "en" : "dis&q...
2007 Apr 18
0
[Bridge] [PATCH] (4/6) bridge: prevent bad forwarding table updates
...ridge/br_input.c @@ -54,6 +54,9 @@ int br_handle_frame_finish(struct sk_buf struct net_bridge_fdb_entry *dst; int passedup = 0; + /* insert into forwarding database after filtering to avoid spoofing */ + br_fdb_update(p->br, p, eth_hdr(skb)->h_source); + if (br->dev->flags & IFF_PROMISC) { struct sk_buff *skb2; @@ -108,8 +111,7 @@ int br_handle_frame(struct net_bridge_po if (!is_valid_ether_addr(eth_hdr(skb)->h_source)) goto err; - if (p->state == BR_STATE_LEARNING || - p->state == BR_STATE_FORWARDING) + if (p->state == BR_STATE_LEARNING) br_fdb_upda...
2015 Oct 28
10
[PATCH v3 0/3] virtio DMA API core stuff
This switches virtio to use the DMA API unconditionally. I'm sure it breaks things, but it seems to work on x86 using virtio-pci, with and without Xen, and using both the modern 1.0 variant and the legacy variant. Changes from v2: - Fix really embarrassing bug. This version actually works. Changes from v1: - Fix an endian conversion error causing a BUG to hit. - Fix a DMA ordering issue