]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Set correctly source address for sent packets (if specified in contract)
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 9 Nov 2009 15:34:09 +0000 (16:34 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 9 Nov 2009 15:34:09 +0000 (16:34 +0100)
fwp/lib/fwp/fwp_endpoint.c
fwp/lib/fwp/fwp_vres.c
fwp/lib/fwp/fwp_vres.h

index 7eb7d0b7fb70086f3e71b25c44580bb6b5f3da84..93756afc15a62bc914b8c967d6e11248071d7f23 100644 (file)
@@ -397,7 +397,7 @@ int fwp_send_endpoint_bind(struct fwp_endpoint *ep, fwp_vres_t *vres)
                return FRSH_ERR_ALREADY_BOUND;
        
        ep->vres = vres;
-       rv = fwp_vres_bind(vres, ep, ep->sockd);
+       rv = fwp_vres_bind(vres, ep, ep->sockd, &ep->src);
 
        return rv;
 }
index 64c5a70ad124e20c89092a839b8e8c6929a190c4..ad6cf0e339f0e2d1ef9d0eb777a24aeba35f639a 100644 (file)
@@ -514,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;
 
@@ -531,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;
index 62561f56ea66fce1139133f716c3980960114723..aa761048980cc23e78bc2c90e7fbd543f589233a 100644 (file)
@@ -97,7 +97,7 @@ int fwp_vres_consume_budget(struct fwp_vres *vres, size_t size, bool can_block);
 struct fwp_endpoint;
 int fwp_vres_enqueue(struct fwp_vres *vres, struct fwp_endpoint *ep,
                     const void *msg, size_t size);
-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 fwp_vres_unbind(fwp_vres_t *vres);
 
 extern fwp_vres_params_t fwp_vres_params_default;