Giter Club home page Giter Club logo

node-ptpv2's People

Contributors

iliessens avatar philhartung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

node-ptpv2's Issues

`delay_req`s being sent on the default, not `addr`'s interface

Hi and thanks for open sourcing node-ptpv2.

I have a machine with two network interfaces, en0 and en1, both of which do multicast. There is a PTP grandmaster on a separate machine in en1's network.

$ ifconfig
en0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.126  netmask 255.255.0.0  broadcast 192.168.255.255

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0

en1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 2800
        inet 172.24.1.126  netmask 255.255.0.0  broadcast 172.24.255.255

When init()ing with en1's address, grandmaster's messages come in fine because the addr is passed through to the addMembership call.

//event msg client
ptpClientEvent.on('listening', function() {
	ptpClientEvent.addMembership(ptpMulticastAddrs[ptp_domain], addr);
                                                                    // ^ explicitly specified
});

However, sending delay_reqs goes over en0 instead, so a sync is never established. I'm wondering if the default interface and routing table should be bypassed, as they are for receiving? Currently, the routing table has to be adjusted accordingly instead. IMO both approaches have their merits, but if it should be up to the routing table I think addMemberships should be called without the addr as well, as that's an optional parameter. Another alternative would be varying what happens based on whether the user explicitly provided the address in the first place, or not.

It's a small change to align sends with the current behaviour for receives, so I'll be sending a PR for that shortly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.