]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
udaddy/ucmatose: allow easy setting of tos in hex
authorOr Gerlitz <ogerlitz@mellanox.com>
Mon, 12 Dec 2011 19:23:59 +0000 (11:23 -0800)
committerSean Hefty <sean.hefty@intel.com>
Mon, 12 Dec 2011 19:23:59 +0000 (11:23 -0800)
Under IBoE, the 3 MSBits of the TOS map to the SL, hence letting
the user to specify them in hex makes the interface friendlier.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
examples/cmatose.c
examples/udaddy.c

index 82e0d7c52d5ea440d560d5c26d29fb2fd880d8df..3f2ff03e25ad5ae789c4d4c3e67a0cea7aaa79ac 100644 (file)
@@ -702,7 +702,7 @@ int main(int argc, char **argv)
                        break;
                case 't':
                        set_tos = 1;
-                       tos = (uint8_t) atoi(optarg);
+                       tos = (uint8_t) strtoul(optarg, NULL, 0);
                        break;
                case 'p':
                        port = atoi(optarg);
index 637306a571b2788a7be2fccfe4f762237fc8cafb..a07f6575c77084821bcde41fc555b5728fc17443 100644 (file)
@@ -655,7 +655,7 @@ int main(int argc, char **argv)
                        break;
                case 't':
                        set_tos = 1;
-                       tos = (uint8_t) atoi(optarg);
+                       tos = (uint8_t) strtoul(optarg, NULL, 0);
                        break;
                case 'p':
                        port_space = strtol(optarg, NULL, 0);