[PR #3190] [MERGED] DHCP client code quality fixes #4681

Closed
opened 2026-05-05 10:24:36 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/3190
Author: @kris7t
Created: 1/27/2020
Status: Merged
Merged: 1/28/2020
Merged by: @kris7t

Base: masterHead: dhcp-client


📝 Commits (4)

  • a7e6138 Fix indentation for dhcp client code
  • 69907da Fix unsigned comparison error (#3174)
  • 649bcd4 Documentation for DHCP support
  • 1f9f439 Do not declare variable in for loop

📊 Changes

13 files changed (+376 additions, -261 deletions)

View changed files

📝 src/firejail/dhcp.c (+104 -101)
📝 src/firejail/firejail.h (+2 -2)
📝 src/firejail/fs_hostname.c (+3 -3)
📝 src/firejail/main.c (+12 -12)
📝 src/firejail/network_main.c (+4 -4)
📝 src/firejail/profile.c (+13 -13)
📝 src/firejail/sandbox.c (+4 -4)
📝 src/firejail/sbox.c (+24 -23)
📝 src/firejail/usage.c (+2 -0)
📝 src/fnet/interface.c (+100 -94)
📝 src/include/rundefs.h (+6 -5)
📝 src/man/firejail-profile.txt (+53 -0)
📝 src/man/firejail.txt (+49 -0)

📄 Description

I finally had some time to fix up my implementation for DHCP client support. Sorry for the delay!

  • Unfortunately, I used spaces instead of tabs for my code in #3102 (I messed up something in Emacs, I think), which resulted in inconsistent indentation at least on GIthub. My first commit replaces the spaces with tabs, however, it does mess up git blame output a bit, so it is debatable whether we should merge it.
  • I fixed the unsigned comparison warning in #3174 that made the build fail due to -Werror.
  • Updated documentation (usage, firejail(1) and firejail-profile(5) manpages) with the new options.
    By the way, there seem to be some differences between default CFLAGS produces by ./configure on my machine and on Travis. Compiling with -Wall -Wextra -Werror seems prudent, but does not happen for me locally. Thanks for @Vincent43 for pointing out the ./configure --enable-fatal-warnings option! On the other hand, on Travis, C99 support is not enabled. Travis also uses older netlink headers, I think, for example, it does not define IFA_FLAGS.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/3190 **Author:** [@kris7t](https://github.com/kris7t) **Created:** 1/27/2020 **Status:** ✅ Merged **Merged:** 1/28/2020 **Merged by:** [@kris7t](https://github.com/kris7t) **Base:** `master` ← **Head:** `dhcp-client` --- ### 📝 Commits (4) - [`a7e6138`](https://github.com/netblue30/firejail/commit/a7e6138ad09e77a8792a03640a43660a063a1e2d) Fix indentation for dhcp client code - [`69907da`](https://github.com/netblue30/firejail/commit/69907da5c98b673cffeb5263941815c9e95be6b5) Fix unsigned comparison error (#3174) - [`649bcd4`](https://github.com/netblue30/firejail/commit/649bcd4bfbd7b24ec95873e97e3b5270d84ec374) Documentation for DHCP support - [`1f9f439`](https://github.com/netblue30/firejail/commit/1f9f439922c80e3a3d7315802951fb06a1d84f65) Do not declare variable in for loop ### 📊 Changes **13 files changed** (+376 additions, -261 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/dhcp.c` (+104 -101) 📝 `src/firejail/firejail.h` (+2 -2) 📝 `src/firejail/fs_hostname.c` (+3 -3) 📝 `src/firejail/main.c` (+12 -12) 📝 `src/firejail/network_main.c` (+4 -4) 📝 `src/firejail/profile.c` (+13 -13) 📝 `src/firejail/sandbox.c` (+4 -4) 📝 `src/firejail/sbox.c` (+24 -23) 📝 `src/firejail/usage.c` (+2 -0) 📝 `src/fnet/interface.c` (+100 -94) 📝 `src/include/rundefs.h` (+6 -5) 📝 `src/man/firejail-profile.txt` (+53 -0) 📝 `src/man/firejail.txt` (+49 -0) </details> ### 📄 Description I finally had some time to fix up my implementation for DHCP client support. Sorry for the delay! * Unfortunately, I used spaces instead of tabs for my code in #3102 (I messed up something in Emacs, I think), which resulted in inconsistent indentation at least on GIthub. My first commit replaces the spaces with tabs, however, it does mess up `git blame` output a bit, so it is debatable whether we should merge it. * I fixed the unsigned comparison warning in #3174 that made the build fail due to `-Werror`. * Updated documentation (usage, firejail(1) and firejail-profile(5) manpages) with the new options. By the way, there seem to be some differences between default CFLAGS produces by `./configure` on my machine and on Travis. ~Compiling with `-Wall -Wextra -Werror` seems prudent, but does not happen for me locally.~ Thanks for @Vincent43 for pointing out the `./configure --enable-fatal-warnings` option! On the other hand, on Travis, C99 support is not enabled. Travis also uses older netlink headers, I think, for example, it does not define `IFA_FLAGS`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:24:36 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#4681
No description provided.