Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix error "Generated manual page monitor/iwmon.1 does not exist" #6

Merged
merged 59 commits into from
Jun 26, 2020
Merged

Conversation

vaukai
Copy link
Contributor

@vaukai vaukai commented Jun 6, 2020

To avoid errors like:

config.status: executing libtool commands

    iwd 1.7

Source configured.
Compiling source in /var/tmp/portage/net-wireless/eiwd-20200416/work/eiwd-20200416 ...
make -j8
/bin/mkdir -p src
./src/genbuiltin > src/builtin.h
make --no-print-directory all-am
test -f src/iwd.8 || { echo "Generated manual page src/iwd.8 does not exist"; false; }
test -f src/iwd.debug.7 || { echo "Generated manual page src/iwd.debug.7 does not exist"; false; }
test -f src/iwd.config.5 || { echo "Generated manual page src/iwd.config.5 does not exist"; false; }
test -f src/iwd.network.5 || { echo "Generated manual page src/iwd.network.5 does not exist"; false; }
test -f monitor/iwmon.1 || { echo "Generated manual page monitor/iwmon.1 does not exist"; false; }
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -fvisibility=hidden -DUNITDIR=""./unit/"" -DCERTDIR=""./unit/"" -march=native -O2 -pipe -fsigned-char -c -o monitor/main.o monitor/main.c
Generated manual page monitor/iwmon.1 does not exist
make[1]: *** [Makefile:3659: monitor/iwmon.1] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1445: all] Error 2

vaukai and others added 30 commits June 6, 2020 19:21
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Add the functions to be called by manager.c and a minimal DBus API.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Create a P2P device interface along with the station interface when
setting up a wiphy and handle the interface being removed.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
SOL_NETLINK is used since commit
87a1981 resulting in the following
build failure with glibc < 2.24:

src/frame-xchg.c: In function 'frame_watch_group_io_read':
src/frame-xchg.c:328:27: error: 'SOL_NETLINK' undeclared (first use in this function)
   if (cmsg->cmsg_level != SOL_NETLINK)
                           ^

This failure is due to glibc that doesn't support SOL_NETLINK before
version 2.24 and
bminor/glibc@f9b437d

Fixes:
 - http://autobuild.buildroot.org/results/3485088b84111c271bbcfaf025aa4103c6452072
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
FTR ie.h is included for @microsoft_oui

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
With the previous commit, wscutil now depends on ie.h.  Unfortunately,
wired also includes eap-wsc and wscutil in the build, but not ie, which
results in a link-time failure.

Fix this by droppig eap-wsc and wscutil from wired.  There's no reason
that ethernet authentication would ever use the WiFi Protected Setup
authentication.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Implement the Enabled property on device interface.  The P2P device is
currently disabled on startup but automatically enabling the P2P device
can be considered.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Add some of the Device Discovery logic and the DBus API.  Device
Discovery is documented as having three states: the Scan Phase, the Find
Phase and the Listen State.

This patch adds the Scan Phase and the next patch adds the Listen State,
which will happen sequentially in a loop until discovery is stopped.

The Find Phase, which is documented as happening at the beginning of the
Discovery Phase, is incorporated into the Scan Phases.  The difference
between the two is that Find Phase scans all of the supported channels
while the Scan Phase only scans the three "social" channels.  In
practical terms the Find Phase would discover existing groups, which may
operate on any channel, while the Scan Phase will only discover P2P
Devices -- peers that are not in a group yet.  To cover existing groups,
we add a few "non-social" channels to each of our active scans
implementing the Scan Phases.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
For wired authentication the protocol version used in the EAPOL
packets sent by ead is fixed to 802.1X-2004 (2) but some switches
implementing only 802.1X-2001 erroneously ignore these packets.

As ead only sends EAPOL-Start and EAP-Packet packets and these have
not changed between 802.1X-2001 and 802.1X-2004 there should be
no reason to use 802.1X-2004. Hence, this changes ead to always use
802.1X-2001 (1) instead.

