Project

General

Profile

Bug #9518

mdb conn_status doesn't do port byte order conversion

Added by Yuri Pankov about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
mdb - modular debugger
Start date:
2018-05-01
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

Description by Daniel Borek.

The conn_status command doesn't do byte conversion hence it prints all tcp port information incorrectly. Here's an example connection to port 445 on Nexentastor:

ADDR             WQ                          STACK             ZONE
SRC:PORT
DEST:PORT

ffffd06363772740 0                               0                0
172.30.18.73:48385
172.30.32.254:20419

If we look at tcp ports:

> ffffd06363772740::print conn_t u_port
u_port = {
    u_port.connu_ports2 = 0xbd014fc3
    u_port.connu_ports = {
        connu_fport = 0x4fc3
        connu_lport = 0xbd01
    }
}

So, our local port is rightfully 0xbd01 in conn_t structure, which conn_status dumps as is:

> 0xbd01 = D
                48385

While in fact mdb should reverse byte order before printing:

> 01bd=D
                445

History

#1

Updated by Electric Monk about 1 year ago

  • % Done changed from 50 to 100
  • Status changed from In Progress to Closed

git commit 71b76ee353d2a2effae389b51205465a42199e9d

commit  71b76ee353d2a2effae389b51205465a42199e9d
Author: Yuri Pankov <yuri.pankov@nexenta.com>
Date:   2018-05-14T12:09:12.000Z

    9518 mdb conn_status doesn't do port byte order conversion
    Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
    Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
    Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF