On Sat, Aug 04, 2018 at 12:12:06PM +0100, Ricardo Mestre wrote:
> Hi,
> 
> As we discussed, here's a diff to revert back my previous commit on
> eigrpd(8) and remove cpath promise entirely since if the socket is not
> deleted at shutdown it won't cause any harm.
> 
> OK?

I'd prefer to get rid of csock from the global struct since it's now
uninitialized in main. With that tweak OK florian@


diff --git control.c control.c
index 8c2909700a3..b315b1839ef 100644
--- control.c
+++ control.c
@@ -100,16 +100,6 @@ control_listen(void)
        return (0);
 }
 
-void
-control_cleanup(char *path)
-{
-       if (path == NULL)
-               return;
-       event_del(&control_state.ev);
-       event_del(&control_state.evt);
-       unlink(path);
-}
-
 /* ARGSUSED */
 static void
 control_accept(int listenfd, short event, void *bula)
diff --git control.h control.h
index 298c2d9aa99..02312080bc0 100644
--- control.h
+++ control.h
@@ -36,7 +36,6 @@ struct ctl_conn {
 
 int    control_init(char *);
 int    control_listen(void);
-void   control_cleanup(char *);
 int    control_imsg_relay(struct imsg *);
 
 #endif /* _CONTROL_H_ */
diff --git eigrpd.c eigrpd.c
index fe59c7c3a21..377650bdf7d 100644
--- eigrpd.c
+++ eigrpd.c
@@ -168,8 +168,6 @@ main(int argc, char *argv[])
        else if (eflag)
                eigrpe(debug, global.cmd_opts & EIGRPD_OPT_VERBOSE, sockname);
 
-       global.csock = sockname;
-
        mib[0] = CTL_NET;
        mib[1] = PF_INET;
        mib[2] = IPPROTO_IP;
@@ -271,7 +269,7 @@ main(int argc, char *argv[])
            eigrpd_conf->rdomain) == -1)
                fatalx("kr_init failed");
 
-       if (pledge("stdio rpath cpath inet sendfd", NULL) == -1)
+       if (pledge("stdio rpath inet sendfd", NULL) == -1)
                fatal("pledge");
 
        event_dispatch();
@@ -293,7 +291,6 @@ eigrpd_shutdown(void)
        msgbuf_clear(&iev_rde->ibuf.w);
        close(iev_rde->ibuf.fd);
 
-       control_cleanup(global.csock);
        kr_shutdown();
        config_clear(eigrpd_conf);
 
diff --git eigrpd.h eigrpd.h
index 214224e32c4..16fd5f97da2 100644
--- eigrpd.h
+++ eigrpd.h
@@ -339,7 +339,6 @@ struct eigrpd_global {
        int                      eigrp_socket_v6;
        struct in_addr           mcast_addr_v4;
        struct in6_addr          mcast_addr_v6;
-       char                    *csock;
 };
 
 extern struct eigrpd_global global;
diff --git eigrpe.c eigrpe.c
index afe92e68206..4c58ee583f9 100644
--- eigrpe.c
+++ eigrpe.c
@@ -76,8 +76,7 @@ eigrpe(int debug, int verbose, char *sockname)
        log_verbose(verbose);
 
        /* create eigrpd control socket outside chroot */
-       global.csock = sockname;
-       if (control_init(global.csock) == -1)
+       if (control_init(sockname) == -1)
                fatalx("control socket setup failed");
 
        if (inet_pton(AF_INET, AllEIGRPRouters_v4, &global.mcast_addr_v4) != 1)


-- 
I'm not entirely sure you are real.

Reply via email to