Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for unique MAC address to avoid binding error on interface aliases #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

htool
Copy link

@htool htool commented May 20, 2024

This is due to the listening can only be setup once per interface and not on an interface alias.
The following errors occur as it tries to bind to the same interface.
The above fix checks for a unique MAC address to avoid this.

May 20 12:42:43 boatnet signalk-server[12947]:     at Socket.addMembership (node:dgram:861:11)
May 20 12:42:43 boatnet signalk-server[12947]:     at /usr/lib/node_modules/signalk-server/node_modules/dnssd2/lib/NetworkInterface.js:249:18
May 20 12:42:43 boatnet signalk-server[12947]:     at Array.forEach (<anonymous>)
May 20 12:42:43 boatnet signalk-server[12947]:     at Socket.<anonymous> (/usr/lib/node_modules/signalk-server/node_modules/dnssd2/lib/NetworkInterface.js:247:57)
May 20 12:42:43 boatnet signalk-server[12947]:     at Socket.emit (node:events:517:28)
May 20 12:42:43 boatnet signalk-server[12947]:     at startListening (node:dgram:183:10)
May 20 12:42:43 boatnet signalk-server[12947]:     at node:dgram:371:7
May 20 12:42:43 boatnet signalk-server[12947]:     at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
May 20 12:42:43 boatnet signalk-server[12947]:   errno: -98,
May 20 12:42:43 boatnet signalk-server[12947]:   code: 'EADDRINUSE',
May 20 12:42:43 boatnet signalk-server[12947]:   syscall: 'addMembership'
May 20 12:42:43 boatnet signalk-server[12947]: }
May 20 12:42:43 boatnet signalk-server[12947]: OUCH! - could not add membership to interface 192.168.3.16 Error: addMembership EADDRINUSE
May 20 12:42:43 boatnet signalk-server[12947]:     at Socket.addMembership (node:dgram:861:11)
May 20 12:42:43 boatnet signalk-server[12947]:     at /usr/lib/node_modules/signalk-server/node_modules/dnssd2/lib/NetworkInterface.js:249:18
May 20 12:42:43 boatnet signalk-server[12947]:     at Array.forEach (<anonymous>)
May 20 12:42:43 boatnet signalk-server[12947]:     at Socket.<anonymous> (/usr/lib/node_modules/signalk-server/node_modules/dnssd2/lib/NetworkInterface.js:247:57)
May 20 12:42:43 boatnet signalk-server[12947]:     at Socket.emit (node:events:517:28)
May 20 12:42:43 boatnet signalk-server[12947]:     at startListening (node:dgram:183:10)
May 20 12:42:43 boatnet signalk-server[12947]:     at node:dgram:371:7
May 20 12:42:43 boatnet signalk-server[12947]:     at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
May 20 12:42:43 boatnet signalk-server[12947]:   errno: -98,
May 20 12:42:43 boatnet signalk-server[12947]:   code: 'EADDRINUSE',
May 20 12:42:43 boatnet signalk-server[12947]:   syscall: 'addMembership'
May 20 12:42:43 boatnet signalk-server[12947]: }

@htool
Copy link
Author

htool commented Jun 4, 2024

Same conditions as in this code: coapjs/node-coap#355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant