System / Packages and you. (me)
-
I wanted to have the IP lease page (table) to be by default sorted by the IP addresses.
After a brief bit-o-research I discovered that I could edit the file /usr/local/www/status_dhcp_leases.php and at line 134 or there about change the following:if ($_REQUEST['order']) { usort($leases['lease'], function($a, $b) { return strcmp($a[$_REQUEST['order']], $b[$_REQUEST['order']]); }); }to read as
if (!isset($_REQUEST['order'])) { usort($leases['lease'], function($a, $b) { return (ip2long($a['ip']) <=> ip2long($b['ip'])); }); } else { usort($leases['lease'], function($a, $b) { return strcmp($a[$_REQUEST['order']], $b[$_REQUEST['order']]); }); }I then figured (assumed that) any update version of the software, (currently 2.9.0-RELEASE) would overwrite my changes which might become annoying.
After bit-o-more research, I discovered System / Patches.And there my assumptions ceased.
So Questions I have.- Are the currently listed patches with "Apply" buttons vs Revert buttons represent the updates, changes, etc to the main software since the 2.9.0 version release?
- (see pic) are all those safe to apply in all cases?
- Is -> Custom System Patches for creating my own patches ex: my above mod?
- does my code look legit. It does work as intended so I'm "assuming" so.

-
- Yes. Often security or bug fixes released in a later version like 26.07
- Yes
- Yes, or often to paste in not yet released patches from Netgate devs on the forum or Redmine
- Quick look, yes
Keep in mind the underlying file may change between versions.
Use the View button to see the patch format.
-
@SteveITS
Thank you, this is reassuring.Would it be advised that since this is a small trivial change to code to affecting sort order, and given that "the underlying file may change between versions." that this edit be done manually (by a human, me) to assure that the wrong area doesn't get changed?
I ask this as I don't know (yet) how patches work and how flexible and intelligent they can be.
-
@Tacyon It's up to you. A patch will not apply if the diff doesn't match the file...see the Test and Debug buttons.
Normally Netgate-released patches here will be included in the next version of pfSense, and the patch is no longer listed.
-
@SteveITS
understood and thanks again for your input. -
Relevant portion of the documentation I've found helpful many times on this topic: https://docs.netgate.com/pfsense/en/latest/development/system-patches.html
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy