Diff for /libaitrpc/src/cli.c between versions 1.24 and 1.24.2.2

version 1.24, 2015/01/21 21:17:05 version 1.24.2.2, 2015/01/28 00:06:22
Line 161  rpc_cli_openClient(u_char InstID, int netBuf, const ch Line 161  rpc_cli_openClient(u_char InstID, int netBuf, const ch
         rpc_cli_t *cli = NULL;          rpc_cli_t *cli = NULL;
         sockaddr_t sa = E_SOCKADDR_INIT;          sockaddr_t sa = E_SOCKADDR_INIT;
   
           if (proto < 0 || proto > SOCK_RAW) {
                   rpc_SetErr(EINVAL, "Invalid parameters can`t open RPC client");
                   return NULL;
           }
   
         if (!e_gethostbyname(csHost, Port, &sa))          if (!e_gethostbyname(csHost, Port, &sa))
                 return NULL;                  return NULL;
         if (!Port)          if (!Port)
Line 195  rpc_cli_openClient(u_char InstID, int netBuf, const ch Line 200  rpc_cli_openClient(u_char InstID, int netBuf, const ch
         AIT_SET_BUFSIZ(&cli->cli_buf, 0, netBuf);          AIT_SET_BUFSIZ(&cli->cli_buf, 0, netBuf);
   
         /* connect to RPC server */          /* connect to RPC server */
        cli->cli_sock = socket(cli->cli_sa.sa.sa_family, cli->cli_id, 0);        cli->cli_sock = socket(cli->cli_sa.sa.sa_family, cli->cli_id, 
                         cli->cli_id == SOCK_RAW ? IPPROTO_ERPC : 0);
         if (cli->cli_sock == -1) {          if (cli->cli_sock == -1) {
                 LOGERR;                  LOGERR;
                 goto err;                  goto err;
Line 474  rpc_pkt_Request(ait_val_t * __restrict pkt, rpc_sess_t Line 480  rpc_pkt_Request(ait_val_t * __restrict pkt, rpc_sess_t
  *   *
  * @pkt = Packet buffer   * @pkt = Packet buffer
  * @sess = RPC session info, if =NULL don't check session   * @sess = RPC session info, if =NULL don't check session
 * @tag = Function tag * @tag = Function tag, if =CALL_TAG_MAX don't check tag
  * @vars = Function argument array of values, may be NULL   * @vars = Function argument array of values, may be NULL
  * @nocrc = Without CRC calculation   * @nocrc = Without CRC calculation
  * return: -1 error or != -1 return value from function   * return: -1 error or != -1 return value from function
Line 510  rpc_pkt_Replay(ait_val_t * __restrict pkt, rpc_sess_t  Line 516  rpc_pkt_Replay(ait_val_t * __restrict pkt, rpc_sess_t 
                 rpc_SetErr(ERPCMISMATCH, "Get invalid RPC session");                  rpc_SetErr(ERPCMISMATCH, "Get invalid RPC session");
                 return -1;                  return -1;
         }          }
        if (ntohs(rpc->call_tag) != tag) {        if (tag != CALL_TAG_MAX && ntohs(rpc->call_tag) != tag) {
                 rpc_SetErr(ERPCMISMATCH, "Get wrong RPC reply");                  rpc_SetErr(ERPCMISMATCH, "Get wrong RPC reply");
                 return -1;                  return -1;
         }          }

Removed from v.1.24  
changed lines
  Added in v.1.24.2.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>