[DRBD-user] OSPF config and bind problem: Patch

Matthias Weigel matthias.weigel at maweos.de
Sat Jul 16 16:59:42 CEST 2005

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Hello Martin,

today i tried you patch. It seems not to work for me.
The newly added bind call seems to use the same port number, the 
following (original) bind call wants to use. So the (original) bind call 
fails.
To fix, the newly added bind call should use 0 for the port (to let the 
OS dynamically select a free one).

I've tried to modify your patch, but as said before, i am a lousy C 
programmer. However it works for me this way.
Please have a look over it.

Best Regards

Matthias

Martin Bene wrote:


> Patch against 0.7.11; Warning: not tested yet beyond the fact that it
> actually compiles :-)
> 
> diff -urN drbd-0.7.11/drbd/drbd_receiver.c
> drbd-0.7.11-bind/drbd/drbd_receiver.c
> --- drbd-0.7.11/drbd/drbd_receiver.c	2005-06-07 19:21:52.000000000
> +0200
> +++ drbd-0.7.11-bind/drbd/drbd_receiver.c	2005-07-09
> 10:56:37.910322369 +0200
> @@ -624,6 +624,16 @@
>  	sock->sk->SK_(rcvtimeo) =
>  	sock->sk->SK_(sndtimeo) =  mdev->conf.try_connect_int*HZ;
>  
> +	err = sock->ops->bind(sock,
> +			      (struct sockaddr *) mdev->conf.my_addr,
> +			      mdev->conf.my_addr_len);
> +	if (err) {
> +		ERR("Unable to bind (%d)\n", err);
> +		sock_release(sock);
> +		sock = NULL;
> +		return sock;
> +	}
> +
>  	err = sock->ops->connect(sock,
>  				 (struct sockaddr *)
> mdev->conf.other_addr,
>  				 mdev->conf.other_addr_len, 0);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: drbd-bind.patch
Type: text/x-patch
Size: 1388 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20050716/3d790643/attachment.bin>


More information about the drbd-user mailing list