]> git.puffer.fish Git - mirror/frr.git/commitdiff
Remove pointless privilege lower call. Thanks to Cougar for noticing.
authorhasso <hasso>
Fri, 6 Aug 2004 08:41:56 +0000 (08:41 +0000)
committerhasso <hasso>
Fri, 6 Aug 2004 08:41:56 +0000 (08:41 +0000)
zebra/rt_netlink.c

index 26369dd85f68c653fefab7c034c024ffb8972d34..2ca0de43f3dd135eff152dadae053a1751396501 100644 (file)
@@ -122,19 +122,17 @@ netlink_socket (struct nlsock *nl, unsigned long groups)
     }
 
   ret = bind (sock, (struct sockaddr *) &snl, sizeof snl);
+  if (zserv_privs.change (ZPRIVS_LOWER))
+    zlog (NULL, LOG_ERR, "Can't lower privileges");
+
   if (ret < 0)
     {
-      if (zserv_privs.change (ZPRIVS_LOWER))
-        zlog (NULL, LOG_ERR, "Can't lower privileges");
       zlog (NULL, LOG_ERR, "Can't bind %s socket to group 0x%x: %s",
             nl->name, snl.nl_groups, strerror (errno));
       close (sock);
       return -1;
     }
 
-  if (zserv_privs.change (ZPRIVS_LOWER))
-    zlog (NULL, LOG_ERR, "Can't lower privileges");
-
   /* multiple netlink sockets will have different nl_pid */
   namelen = sizeof snl;
   ret = getsockname (sock, (struct sockaddr *) &snl, &namelen);