Repository navigation
cukinia_netif_has_flag: add new cmd to check network interface flags - #109
Merged
anakin-childerhose-sfl merged 1 commit intoSep 2, 2026
Conversation
edraac
force-pushed
the
era/master/cukinia_netif_has_flag
branch
from
August 14, 2026 14:10
3dc2090 to
c6c9a69
Compare
Contributor
|
Thank you very much for your PR! I left a few comments but it looks pretty good so far! |
anakin-childerhose-sfl
requested changes
Aug 20, 2026
edraac
force-pushed
the
era/master/cukinia_netif_has_flag
branch
from
August 25, 2026 09:55
c6c9a69 to
232b37f
Compare
edraac
commented
Aug 28, 2026
edraac
force-pushed
the
era/master/cukinia_netif_has_flag
branch
from
September 1, 2026 09:44
232b37f to
11fd045
Compare
Contributor
Author
|
@anakin-childerhose-sfl @anakin4747 the check failure seems unrelated to my latest changes, right? |
anakin-childerhose-sfl
approved these changes
Sep 2, 2026
Contributor
|
Yes, they do seem unrelated, I pulled your latest changes and they pass the tests on my side |
Contributor
|
Actually I found the issue with the CI for the first failing test. $ docker run -it --rm ubuntu:24.04 /bin/dash
$ value=$(echo -ne "0x1001")
$ echo "$((value >> 0))"
/bin/dash: 2: Illegal number: -ne 0x1001
$ value=$(printf "0x1001")
$ echo "$((value >> 0))"
4097 |
anakin-childerhose-sfl
requested changes
Sep 2, 2026
In some scenarios, it might be useful to verify a network interface's flags such as (admin) up/down, loopback, multicast, etc. These flags are either set by the driver, kernel, or triggered by user space utilities, and are exposed by a sysfs entry via /sys/class/net/<dev>/flags. The particular flags and their bit offset are defined in the kernel in include/uapi/linux/if.h. The new cukinia_netif_has_flag wraps a check for these flags and PASS if the flag is set, FAIL otherwise. It takes the device name, the flag name as defined in the kernel's net_device_flags enum, and performs the bitwise operations required to verify if the flag is set. Example: cukinia_netif_has_flag ethsbc0 IFF_UP not cukinia_netif_has_flag ethsbc0 IFF_LOOPBACK cukinia_netif_has_flag ethsbc0 IFF_RUNNING Output: [PASS] Checking interface "ethsbc0" has IFF_UP flag [PASS] Checking interface "ethsbc0" has NOT IFF_LOOPBACK flag [!] [FAIL] Checking interface "ethsbc0" has IFF_RUNNING flag Signed-off-by: Eduardo Ramirez <eramirez@data-modul.com>
edraac
force-pushed
the
era/master/cukinia_netif_has_flag
branch
from
September 2, 2026 15:03
11fd045 to
d55595c
Compare
anakin-childerhose-sfl
requested changes
Sep 2, 2026
anakin-childerhose-sfl
approved these changes
Sep 2, 2026
anakin-childerhose-sfl
merged commit Sep 2, 2026
3a2a871
into
savoirfairelinux:master
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some scenarios, it might be useful to verify a network interface's flags such as (admin) up/down, loopback, multicast, etc. These flags are either set by the driver, kernel, or triggered by user space utilities, and are exposed by a sysfs entry via /sys/class/net//flags. The particular flags and their bit offset are defined in the kernel in include/uapi/linux/if.h.
The new cukinia_netif_has_flag wraps a check for these flags and PASS if the flag is set, FAIL otherwise. It takes the device name, the flag name as defined in the kernel's net_device_flags enum, and performs the bitwise operations required to verify if the flag is set.
Example:
cukinia_netif_has_flag ethsbc0 IFF_UP
not cukinia_netif_has_flag ethsbc0 IFF_LOOPBACK
cukinia_netif_has_flag ethsbc0 IFF_RUNNING
Output:
[PASS] Checking interface "ethsbc0" has IFF_UP flag
[PASS] Checking interface "ethsbc0" has NOT IFF_LOOPBACK flag [!]
[FAIL] Checking interface "ethsbc0" has IFF_RUNNING flag