X-Git-Url: https://rtime.felk.cvut.cz/gitweb/lisovros/iproute2_canprio.git/blobdiff_plain/49b730d7b237a3c0b2361e77877228199f32cf9c..ff24746cca1ef0c92d46614158e6672acd6b63d3:/ip/ipaddress.c diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 9306a37..9ab65ec 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -155,7 +155,7 @@ static void print_queuelen(FILE *f, struct rtattr *tb[IFLA_MAX + 1]) return; memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, (char *)RTA_DATA(tb[IFLA_IFNAME])); + strcpy(ifr.ifr_name, rta_getattr_str(tb[IFLA_IFNAME])); if (ioctl(s, SIOCGIFTXQLEN, &ifr) < 0) { fprintf(f, "ioctl(SIOCGIFXQLEN) failed: %s\n", strerror(errno)); close(s); @@ -397,7 +397,7 @@ int print_linkinfo(const struct sockaddr_nl *who, fprintf(fp, "Deleted "); fprintf(fp, "%d: %s", ifi->ifi_index, - tb[IFLA_IFNAME] ? (char*)RTA_DATA(tb[IFLA_IFNAME]) : ""); + tb[IFLA_IFNAME] ? rta_getattr_str(tb[IFLA_IFNAME]) : ""); if (tb[IFLA_LINK]) { SPRINT_BUF(b1); @@ -417,14 +417,14 @@ int print_linkinfo(const struct sockaddr_nl *who, if (tb[IFLA_MTU]) fprintf(fp, "mtu %u ", *(int*)RTA_DATA(tb[IFLA_MTU])); if (tb[IFLA_QDISC]) - fprintf(fp, "qdisc %s ", (char*)RTA_DATA(tb[IFLA_QDISC])); + fprintf(fp, "qdisc %s ", rta_getattr_str(tb[IFLA_QDISC])); if (tb[IFLA_MASTER]) { SPRINT_BUF(b1); fprintf(fp, "master %s ", ll_idx_n2a(*(int*)RTA_DATA(tb[IFLA_MASTER]), b1)); } if (tb[IFLA_OPERSTATE]) - print_operstate(fp, *(__u8 *)RTA_DATA(tb[IFLA_OPERSTATE])); + print_operstate(fp, rta_getattr_u8(tb[IFLA_OPERSTATE])); if (do_link && tb[IFLA_LINKMODE]) print_linkmode(fp, tb[IFLA_LINKMODE]); @@ -460,7 +460,7 @@ int print_linkinfo(const struct sockaddr_nl *who, if (do_link && tb[IFLA_IFALIAS]) fprintf(fp,"\n alias %s", - (const char *) RTA_DATA(tb[IFLA_IFALIAS])); + rta_getattr_str(tb[IFLA_IFALIAS])); if (do_link && show_stats) { if (tb[IFLA_STATS64]) @@ -665,7 +665,7 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n, if (ifa_flags) fprintf(fp, "flags %02x ", ifa_flags); if (rta_tb[IFA_LABEL]) - fprintf(fp, "%s", (char*)RTA_DATA(rta_tb[IFA_LABEL])); + fprintf(fp, "%s", rta_getattr_str(rta_tb[IFA_LABEL])); if (rta_tb[IFA_CACHEINFO]) { struct ifa_cacheinfo *ci = RTA_DATA(rta_tb[IFA_CACHEINFO]); fprintf(fp, "%s", _SL_);