]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ll_map: remove unused address fields
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 27 Mar 2013 16:26:25 +0000 (09:26 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 27 Mar 2013 16:26:25 +0000 (09:26 -0700)
The address was being stored but not used by current code.

include/ll_map.h
lib/ll_map.c

index 752b82794cdb0e30cf3a3518eb902b4e8206811c..c4d5c6d1b0188a59840648a162d28e472cdc5895 100644 (file)
@@ -9,7 +9,5 @@ extern const char *ll_index_to_name(unsigned idx);
 extern const char *ll_idx_n2a(unsigned idx, char *buf);
 extern int ll_index_to_type(unsigned idx);
 extern unsigned ll_index_to_flags(unsigned idx);
-extern unsigned ll_index_to_addr(unsigned idx, unsigned char *addr,
-                                unsigned alen);
 
 #endif /* __LL_MAP_H__ */
index 1ca781e9130877613fd4c0a0239790c5af59504e..1c330020a392bc2376f89dad033be77e48611049 100644 (file)
@@ -31,9 +31,7 @@ struct ll_cache
        unsigned        flags;
        int             index;
        unsigned short  type;
-       unsigned short  alen;
        char            name[IFNAMSIZ];
-       unsigned char   addr[20];
 };
 
 #define IDXMAP_SIZE    1024
@@ -79,16 +77,6 @@ int ll_remember_index(const struct sockaddr_nl *who,
 
        im->type = ifi->ifi_type;
        im->flags = ifi->ifi_flags;
-       if (tb[IFLA_ADDRESS]) {
-               int alen;
-               im->alen = alen = RTA_PAYLOAD(tb[IFLA_ADDRESS]);
-               if (alen > sizeof(im->addr))
-                       alen = sizeof(im->addr);
-               memcpy(im->addr, RTA_DATA(tb[IFLA_ADDRESS]), alen);
-       } else {
-               im->alen = 0;
-               memset(im->addr, 0, sizeof(im->addr));
-       }
        strcpy(im->name, RTA_DATA(tb[IFLA_IFNAME]));
        return 0;
 }
@@ -141,27 +129,6 @@ unsigned ll_index_to_flags(unsigned idx)
        return 0;
 }
 
-unsigned ll_index_to_addr(unsigned idx, unsigned char *addr,
-                         unsigned alen)
-{
-       const struct ll_cache *im;
-
-       if (idx == 0)
-               return 0;
-
-       for (im = idxhead(idx); im; im = im->idx_next) {
-               if (im->index == idx) {
-                       if (alen > sizeof(im->addr))
-                               alen = sizeof(im->addr);
-                       if (alen > im->alen)
-                               alen = im->alen;
-                       memcpy(addr, im->addr, alen);
-                       return alen;
-               }
-       }
-       return 0;
-}
-
 unsigned ll_name_to_index(const char *name)
 {
        static char ncache[IFNAMSIZ];