/*
- * 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.
/* Based on sample implementation in 802.1D-1998. Above copyright and license
* applies to all modifications. */
+#include <config.h>
+
#include "stp.h"
+#include <sys/types.h>
+#include <netinet/in.h>
#include <arpa/inet.h>
#include <assert.h>
#include <inttypes.h>
#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]
void
stp_destroy(struct stp *stp)
{
- free(stp);
+ if (stp) {
+ free(stp->name);
+ free(stp);
+ }
}
/* Runs 'stp' given that 'ms' milliseconds have passed. */