X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Frtnetlink-link.c;h=0b3710fb2d8735d1fa65c54f1fcd021ae15e8062;hb=3f0cbe2df696701ad07f61add08692a1eca54f67;hp=d14f0e3c4c3c923bb7de57946619a3bf8b4368d9;hpb=90a6637d5e7f5f83e3370e05b3716a24fc093fc7;p=sliver-openvswitch.git diff --git a/lib/rtnetlink-link.c b/lib/rtnetlink-link.c index d14f0e3c4..0b3710fb2 100644 --- a/lib/rtnetlink-link.c +++ b/lib/rtnetlink-link.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010 Nicira Networks. + * Copyright (c) 2009, 2010 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ rtnetlink_link_parse(struct ofpbuf *buf, [IFLA_IFNAME] = { .type = NL_A_STRING, .optional = false }, [IFLA_MASTER] = { .type = NL_A_U32, .optional = true }, [IFLA_MTU] = { .type = NL_A_U32, .optional = true }, + [IFLA_ADDRESS] = { .type = NL_A_UNSPEC, .optional = true }, }; static struct nlattr *attrs[ARRAY_SIZE(policy)]; @@ -72,6 +73,12 @@ rtnetlink_link_parse(struct ofpbuf *buf, ? nl_attr_get_u32(attrs[IFLA_MTU]) : 0); + if (attrs[IFLA_ADDRESS] && + nl_attr_get_size(attrs[IFLA_ADDRESS]) == ETH_ALEN) { + memcpy(change->addr, nl_attr_get(attrs[IFLA_ADDRESS]), ETH_ALEN); + } else { + memset(change->addr, 0, ETH_ALEN); + } } return parsed;