diff options
author | Ben Pfaff <blp@nicira.com> | 2015-02-22 16:19:27 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2015-03-03 16:22:31 -0800 |
commit | 937f71bf6c51d3dcab7d892601a22f5b251ab5f4 (patch) | |
tree | 1f7b96f6af53602d7de1f52e4c9e9a24a4ad5346 /lib/lldp | |
parent | 24738b7e993e9bc5cccc73c7b95bb3e924cb4af7 (diff) | |
download | openvswitch-937f71bf6c51d3dcab7d892601a22f5b251ab5f4.tar.gz |
lldpd: Use CONTAINER_OF instead of cast, for safety.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/lldp')
-rw-r--r-- | lib/lldp/lldpd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c index bd7603469..1c78f8125 100644 --- a/lib/lldp/lldpd.c +++ b/lib/lldp/lldpd.c @@ -87,8 +87,8 @@ lldpd_alloc_hardware(struct lldpd *cfg, char *name, int index) hw->h_cfg = cfg; ovs_strlcpy(hw->h_ifname, name, sizeof hw->h_ifname); hw->h_ifindex = index; - hw->h_lport.p_chassis = (struct lldpd_chassis *) - list_front(&cfg->g_chassis.list); + hw->h_lport.p_chassis = CONTAINER_OF(list_front(&cfg->g_chassis.list), + struct lldpd_chassis, list); hw->h_lport.p_chassis->c_refcount++; list_init(&hw->h_rports); |