Giter Club home page Giter Club logo

wimoved's Issues

Link `prometheus-cpp` dynamically and make it optional

Right now, we link prometheus-cpp statically for our OpenWRT builds. It would be better to provide prometheus-cpp in a different package and link dynamically to it. I don't know if we can achieve this or how we can achieve it.

Additionally, we should think about making this functionality optional at compile time to save on disk space.

Unify RAII classes for Netlink

Currently, we have three different classes, Vxlan, Bridge and Link that all serve the same purpose: freeing the internal rtnl_link * when destroyed.

We could use one class, Link instead that receives a rtnl_link * as a constructor argument and takes care of freeing the link on destruction.
This would also have the advantage of making the Netlink code more readable since all libnl calls except the frees are visible.
We could also use this pattern for the LinkCache.

Deauth station when VXLAN connection fails

In some rare cases, it might happen that something goes wrong when connecting a station to a VXLAN interface. In such a case, we want the station to be disassociated from the AP by hostapd so we can get a clean start and the station can attempt to reconnect again.

Rename Project

Currently, we are still using the Gaffa name in all source code. We need to swap this to WiMoVE.

Improve packaging for OpenWRT

  • Install wimove as a service to OpenWRT when installing the package
  • Create config directory and place default config there

Handle Ping-Pong for HostAPD better

When we do not receive a message from HostAPD for some time, we send a PING command and expect a PONG.
However, sometimes there are other events that are sent to us before the PONG so that we let the daemon crash even though it shouldn't.

  • WiMoVE does not crash when there is something other than PONG received
  • The other received event is properly parsed and used by the system

Improve VLAN parsing

Do proper error handling, i.e. ignore events when VLAN ID outside of correct range

Basic documentation

For some more project information we need the following:

  • README with setup and build instructions
  • Example config files for FRR, WiMoVE etc.

Improve naming of Socket and Socket80211

Currently, the naming of Socket and Socket80211 does not make the differences between these classes clear. We could rename Socket to something that differentiates itself from Socket80211.

Make multiple networks on multiple radios work

Our APs have two radios: One for 2.4GHz and one for 5GHz.
We want these APs to be able to send out their network on both frequencies and work with wimoved.

  • Explore what currently works: Can we combine all events into one hostAPD socket?
  • Decide on what needs to be done
  • Implement changes

shift exponent 32 is too large for 32-bit type 'int'

When testing with ubsan, we get the following error:

src/MacAddress.cpp:22:29: runtime error: shift exponent 32 is too large for 32-bit type 'int'

We should eliminate the undefined behavior in MacAddress::number.

Automatically detect hostapd sockets

Currently, we have a configuration option that allows us to set the hostapd sockets to connect to.
However, for easier basic setup, it would be nice to have the option to automatically detect all sockets and load them as configuration.

An implementation suggestion:

  • When a list of sockets is provided, that list is used
  • When no list is provided, we automatically detect
  • For automatic detection, we look at which files exist in the hapd_sockdir directory
  • We exclude all files that are called global or have a file extension Obsolete, see next point
  • Is there a better way to detect if a file there is a (hostapd) socket? Yes, we can check that it is a socket using the fs library of C++

Issues starting wimoved

While starting wimoved in OpenWRT 22.03, the following issue is seen. Could you provide some assistance?

wimoved[3265]: [ERROR] 2023-06-07 13:47:43,012 main.cpp:33 - An Exception was thrown that was not caught.
wimoved[3265]: [FATAL] 2023-06-07 13:47:43,013 main.cpp:37 - 14CivetException: null context when constructing CivetServer. Possible problem binding to port.
[WARNING] 2023-06-07 13:47:43,013 main.cpp:37 - Aborting application. Reason: Fatal log at [wimoved/src/main.cpp:37]
Aborted

This issue is reproducible with version v0.0.2 Latest and Development Build: v0.0.3+beta2023-04-26_12.56. Additionally, I reproduced the error in the Linksys models 1200ac and the 1900ac.

Add testing infrastructure

Right now, we are only testing manually. With each new feature, the possibility of bugs increases. We should therefore look at possible testing frameworks, pick one and add them to our pipeline.

In separate issues, we can then write tests that test behavior of different subsystems.

Test hostapd event parsing

The hostapd event parsing code is delicate since there is no specified protocol, only the hostapd implementation. We should document our assumptions of the message format as tests and verify automally that the code parses the events correctly.

Additionally, we could introduce fuzz testing against our code to check its resistance against invalid input.

MAX_VNI is non-inclusive

The MAX_VNI setting is non-inclusive even though we expect it to be. Thus, there is an off-by-one error in the VNI calculation.

For now, the issue can be solved by simply increasing MAX_VNI by one.

Packaging for OpenWRT

Right now, the scripts directory is quite confusing, and the scripts are pretty unorganized. We should rework the scripts and change the directory structure to make adaptions to the packaging easier.

Create tagged binaries on release

It would be nice if we could generate binaries automatically when we release. These binaries should also be clearly labeled with a commit hash to indicate the exact version that was built.

Improve logging structure

Right now, we have structured logging with easylogging++, but our usage is inconsistent. We should do the following:

  • Create a consistent format for log message (consistent capitalization, message content)
  • Create a policy of which attached information should be logged, preferably in key-value pairs such as mac=00:00:00:00:00:00 vni=5 iface=vxlan5
  • Enforce format everywhere
  • Remove redundant logging statements
  • Review logging priorities

For example, we could do: cleanup: deleting interface iface=vxlan5

Problems with Zebra MAC Learning

During testing, we discovered that when using wpa_cli to forcefully roam from one AP to another, zebra gets stuck in a state that prevents the station from receiving packets. The bridge of the station's VXLAN has learned the MAC address on both ports, although zebra reported that it removed the route. Reconnecting the station or roaming again fixes the issue. We opened an issue in the frr repository. There you find more details and the logs generated by the access points.

Config lines without = are not parsed correctly

When the configuration parser is given a config file that contains a line without =, it sets the value of the line's contents to itself. For example, take the following configuration file:

hapd_sockdir

This is equivalent to hapd_sockdir=hapd_sockdir. I would expect this to throw an error since the configuration file is malformed.

While fixing this parsing bug, we should make sure that we don't rely on any undefined behavior, especially not using previous iterators after calling erase().

RAM usage seems to greatly increase over time, might result in crashes

Some days ago on a weekend I observed that the RAM usage on one of the APs increased caused by wimoved.
image

Today, I also observed that the RAM use on one AP rose to 90% only to then drop back to 20% after I connected. When looking into the logs I found that wimoved had crashed.
Before that, it seems however that the loop worked as expected.
image

As a first step, we might want to check whether we leak memory somewhere causing these issues. It likely will not be very easy to recreate this scenario.

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.