X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstp.c;h=c5c8b3ba8a11238621b13f33b5ca4004cde373a0;hb=abfec865566e6cce961cc8660de1ddfdc85dae5f;hp=cf1b2f981c559d139ffcb3439f1e3430587d7662;hpb=58fda1dab104041fc693032475ec4662c1a52849;p=openvswitch diff --git a/lib/stp.c b/lib/stp.c index cf1b2f98..c5c8b3ba 100644 --- a/lib/stp.c +++ b/lib/stp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,11 @@ /* Based on sample implementation in 802.1D-1998. Above copyright and license * applies to all modifications. */ +#include + #include "stp.h" +#include +#include #include #include #include @@ -25,10 +29,10 @@ #include "ofpbuf.h" #include "packets.h" #include "util.h" +#include "vlog.h" #include "xtoxll.h" -#include "vlog.h" -#define THIS_MODULE VLM_stp +VLOG_DEFINE_THIS_MODULE(stp) /* Ethernet address used as the destination for STP frames. */ const uint8_t stp_eth_addr[ETH_ADDR_LEN] @@ -256,7 +260,10 @@ stp_create(const char *name, stp_identifier bridge_id, void stp_destroy(struct stp *stp) { - free(stp); + if (stp) { + free(stp->name); + free(stp); + } } /* Runs 'stp' given that 'ms' milliseconds have passed. */