[Issue #6] - added config option to enable/disable icmp packets
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-09-12 01:58:24 -04:00
parent 6e2882dc8d
commit a23507b2ca
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -8,6 +8,9 @@ const (
WifiSSID = "My Wifi Name"
WifiPass = "SecretWifiPassword"
// Networking settings
EnableICMP = true
MQTTHost = "192.168.1.50" // Must be an IP address; DNS resolution is not supported currently
MQTTPort = "1883"
MQTTUser = "" // Leave empty if not required
+4
View File
@@ -120,11 +120,15 @@ func InitNetwork(ssid, pass string) (*NetworkStack, error) {
MaxActiveTCPPorts: 2,
MTU: uint16(framelen - ethernet.MaxOverheadSize),
HardwareAddress: hwaddr,
ICMPQueueLimit: 4,
})
if err != nil {
return nil, fmt.Errorf("stack config reset: %w", err)
}
// Enable network pings if configured
_ = stack.EnableICMP(EnableICMP)
// Start background frame pump
ctx := context.Background()
go stackLoop(ctx, stack, adapter)