Hi !
I'd like to switch off option 160 on a certain network. Therefore I issued the following command to the API: curl -X DELETE -H "Content-Type: application/json" -d '[{"option":"optionCaptivePortal","value":https://aa.bb.cc/rfc7710,"type":"s tring"}]' http://127.0.0.1:22222/api/v1/dhcp/options/network/172.16.118.0 which was acknowledged: {"status":"ACK","network":"172.16.118.0"} Unfortunately, that did not deleted it . It's still there even after a configreload hard and a full reboot . Than I tried something stupid by sending an empty value: curl -H "Content-Type: application/json" -d '[{"option":160,"value":"","type":"string"}]' http://127.0.0.1:22222/api/v1/dhcp/options/network/172.16.118.0 And that broke the API: >From the pfdhcp.log: Aug 6 15:15:01 nrd01 pfdhcp: 2021/08/06 15:15:01 http: panic serving 127.0.0.1:56104: runtime error: invalid memory address or nil pointer dereference Aug 6 15:15:01 nrd01 pfdhcp: goroutine 55255 [running]: Aug 6 15:15:01 nrd01 pfdhcp: net/http.(*conn).serve.func1(0xc0002352c0) Aug 6 15:15:01 nrd01 pfdhcp: /usr/local/go/src/net/http/server.go:1801 +0x147 Aug 6 15:15:01 nrd01 pfdhcp: panic(0x7aa0c0, 0xa7df90) Aug 6 15:15:01 nrd01 pfdhcp: /usr/local/go/src/runtime/panic.go:975 +0x47a Aug 6 15:15:01 nrd01 pfdhcp: main.(*Interface).handleAPIReq(0xc00021e580, 0x816957, 0x5, 0xc000571f70, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, ...) Aug 6 15:15:01 nrd01 pfdhcp: /builds/inverse-inc/packetfence/go/cmd/pfdhcp/api.go:401 +0xf52 Aug 6 15:15:01 nrd01 pfdhcp: main.handleAllStats(0x894340, 0xc000164700, 0xc00069c900) Aug 6 15:15:01 nrd01 pfdhcp: /builds/inverse-inc/packetfence/go/cmd/pfdhcp/api.go:135 +0x43c Aug 6 15:15:01 nrd01 pfdhcp: net/http.HandlerFunc.ServeHTTP(0x835a10, 0x894340, 0xc000164700, 0xc00069c900) Aug 6 15:15:01 nrd01 pfdhcp: /usr/local/go/src/net/http/server.go:2042 +0x44 Aug 6 15:15:01 nrd01 pfdhcp: github.com/gorilla/mux.(*Router).ServeHTTP(0xc0002503c0, 0x894340, 0xc000164700, 0xc0006ef400) Aug 6 15:15:01 nrd01 pfdhcp: /root/go/pkg/mod/github.com/gorilla/mux@v1.7.3/mux.go:212 <mailto:/root/go/pkg/mod/github.com/gorilla/mux@v1.7.3/mux.go:212> +0xd3 Aug 6 15:15:01 nrd01 pfdhcp: net/http.serverHandler.ServeHTTP(0xc0003b2540, 0x894340, 0xc000164700, 0xc0006ef400) Aug 6 15:15:01 nrd01 pfdhcp: /usr/local/go/src/net/http/server.go:2843 +0xa3 Aug 6 15:15:01 nrd01 pfdhcp: net/http.(*conn).serve(0xc0002352c0, 0x895100, 0xc0001c1f00) Aug 6 15:15:01 nrd01 pfdhcp: /usr/local/go/src/net/http/server.go:1925 +0x8ad Aug 6 15:15:01 nrd01 pfdhcp: created by net/http.(*Server).Serve Aug 6 15:15:01 nrd01 pfdhcp: /usr/local/go/src/net/http/server.go:2969 +0x36c Just adding an URL again via the API does not work. I guess recreating the network will do the trick to fix it ? But more important, how to switch off this DHCP option entirely ? PF Version 10.3.0 Thank you !
_______________________________________________ PacketFence-users mailing list PacketFence-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/packetfence-users