diff options
Diffstat (limited to 'zebra/ioctl.c')
| -rw-r--r-- | zebra/ioctl.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/zebra/ioctl.c b/zebra/ioctl.c index f91ee2438d..25aeea18f5 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -14,10 +14,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with GNU Zebra; see the file COPYING. If not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <zebra.h> @@ -29,6 +28,7 @@ #include "log.h" #include "privs.h" +#include "vty.h" #include "zebra/rib.h" #include "zebra/rt.h" #include "zebra/interface.h" @@ -55,20 +55,20 @@ if_ioctl (u_long request, caddr_t buffer) int err = 0; if (zserv_privs.change(ZPRIVS_RAISE)) - zlog (NULL, LOG_ERR, "Can't raise privileges"); + zlog_err("Can't raise privileges"); sock = socket (AF_INET, SOCK_DGRAM, 0); if (sock < 0) { int save_errno = errno; if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); + zlog_err("Can't lower privileges"); zlog_err("Cannot create UDP socket: %s", safe_strerror(save_errno)); exit (1); } if ((ret = ioctl (sock, request, buffer)) < 0) err = errno; if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); + zlog_err("Can't lower privileges"); close (sock); if (ret < 0) @@ -79,7 +79,6 @@ if_ioctl (u_long request, caddr_t buffer) return 0; } -#ifdef HAVE_IPV6 static int if_ioctl_ipv6 (u_long request, caddr_t buffer) { @@ -88,13 +87,13 @@ if_ioctl_ipv6 (u_long request, caddr_t buffer) int err = 0; if (zserv_privs.change(ZPRIVS_RAISE)) - zlog (NULL, LOG_ERR, "Can't raise privileges"); + zlog_err("Can't raise privileges"); sock = socket (AF_INET6, SOCK_DGRAM, 0); if (sock < 0) { int save_errno = errno; if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); + zlog_err("Can't lower privileges"); zlog_err("Cannot create IPv6 datagram socket: %s", safe_strerror(save_errno)); exit (1); @@ -103,7 +102,7 @@ if_ioctl_ipv6 (u_long request, caddr_t buffer) if ((ret = ioctl (sock, request, buffer)) < 0) err = errno; if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); + zlog_err("Can't lower privileges"); close (sock); if (ret < 0) @@ -113,7 +112,6 @@ if_ioctl_ipv6 (u_long request, caddr_t buffer) } return 0; } -#endif /* HAVE_IPV6 */ /* * get interface metric @@ -163,7 +161,7 @@ if_get_mtu (struct interface *ifp) zebra_interface_up_update(ifp); #else - zlog (NULL, LOG_INFO, "Can't lookup mtu on this system"); + zlog_info("Can't lookup mtu on this system"); ifp->mtu6 = ifp->mtu = -1; #endif } @@ -436,8 +434,6 @@ if_unset_flags (struct interface *ifp, uint64_t flags) return 0; } -#ifdef HAVE_IPV6 - #ifdef LINUX_IPV6 #ifndef _LINUX_IN6_H /* linux/include/net/ipv6.h */ @@ -593,5 +589,3 @@ if_prefix_delete_ipv6 (struct interface *ifp, struct connected *ifc) #endif /* HAVE_STRUCT_IN6_ALIASREQ */ #endif /* LINUX_IPV6 */ - -#endif /* HAVE_IPV6 */ |
