kernel-pfroute: Don't report an error when trying to reinstall a route
authorTobias Brunner <tobias@strongswan.org>
Wed, 10 Jul 2013 10:38:21 +0000 (12:38 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 17 Jul 2013 15:45:18 +0000 (17:45 +0200)
src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c

index 28802ef..0760513 100644 (file)
@@ -1335,6 +1335,10 @@ static status_t manage_route(private_kernel_pfroute_net_t *this, int op,
 
        if (send(this->socket, &msg, msg.hdr.rtm_msglen, 0) != msg.hdr.rtm_msglen)
        {
+               if (errno == EEXIST)
+               {
+                       return ALREADY_DONE;
+               }
                DBG1(DBG_KNL, "%s PF_ROUTE route failed: %s",
                         op == RTM_ADD ? "adding" : "deleting", strerror(errno));
                return FAILED;