diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2005-02-22 01:55:04 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2005-02-22 01:55:04 +0000 |
commit | f0c8a7ab65ef1de88c904b2e7cad1a7271a8080f (patch) | |
tree | 4b6368356b747ae30172bb23aaf62df99b2d20fa /epan/column-utils.c | |
parent | 9edd68b0e18abc9fd5ec454ead938d282b3ce525 (diff) |
From Francisco Alcoba:
changed the behaviour of get_addr_name:
- resolve to a name if the address supports it
- call address_to_str if it does not, but the address is valid
- return "NONE" if it is AT_NONE
svn path=/trunk/; revision=13463
Diffstat (limited to 'epan/column-utils.c')
-rw-r--r-- | epan/column-utils.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c index c8f7d3578d..facb458097 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -574,20 +574,16 @@ static void col_set_addr(packet_info *pinfo, int col, address *addr, gboolean is_res, gboolean is_src) { - const char *addr_string; struct e_in6_addr ipv6_addr; pinfo->cinfo->col_expr[col][0] = '\0'; pinfo->cinfo->col_expr_val[col][0] = '\0'; + if (addr->type == AT_NONE) return; /* no address, nothing to do */ + if (is_res) { - addr_string = get_addr_name(addr); - if (addr_string != NULL) { - strncpy(pinfo->cinfo->col_buf[col], addr_string, COL_MAX_LEN); - pinfo->cinfo->col_buf[col][COL_MAX_LEN - 1] = '\0'; - } else - address_to_str_buf(addr, pinfo->cinfo->col_buf[col]); + get_addr_name_buf(addr, pinfo->cinfo->col_buf[col],COL_MAX_LEN-1); } else { switch (addr->type) { |