Switches implementing newer versions of 802.1X should not have
problems responding to packets using the original version.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Start a remain-on-channel cmd implementing the Listen State, after each
the Scan Phase implemented as an active scan.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Add net.connman.iwd.SimpleConfiguration interfaces to peer objects on
DBus and handle method calls.  Building and transmitting the actual
action frames to start the connection sequence is done in the following
commits.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Parse the GO Negotiation Response frame and if no errors found send the
GO Negotiation Confirmation.  If that gets ACKed wait for the GO to set
up the group.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Handle the scenario where the peer's P2P state machine doesn't know
whether a connection has been authorized by the user and needs some time
to ask the user or a higher software layer whether to accept a
connection.  In that case their GO Negotiation Response to our GO
Negotiation Request will have the status code "Fail: Information Not
Available" and we need to give the peer 120s to start a new GO
Negotiation with us.  In this patch we handle the GO Negotiation
responder side where we parse the Request frame, build and send the
Response and finally parse the Confirmation.  The existing code so far
only did the initiator side.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Some devices (a Wi-Fi Display dongle in my case) will send us Probe
Requests and wait for a response before they send us the GO
Negotiation Request that we're waiting for after the peer initially
replied with "Fail: Information Not Available" to our GO Negotiation
attempt.  Curiously this specific device I tested would even accept
a Probe Response with a mangled body such that the IE sequence couldn't
be parsed.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
When connecting to an existing group, use the Provision Discovery
Request/Response frame exchange before calling
p2p_start_client_provision().

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Add the next step after Provision Discovery or GO Negotiation that is
scanning for the WSC BSS that the GO has set up for client provisioning.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Once we've found the provisioning BSS create the P2P-Client interface
that we're going to use for the actual provisioning and the final P2P
connection.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
dylanaraps and others added 27 commits June 6, 2020 19:21
Use netconfig.c functions to unconditionally run DHCP negotiation,
fail the connection setup if DHCP fails.  Only report connection success
after netconfig returns.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Save the value of the watchlist pointer at the beginning of the
WATCHLIST_NOTIFY_* macros as if it was a function.  This will fix a
frame-xchg.c scenario in which one of the watch callback removes the
frame watch group and the memory where the watchlist pointer was
becomes unallocated but the macro still needs to access it ones or
twice while it destroys the watchlist.  Another option would be for
the pointer to be copied in frame-xchg.c itself.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
This callback gets called way to many times to have a debug print
in the location that it was. Instead only print if a NEW wiphy is
found, and also print the name/id.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Further on in the function we still print that the scan was triggered.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Several parsing functions printed the function name, which isn't
very useful to anyone.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Some full mac cards don't like being given a FT AKM when connecting.
From an API perspective this should be supported, but in practice
these cards behave differently and some do no accept FT AKMs. Until
this becomes more stable any cards not supporting Auth/Assoc commands
(full mac) will not connect using FT AKMs.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Using mac80211_hwsim can sometimes result in out of order messages
coming from the kernel. Since mac80211_hwsim immediately sends out
frames and the kernel keeps command responses in a separate queue,
bad scheduling can result in these messages being out of order.
In some cases we receive Auth/Assoc frames before the response to
our original CMD_CONNECT. This causes autotests to fail randomly,
some more often than others.

To fix this we can introduce a small delay into hwsim. Just a 1ms
delay makes the random failures disappear in the tests. This delay
is also makes hwsim more realistic since actual hardware will always
introduce some kind of delay when sending or receiving frames.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
In this situation the kernel is sending a low RSSI event which netdev
picks up, but since we set netdev->connected so early the event is
forwarded to station before IWD has fully connected. Station then
tries to get a neighbor report, which may fail and cause a known
frequency scan. If this is a new network the frequency scan tries to
get any known frequencies in network_info which will be unset and
cause a segfault.

This can be avoided by only sending RSSI events when netdev->operational
is set rather than netdev->connected.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Previously iwmon was running per-test, which would jumble any subtests
together into the same log file making it hard to parse. Now create
a separate directory for each subtest and put the monitor log and
pcap there.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
These values were meant only to force IWD's BSS preference but
since the RSSI's were so low in some cases this caused a roam
immediately after connecting. This patch changes the RSSI values
to prevent a roam from happening.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
There is a very common block of code inside many autotests
which goes something like:

device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
network = device.get_ordered_network('an-ssid')

When you see the same pattern in nearly all the tests this shows
we need a helper. Basic autotests which merely check that a
connection succeeded should not need to write the same code again
and again. This code ends up being copy-pasted which can lead to
bugs.

There is also a code pattern which attempts to get ordered
networks, and if this fails it scans and tries again. This, while
not optimal, does prevent unneeded scanning by first checking if
any networks already exist.

This patch solves both the code reuse issue as well as the recovery
if get_ordered_network(s) fails. A new optional parameter was
added to get_ordered_network(s) which is False by default. If True
get_ordered_network(s) will perform a scan if the initial call
yields no networks. Tests will now be able to simply call
get_ordered_network(s) without performing a scan before hand.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
In certain cases the autoconnect portion of each subtest was connecting
to the network so fast that the check for obj.scanning was never successful
since IWD was already connected (and in turn not scanning). Since the
autoconnect path will wait for the device to be connected there really isn't
a reason to wait for any scanning conditions. The normal connect path does
need to wait for scanning though, and for this we can now use the new
scan_if_needed parameter to get_ordered_networks.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
With the introduction of AutoConnect=False network setting the
initial disconnect calls are no longer needed

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
To match the original behavior of get_ordered_networks,
return None for the empty list of known networks after the scan
is complete

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Rely on internal scan and wait implementation of get_ordered_network
to obtain the known networks

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Device object has no property named 'connected'.
client_connect has no member dev2

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
build_cmd_ft_authenticate and build_cmd_authenticate were virtually
identical. These have been unified into a single builder.

We were also incorrectly including ATTR_IE to every authenticate
command, which violates the spec for certain protocols, This was
removed and any auth protocols will now add any IEs that they require.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
802.11ai mandates that the RSN element is included during authentication
for FILS. This previously was happening by chance since supplicant_ie
was being included with CMD_AUTHENTICATE. This included more than just
the RSNE so that was removed in an earlier commit. Now FILS builds the
RSNE itself and includes this with CMD_AUTHENTICATE.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
To get rid of compile errors I have to apply this patch.
Some functionality might get lost :-(

Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
@vaukai
Copy link
Contributor Author

vaukai commented Jun 6, 2020

Something strange happened, Sorry!
Only 4d0c531 was intended to be pull requested before release 1.7

@dylanaraps dylanaraps merged commit 0de5342 into dylanaraps:master Jun 26, 2020
gentoo-bot pushed a commit to gentoo/guru that referenced this pull request Jun 26, 2020
Patch accepted upstream
PR dylanaraps/eiwd#6 pulled

Package-Manager: Portage-2.3.99, Repoman-2.3.23
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants