]> rtime.felk.cvut.cz Git - frescor/fwp.git/blobdiff - fwp/lib/fwp/fwp_vres.c
Fix uninitialized variable
[frescor/fwp.git] / fwp / lib / fwp / fwp_vres.c
index 1177a4eb1ffa5b931f1cbe0c983ec605ced15a1e..804d63aed332c49949122568e67cd11d3bbb48d7 100644 (file)
@@ -235,7 +235,7 @@ fwp_vres_t *fwp_vres_alloc()
 
 static int apply_params(fwp_vres_t *vres)
 {
-       int rv;
+       int rv = 0;
        vres->period = vres->params.period;
        vres->budget = vres->params.budget;
        set_flag(vres, UNTOUCHED);
@@ -424,7 +424,8 @@ int fwp_vres_consume_budget(struct fwp_vres *vres, size_t size, bool can_block)
        return ret;
 }
 
-int fwp_vres_enqueue(struct fwp_vres *vres, struct fwp_endpoint *ep, void *msg, size_t size)
+int fwp_vres_enqueue(struct fwp_vres *vres, struct fwp_endpoint *ep,
+                    const void *msg, size_t size)
 {
        struct fwp_msgb *msgb;
        int ret;
@@ -513,7 +514,7 @@ static void* fwp_vres_tx_thread(void *_vres)
 }
 
 /*int fwp_vres_bind(fwp_vres_t *vres, struct fwp_endpoint *epoint)*/
-int fwp_vres_bind(fwp_vres_t *vres, struct fwp_endpoint *ep, int sockd)
+int fwp_vres_bind(fwp_vres_t *vres, struct fwp_endpoint *ep, int sockd, struct in_addr  *src)
 {
        int rv = 0;
 
@@ -530,6 +531,7 @@ int fwp_vres_bind(fwp_vres_t *vres, struct fwp_endpoint *ep, int sockd)
        }
 
        vres->ac_sockd = sockd;
+       *src = vres->params.src;
        rv = fwp_vres_set_ac(vres->ac_sockd, vres->params.ac_id);
        if (rv)
                goto err;