Menu

ptpd's initialization problem

Help
david
2007-05-23
2012-11-23
  • david

    david - 2007-05-23

    I have compiled ptpd (I use Red Hat 9.0,kernel is 2.4) without any problems.But when I run ptpd,it can not start well.I don't know why ptpd can't bind event socket.

    Yesterday,when I log in root account,I find another problem,it failed to join multicast group for receiving.I am not entirely sure how the multi-cast grouping works. Should I revise these net.c line? I don't know whether I am on the right track.

    /* join multicast group (for receiving) on specified interface */ 

    if( setsockopt(netPath->eventSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof(struct ip_mreq))  < 0
    || setsockopt(netPath->generalSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof(struct ip_mreq)) < 0 )
     
    {PERROR("failed to join multicast group for receiving");

       return FALSE;
    }

    [dbf@localhost src]$ ./ptpd -c
    <debug> allocated 1072 bytes for protocol engine data
    <debug> allocated 600 bytes for foreign master data
    <debug> event POWERUP
    <debug> state PTP_INITIALIZING
    <debug> manufacturerIdentity: Kendall;1b3
    <debug> netInit
    ptpd!:  failed to bind event socket: Permission denied
    ptpd!:  failed to initialize network
    <debug> state PTP_FAULTY
    ptpd:   self shutdown, probably due to an error

    [root@localhost src]# ./ptpd -c
    <debug> allocated 1072 bytes for protocol engine data
    <debug> allocated 600 bytes for foreign master data
    <debug> event POWERUP
    <debug> state PTP_INITIALIZING
    <debug> manufacturerIdentity: Kendall;1b3
    <debug> netInit
    ptpd!: failed to join multicast group for receiving: Invalid argument
    ptpd!: failed to initialize network
    <debug> state PTP_FAULTY
    ptpd: self shutdown, probably due to an error

     
    • kendall

      kendall - 2007-05-24

      PTPd does need to be run as root. The 'failed to join multi-cast group' means that the setsockopt() with IP_ADD_MEMBERSHIP system call failed. The perror() output says it was due to an 'Invalid argument'. The call seems to work in most cases, so I would first make sure that your kernel and network card support multi-casting. If you have a custom compiled kernel, make sure the that the IP multi-casting option is enabled.

       

Log in to post a comment.