@@ -133,7 +133,9 @@ func (c *Control) Stop() {
if err := c.f.Close(); err != nil {
c.l.WithError(err).Error("Close interface failed")
}
+ c.stateLock.Lock()
c.state = Stopped
+ c.stateLock.Unlock()
// ShutdownBlock will listen for and block on term and interrupt signals, calling Control.Stop() once signalled
@@ -290,7 +290,7 @@ func (f *Interface) listenOut(i int) {
})
if err != nil && !f.closed.Load() {
- f.l.WithError(err).Error("Error while reading packet inbound packet, closing")
+ f.l.WithError(err).Error("Error while reading inbound packet, closing")
//TODO: Trigger Control to close
@@ -284,7 +284,7 @@ func (u *StdConn) ReloadConfig(c *config.C) {
func (u *StdConn) getMemInfo(meminfo *[unix.SK_MEMINFO_VARS]uint32) error {
- const vallen uint32 = 4 * unix.SK_MEMINFO_VARS
+ var vallen uint32 = 4 * unix.SK_MEMINFO_VARS
if u.rawConn == nil {
return fmt.Errorf("no UDP connection")