1 diff -Nur iproute2-2.6.16-060323.orig/ip/ipaddress.c iproute2-2.6.16-060323/ip/ipaddress.c
2 --- iproute2-2.6.16-060323.orig/ip/ipaddress.c 2005-09-21 21:33:18.000000000 +0200
3 +++ iproute2-2.6.16-060323/ip/ipaddress.c 2006-07-07 12:09:50.000000000 +0200
5 printf("qlen %d", ifr.ifr_qlen);
8 +void print_description(char *name)
13 + s = socket(AF_INET, SOCK_STREAM, 0);
17 + memset(&ifr, 0, sizeof(ifr));
18 + strcpy(ifr.ifr_name, name);
19 + if (ioctl(s, SIOCGIFDESCR, &ifr) < 0) {
20 + perror("SIOCGIFDESCR");
26 + if (ifr.ifr_description[0])
27 + printf("\n descr %s", ifr.ifr_description);
30 int print_linkinfo(const struct sockaddr_nl *who,
31 struct nlmsghdr *n, void *arg)
35 print_queuelen((char*)RTA_DATA(tb[IFLA_IFNAME]));
37 + print_description((char*)RTA_DATA(tb[IFLA_IFNAME]));
39 if (!filter.family || filter.family == AF_PACKET) {
41 fprintf(fp, "%s", _SL_);
42 diff -Nur iproute2-2.6.16-060323.orig/ip/iplink.c iproute2-2.6.16-060323/ip/iplink.c
43 --- iproute2-2.6.16-060323.orig/ip/iplink.c 2006-03-22 00:57:50.000000000 +0100
44 +++ iproute2-2.6.16-060323/ip/iplink.c 2006-07-07 11:46:17.000000000 +0200
46 fprintf(stderr, " trailers { on | off } |\n");
47 fprintf(stderr, " txqueuelen PACKETS |\n");
48 fprintf(stderr, " name NEWNAME |\n");
49 + fprintf(stderr, " descr NEWDESCR |\n");
50 fprintf(stderr, " address LLADDR | broadcast LLADDR |\n");
51 fprintf(stderr, " mtu MTU }\n");
52 fprintf(stderr, " ip link show [ DEVICE ]\n");
57 +static int do_changedescr(const char *dev, const char *newdescr)
63 + strncpy(ifr.ifr_name, dev, IFNAMSIZ);
64 + strncpy(ifr.ifr_description, newdescr, NET_DEV_DESCR_LEN);
68 + err = ioctl(fd, SIOCSIFDESCR, &ifr);
70 + perror("SIOCSIFDESCR");
78 static int set_qlen(const char *dev, int qlen)
83 struct ifreq ifr0, ifr1;
85 + char *newdescr = NULL;
90 } else if (strcmp(*argv, "name") == 0) {
93 + } else if (strcmp(*argv, "descr") == 0) {
96 } else if (matches(*argv, "address") == 0) {
104 + if (do_changedescr(dev, newdescr) < 0)
108 if (set_qlen(dev, qlen) < 0)