diff options
author | 2003-05-08 22:09:54 +0000 | |
---|---|---|
committer | 2003-05-08 22:09:54 +0000 | |
commit | c81bc92b5b33204cab5bb5f22229b970fce8517e (patch) | |
tree | ea0662544129b58ad4b42c21a12697fdd7bda705 | |
parent | multiple readlink() calls that forgot the -1... (diff) | |
download | wireguard-openbsd-c81bc92b5b33204cab5bb5f22229b970fce8517e.tar.xz wireguard-openbsd-c81bc92b5b33204cab5bb5f22229b970fce8517e.zip |
Close sockets (otherwise the file handle limit can be reached when many
queues are defined). Reported by Fernando Braga. ok henning@
-rw-r--r-- | sbin/pfctl/pfctl_altq.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index abddb3c0677..9dc22dfc6b7 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_altq.c,v 1.72 2003/04/15 11:29:24 henning Exp $ */ +/* $OpenBSD: pfctl_altq.c,v 1.73 2003/05/08 22:09:54 dhartmei Exp $ */ /* * Copyright (C) 2002 @@ -1091,6 +1091,8 @@ getifspeed(char *ifname) err(1, "SIOCGIFDATA"); if (shutdown(s, SHUT_RDWR) == -1) err(1, "shutdown"); + if (close(s)) + err(1, "close"); return ((u_int32_t)ifrdat.ifi_baudrate); } @@ -1109,6 +1111,8 @@ getifmtu(char *ifname) err(1, "SIOCGIFMTU"); if (shutdown(s, SHUT_RDWR) == -1) err(1, "shutdown"); + if (close(s)) + err(1, "close"); if (ifr.ifr_mtu > 0) return (ifr.ifr_mtu); else { |