[DRBD-user] Re: OSPF config and bind problem (was Using DRBDbetween hosts with dual redundant network interfaces)

Martin Bene martin.bene at icomedias.com
Sat Jul 9 11:03:04 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.


> > >This shows a big problem! SRC-IP should be 192.168.5.1 or 
> > >192.168.5.2. The 192.168.50.x IPs mean, network link failover will 
> > >not work.
> > >
> > >AFAIK this can be fixed:
> > >An extra bind-call is needed before the connect-call on the client 
> > >side of the tcp connection.
> > >However i am a poor C programmer. Can somebody fix it in drbd?
> > 
> > How could drbd even be aware there are IP addresses behind the 
> > 192.168.5.x address?
> 
> I was thinking it could be part of the magic of the loopback device.
> If I send traffic from 127.0.0.1, it would have to get some useful
> address for the recipient to reply ?
> 
> But the extra bind-call sounds really cool :)

And the good nwews is: all the infrastructure seems to be in place, the
connection info passed to the kernel module already needs and has both
local and remote addresses, looks like it's really just missing the bind
call in drbd_receiver.c

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);

Bye, Martin
********************************************************
Martin Bene,                 CTO
icomedias GmbH,              A-8020 Graz, Entenplatz 1b
t +43 (316) 721671-271       f +43 (316) 721671-103
e martin.bene at icomedias.com, i http://www.icomedias.com
******************************************************** 



More information about the drbd-user mailing list