Skip to content

interfaces: parse flags radix correctly#110

Open
klemensn wants to merge 1 commit intoOpenVoxProject:mainfrom
klemensn:interfaces-hwfeatures-hardmtu
Open

interfaces: parse flags radix correctly#110
klemensn wants to merge 1 commit intoOpenVoxProject:mainfrom
klemensn:interfaces-hwfeatures-hardmtu

Conversation

@klemensn
Copy link
Copy Markdown
Contributor

ifconfig(8) flags aka. printf(9) %b may start with hexadecimal characters:
https://github.com/openbsd/src/blob/782aef866e55128b1259c9ea5c8fb1134165876d/sbin/ifconfig/ifconfig.c#L6530-L6542

This yields facter values when, e.g. both SLAAC and DHCP are enabled:

 $ ifconfig vlan42 | grep flags
 vlan42: a08843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF6,AUTOCONF4 mtu 1500
 $ facter networking.interfaces.vlan42.flags | jq -c
-
+["UP","BROADCAST","RUNNING","SIMPLEX","MULTICAST","AUTOCONF6","AUTOCONF4"]

@klemensn
Copy link
Copy Markdown
Contributor Author

Bugfix for new code introduced with #94.

@bastelfreak bastelfreak added the bug Something isn't working label Apr 12, 2026
ifconfig(8) flags aka. printf(9) `%b` may start with hexadecimal characters:
https://github.com/openbsd/src/blob/782aef866e55128b1259c9ea5c8fb1134165876d/sbin/ifconfig/ifconfig.c#L6530-L6542

This yields facter values when, e.g. both SLAAC and DHCP are enabled:
```
 $ ifconfig vlan42 | grep flags
 vlan42: a08843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF6,AUTOCONF4 mtu 1500
 $ facter networking.interfaces.vlan42.flags | jq -c
-
+["UP","BROADCAST","RUNNING","SIMPLEX","MULTICAST","AUTOCONF6","AUTOCONF4"]
```

Signed-off-by: Klemens Nanni <kn@openbsd.org>
@klemensn klemensn force-pushed the interfaces-hwfeatures-hardmtu branch from 8a74259 to b16a7f6 Compare April 12, 2026 16:55
@klemensn
Copy link
Copy Markdown
Contributor Author

Now with sign-off line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants