Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gluon-respondd: fix missing section "wifi" for request type "neighbours" #2599

Conversation

lemoer
Copy link
Member

@lemoer lemoer commented Aug 7, 2022

The below mentioned commit introduced a regression, that the "wifi"
section of the request type "neighbours" was empty:

~# gluon-neighbour-info -d ::1 -r neighbours | ffh_pretty_json
{
  "wifi": [
  ],
  ...
}

After this commit, the section (correctly) looks like this:

root@UFU-FWH-A272-Tresckowstr-GemR-vorne:~# gluon-neighbour-info -d ::1 -r neighbours | ffh_pretty_json
{
  "wifi": {
    "ca:38:7e:42:5f:21": {
      "neighbours": {
        "fe:9f:4d:01:ea:e1": {
          "noise": -102,
          "inactive": 50,
          "signal": -84
        },
        "fe:df:b9:84:37:51": {
          "noise": -102,
          "inactive": 20,
          "signal": -73
        }
      }
    }
  },
  ...
}

The issue was due to the fact, that the iteration over the (mesh) wifi interfaces
was broken. The code was assuming, that the section

config interface 'mesh_radio0'
        option proto 'gluon_mesh'

in /etc/config/network contains an option "ifname", which it does not.
The ifname property is only stored in the corresponding section in
/etc/config/wireless:

config wifi-iface 'mesh_radio0'
        option ifname 'mesh0'
        option network 'mesh_radio0'
        option mode 'mesh'
        ...

Therefore, we now iterate over wifi-ifaces in /etc/config/wireless, that
have the mode 'mesh' instead. This resolves the issue.

Fixes 0f1fa24

The below mentioned commit introduced a regression, that the "wifi"
section of the request type "neighbours" was empty:

    ~# gluon-neighbour-info -d ::1 -r neighbours | ffh_pretty_json
    {
      "wifi": [
      ],
      ...
    }

After this commit, the section (correctly) looks like this:

    root@UFU-FWH-A272-Tresckowstr-GemR-vorne:~# gluon-neighbour-info -d ::1 -r neighbours | ffh_pretty_json
    {
      "wifi": {
        "ca:38:7e:42:5f:21": {
          "neighbours": {
            "fe:9f:4d:01:ea:e1": {
              "noise": -102,
              "inactive": 50,
              "signal": -84
            },
            "fe:df:b9:84:37:51": {
              "noise": -102,
              "inactive": 20,
              "signal": -73
            }
          }
        }
      },
      ...
    }

The issue was due to the fact, that the iteration over the (mesh) wifi interfaces
was broken. The code was assuming, that the section

    config interface 'mesh_radio0'
            option proto 'gluon_mesh'

in /etc/config/network contains an option "ifname", which it does not.
The ifname property is only stored in the corresponding section in
/etc/config/wireless:

    config wifi-iface 'mesh_radio0'
            option ifname 'mesh0'
            option network 'mesh_radio0'
            option mode 'mesh'
            ...

Therefore, we now iterate over wifi-ifaces in /etc/config/wireless, that
have the mode 'mesh' instead. This resolves the issue.

Fixes 0f1fa24
@lemoer lemoer added 0. type: bugfix This changeset fixes abug and removed 3. topic: package Topic: Gluon Packages 3. topic: respondd labels Aug 7, 2022
@lemoer lemoer marked this pull request as draft August 7, 2022 11:02
@lemoer
Copy link
Member Author

lemoer commented Aug 7, 2022

This PR is not yet tested.

@lemoer lemoer assigned lemoer and unassigned lemoer Aug 9, 2022
@lemoer lemoer marked this pull request as ready for review August 9, 2022 18:46
@lemoer
Copy link
Member Author

lemoer commented Aug 9, 2022

This can be reviewed already. It only needs testing.

@blocktrron blocktrron added this to the 2022.1 milestone Aug 9, 2022
@lemoer
Copy link
Member Author

lemoer commented Aug 9, 2022

This is now tested. It works well! 👍

@blocktrron blocktrron merged commit 7095131 into freifunk-gluon:master Aug 9, 2022
@lemoer lemoer deleted the pr_fix_wifi_section_in_respondd_neighbours branch February 17, 2023 00:02
JayBraker pushed a commit to JayBraker/gluon that referenced this pull request Apr 12, 2023
…rs" (freifunk-gluon#2599)

The below mentioned commit introduced a regression, that the "wifi"
section of the request type "neighbours" was empty:

    ~# gluon-neighbour-info -d ::1 -r neighbours | ffh_pretty_json
    {
      "wifi": [
      ],
      ...
    }

After this commit, the section (correctly) looks like this:

    root@UFU-FWH-A272-Tresckowstr-GemR-vorne:~# gluon-neighbour-info -d ::1 -r neighbours | ffh_pretty_json
    {
      "wifi": {
        "ca:38:7e:42:5f:21": {
          "neighbours": {
            "fe:9f:4d:01:ea:e1": {
              "noise": -102,
              "inactive": 50,
              "signal": -84
            },
            "fe:df:b9:84:37:51": {
              "noise": -102,
              "inactive": 20,
              "signal": -73
            }
          }
        }
      },
      ...
    }

The issue was due to the fact, that the iteration over the (mesh) wifi interfaces
was broken. The code was assuming, that the section

    config interface 'mesh_radio0'
            option proto 'gluon_mesh'

in /etc/config/network contains an option "ifname", which it does not.
The ifname property is only stored in the corresponding section in
/etc/config/wireless:

    config wifi-iface 'mesh_radio0'
            option ifname 'mesh0'
            option network 'mesh_radio0'
            option mode 'mesh'
            ...

Therefore, we now iterate over wifi-ifaces in /etc/config/wireless, that
have the mode 'mesh' instead. This resolves the issue.

Fixes 0f1fa24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: bugfix This changeset fixes abug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants