Skip to content

packet rocognition #4

Open
Open

Description

@sl1200mk2

in artnet_net_recv() this check is make:
if (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr ||
ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) {
p->length = 0;
return ARTNET_EOK;
}

this prevent to use a node that is bound on the 0.0.0.0:6454 address:port...
in your opinion what check can be done to avoid returning at this stage....

Activity

  1. sl1200mk2 commented on Apr 22, 2014

    @sl1200mk2
    ContributorAuthor

    this one i sa stopper too...
    can't we check for p->data.ar.longname != n->state.long_name or something else?
    ++

  2. nomis52 commented on Apr 23, 2014

    @nomis52
    Member

    Try removing the check.

  3. sl1200mk2 commented on Apr 23, 2014

    @sl1200mk2
    ContributorAuthor

    if I remove the check I got my own node address (e.g the libartnet server)...

  4. nomis52 commented on Apr 23, 2014

    @nomis52
    Member

    I'm not clear what you're asking for. Can you please clearly describe the problem and what you'd like to see.

  5. sl1200mk2 commented on Apr 23, 2014

    @sl1200mk2
    ContributorAuthor

    I'm trying to make D::Light and Capture Polar working on the same computer....
    I register an ArtNet node in DL as a server with artnet_new(), artnet_init(), and so...
    I set the long Name, etc...
    when I send an ArtPoll, I don't want to see the node I've created to be listed...
    this can be done by:
    if (((cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr) && !memcmp(p->data.ar.longname, n->state.long_name, ARTNET_LONG_NAME_LENGTH * sizeof(uint8_t))) ||
    ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) {
    p->length = 0;
    return ARTNET_EOK;
    }

    but I would like to know for a more elegant way....
    in case of DL and Capture Polar on the same computer, cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr

    best regards,
    ++

  6. nomis52 commented on Jun 13, 2014

    @nomis52
    Member

    Let me make sure I understand:
    You want to respond to messages send from the same machine, except you also don't want the local node to show up when you try to discover devices?

    To do the former you'll need to introduce a new function to control this behavior since we don't want to break existing clients. Something like

    artnet_allow_loopback(artnet_node, bool);

    There is no good way to filter Polls / PoolReplies from the same node. Comparing the node name is a bit of a hack, esp. since it could be set from the hostname. At a minimum I'd compare the manufacturer ID and the name

  7. sl1200mk2 commented on Jun 13, 2014

    @sl1200mk2
    ContributorAuthor

    Simon,
    thank you for taking time to answer me!

    2014-06-13 4:42 GMT+02:00 Simon Newton notifications@github.com:

    Let me make sure I understand:
    You want to respond to messages send from the same machine, except you
    also don't want the local node to show up when you try to discover devices?

    that is exactly it!
    DL and the 3D visualizer runs on the same host, and when I send a poll, I
    don't want DL to be listed

    To do the former you'll need to introduce a new function to control this
    behavior since we don't want to break existing clients. Something like

    artnet_allow_loopback(artnet_node, bool);

    There is no good way to filter Polls / PoolReplies from the same node.
    Comparing the node name is a bit of a hack, esp. since it could be set from
    the hostname. At a minimum I'd compare the manufacturer ID and the name

    do you mean something like that?:
    if (((cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr) &&
    !artnet_allow_loopback(artnet_node, bool))||
    ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) {
    p->length = 0;
    return ARTNET_EOK;
    }

    ++
    Nico

    —
    Reply to this email directly or view it on GitHub
    #4 (comment)
    .

  8. nomis52 commented on Jun 13, 2014

    @nomis52
    Member

    Here are the steps:

    i) add a new bool to the node_state_t struct to track if loopback is enabled / disabled. It should default to disabled.
    ii) add a artnet_allow_loopback function to toggle this state
    iii) In artnet_net_recv, if loopback is disabled, and (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr || ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP ) the packet should be skipped
    iv) In handle_reply if the node name and the manufacturer match our name and the packet was send from this machine the poll reply is discarded.

  9. sl1200mk2 commented on Jun 14, 2014

    @sl1200mk2
    ContributorAuthor

    thanx,
    will be on my todo list.

    ++

    2014-06-13 17:29 GMT+02:00 Simon Newton notifications@github.com:

    Here are the steps:

    i) add a new bool to the node_state_t struct to track if loopback is
    enabled / disabled. It should default to disabled.
    ii) add a artnet_allow_loopback function to toggle this state
    iii) In artnet_net_recv, if loopback is disabled, and
    (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr ||
    ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP ) the packet should be skipped
    iv) In handle_reply if the node name and the manufacturer match our name
    and the packet was send from this machine the poll reply is discarded.

    —
    Reply to this email directly or view it on GitHub
    #4 (comment)
    .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions