]> rtime.felk.cvut.cz Git - frescor/forb.git/blobdiff - src/proto_inet.c
Disable discovery protocol when INET is default
[frescor/forb.git] / src / proto_inet.c
index c7874c3e2ecfc0786ce7e5f4cd141908422a547e..8442dfc2d484bf4f713b20cdc8af06a3bc412610 100644 (file)
@@ -58,6 +58,7 @@
 #include <sys/types.h>
 #include <ul_log.h>
 #include <unistd.h>
+#include <forb/config.h>
 
 /**
  * @file   proto_inet.c
@@ -560,13 +561,15 @@ forb_inet_port_init(struct forb_port_desc *port_desc, struct in_addr listen_on,
                        port_priv->listen_socket, &ev);
        if (ret)
                goto err_close_epoll;
-       
+
+#ifndef CONFIG_FORB_PROTO_INET_DEFAULT 
        ev.events = EPOLLIN | EPOLLET;
        ev.data.fd = port_priv->udp_socket;
        ret = epoll_ctl(port_priv->epoll_fd, EPOLL_CTL_ADD,
                        port_priv->udp_socket, &ev);
        if (ret)
                goto err_close_epoll;
+#endif
 
        port_desc->proto = &proto_inet;
        port_desc->proto_priv = port_priv;