https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209475

fehmi noyan isi <fnoyan...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #190429|0                           |1
        is obsolete|                            |

--- Comment #28 from fehmi noyan isi <fnoyan...@yahoo.com> ---
Created attachment 190574
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=190574&action=edit
patch with mallocarray(9), printf(9) and a single fallback block

Attached is the latest patch with a single fallback block which is executed
depending on the return values from mallcoarray(... | M_NOWAIT) calls. The code
sets the value of respective variable that is passed to mallocarray(9) rather
than directly using PH_HASHSIZ in the mallocarray(9) call.

I tried the patch on a 512MB VM running FreeBSD-12.0CURRENT and verified that
PF initialisation went okay. A log message indicating the memory allocation
issue is present in /var/log/messages (and in the console).

root@test-vm:~ # uname -a

FreeBSD test-vm 12.0-CURRENT FreeBSD 12.0-CURRENT #13: Wed Feb 14 13:28:52 NZDT
2018     root@test-vm:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
root@test-vm:~ # cat /boot/loader.conf
net.pf.states_hashsize="2147483648"
root@test-vm:~ # sysctl hw.realmem
hw.realmem: 536805376
root@test-vm:~ # kldstat
Id Refs Address            Size     Name
 1    1 0xffffffff80200000 20bf2d0  kernel
root@test-vm:~ # service pf onestart
Enabling pf.
root@test-vm:~ # kldstat
Id Refs Address            Size     Name
 1    3 0xffffffff80200000 20bf2d0  kernel
 2    1 0xffffffff82419000 33590    pf.ko
root@test-vm:~ # grep pf_initialize /var/log/messages
Feb 14 13:40:20 test-vm kernel: pf_initialize : Not enough memory for
85899345920 bytes.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-pf@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-pf
To unsubscribe, send any mail to "freebsd-pf-unsubscr...@freebsd.org"

Reply via email to