can-utils jacd questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I am hoping to re-use the can-utils' jacd as default Address Claiming
daemon but runs into some issues:

(1) " err(0, <string>, ...) " is called in several places, even though
looking at the code logic, there is no error and the program should be
able to continue. The program exits because err()  never returns.
For example:
    if ((s.current_sa < J1939_IDLE_ADDR) && !(addr[s.current_sa].flags
& F_USE)) {
         if (s.verbose)
            err(0, "forget saved address 0x%02x", s.current_sa);  <<
         s.current_sa = J1939_IDLE_ADDR;
     }

A few more examples:
     if (s.verbose)
         err(0, "ready for %s:%016llx", s.intf, (long long)s.name);  <<
    .  .  .  .

     if (s.state == STATE_REQ_SENT) {
                if (s.verbose)
                     err(0, "jacd: request sent, pending for 1250 ms");  <<
                schedule_itimer(1250);
                s.state = STATE_REQ_PENDING;
      }

(2) The socket is configured to also set the SO_BINDTODEVICE option.
In our system, this requires the program to have root permissions to
run but we'd rather not do this for security reasons. Is this option
required? What are the side-effects if this option is not set? Can it
be made optional such that the program does not exit if the
setsockoption(SO_BINDTODEVICE) call fails (seems to work without it)?

(3) The claimed address is only saved to a file when the program
terminates.  What is the reason for this? Can it not be saved after
one is claimed already so that another process can  read it real-time
if needed? Also, in cases of a program crash or a power outage, the
claimed address is still saved.


Thanks in advance,
Elenita



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux