Code Monkey home page Code Monkey logo

Comments (3)

sequoiar avatar sequoiar commented on June 26, 2024

@Z-J-X it's for multiple-queue. no problem from my using experience. what's your use-case ?

ifr.ifr_flags = IFF_NO_PI | IFF_MULTI_QUEUE;

from libviface.

Z-J-X avatar Z-J-X commented on June 26, 2024

@sequoiar I wrote a demo program,like this:

#include <viface/viface.hpp>
#include <iostream>
#include <iomanip>
#include <unistd.h>
#include <algorithm>

using namespace std;
int main()
{
    viface::VIface iface("viface%d");

    // Configure interface
    iface.setIPv4Netmask("255.255.255.0");
    iface.setIPv4("192.168.100.11");

    // Bring-up interface
    iface.up();
    std::set<string> stats_set = iface.listStats();

    while (1)
    {
        auto data = iface.receive();
        if (data.size() == 0)
        {
            sleep(1);
            continue;
        }
        std::cout << "receive:" << std::dec << data.size() << std::endl;
        for (int a : data)
        {
            std::cout << std::setiosflags(std::ios::uppercase) << std::hex << std::setw(2) << std::setfill('0') << a << " ";
        }
        std::cout << std::endl;
    }
}

The results may be different on different machines
ping 192.168.100.1 receive
ping 192.168.100.2 not receive
ping 192.168.100.3 receive

Tcpdump shows that the data has reached the Tun / tap device

i use ping to test this program, I found that half of the data could not be received. Then I looked at the source code and found that Tun / tap would be opened twice, I think the data not received will be received by another FD. Therefore, I modified the source code to test, read the data of two FD, and everything is normal.
ps: After modifying the source code, I only carried out the reading test.

you can see issue#6,They have the same problems as me

from libviface.

Matheus-Garbelini avatar Matheus-Garbelini commented on June 26, 2024

Can confirm that applying this fix solves the issue with missing pings and many other IP packets.

from libviface.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.