Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 201151 Details for
Bug 298831
magmamsg doesn't work if route is incorrect
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Magma patch - applications should call msg_set_nodeid() prior to msg_open if they use 'members_only' when doing msg_accept
magma-routing.patch (text/plain), 3.07 KB, created by
Lon Hohberger
on 2007-09-20 18:38:58 UTC
(
hide
)
Description:
Magma patch - applications should call msg_set_nodeid() prior to msg_open if they use 'members_only' when doing msg_accept
Filename:
MIME Type:
Creator:
Lon Hohberger
Created:
2007-09-20 18:38:58 UTC
Size:
3.07 KB
patch
obsolete
>Index: lib/magmamsg.h >=================================================================== >RCS file: /cvs/cluster/cluster/magma/lib/Attic/magmamsg.h,v >retrieving revision 1.5 >diff -u -r1.5 magmamsg.h >--- lib/magmamsg.h 2 Nov 2004 20:11:38 -0000 1.5 >+++ lib/magmamsg.h 20 Sep 2007 18:38:06 -0000 >@@ -22,6 +22,7 @@ > #include <magma.h> > > int msg_update(cluster_member_list_t *membership); >+int msg_set_nodeid(uint64_t nodeid); > void msg_shutdown(void); > ssize_t msg_receive_timeout(int fd, void *buf, ssize_t count, > unsigned int timeout); >Index: lib/message.c >=================================================================== >RCS file: /cvs/cluster/cluster/magma/lib/Attic/message.c,v >retrieving revision 1.9.2.3 >diff -u -r1.9.2.3 message.c >--- lib/message.c 21 Apr 2005 17:28:29 -0000 1.9.2.3 >+++ lib/message.c 20 Sep 2007 18:38:06 -0000 >@@ -61,6 +61,7 @@ > */ > static pthread_mutex_t ml_mutex = PTHREAD_MUTEX_INITIALIZER; > static cluster_member_list_t *ml_membership; >+static uint64_t _local_id = NODE_ID_NONE; > > /* Mutex to prevent > thread1 thread2 >@@ -104,6 +105,16 @@ > } > > >+int >+msg_set_nodeid(uint64_t my_node_id) >+{ >+ pthread_mutex_lock(&ml_mutex); >+ _local_id = my_node_id; >+ pthread_mutex_unlock(&ml_mutex); >+ return 0; >+} >+ >+ > /** > Shut down the mssage subsystem. Closes all file descriptors and cleans up > the membership list. >@@ -335,15 +346,41 @@ > @see connect_nb, ipv6_connect > */ > static int >-ipv4_connect(struct in_addr *in_addr, uint16_t port, int timeout) >+ipv4_connect(struct in_addr *in_addr, uint16_t port, int timeout, >+ cluster_member_t *me) > { > struct sockaddr_in _sin; >+ struct sockaddr_in srcaddr; >+ struct addrinfo *ai; > int fd, ret; > > fd = socket(PF_INET, SOCK_STREAM, 0); > if (fd < 0) > return -1; > >+ if (me) { >+ /* if we know the local node, bind to its resolved >+ interface so other nodes don't reject the connection >+ due to improper source-routing */ >+ memset(&srcaddr, 0, sizeof(srcaddr)); >+ srcaddr.sin_family = AF_INET; >+ >+ for (ai = me->cm_addrs; ai; ai = ai->ai_next) { >+ if (ai->ai_family != AF_INET) >+ continue; >+ >+ if (ai->ai_socktype != SOCK_STREAM) >+ continue; >+ >+ memcpy(&((struct sockaddr_in *)&srcaddr)->sin_addr, >+ &((struct sockaddr_in *)ai->ai_addr)->sin_addr, >+ sizeof(struct in_addr)); >+ >+ bind(fd, (struct sockaddr *)&srcaddr, >+ sizeof(srcaddr)); >+ } >+ } >+ > _sin.sin_family = AF_INET; > _sin.sin_port = htons(port); > memcpy(&_sin.sin_addr, in_addr, sizeof(_sin.sin_addr)); >@@ -377,6 +414,7 @@ > { > int fd; > cluster_member_t *nodep; >+ cluster_member_t *me; > struct addrinfo *ai; > > pthread_mutex_lock(&ml_mutex); >@@ -387,6 +425,10 @@ > return -1; > } > >+ me = memb_id_to_p(ml_membership, _local_id); >+ if (me) >+ memb_resolve(me); >+ > /* Try to resolve if we haven't done so */ > if (!nodep->cm_addrs && (memb_resolve(nodep) < 0)) { > pthread_mutex_unlock(&ml_mutex); >@@ -428,7 +470,7 @@ > > fd = ipv4_connect( > &((struct sockaddr_in *)ai->ai_addr)->sin_addr, >- baseport, timeout); >+ baseport, timeout, me ); > > if (fd >= 0) { > pthread_mutex_unlock(&ml_mutex);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 298831
:
201151
|
239241