aboutsummaryrefslogtreecommitdiff
path: root/lib/vconn-ssl.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2009-06-10 14:16:40 -0700
committerBen Pfaff <blp@nicira.com>2009-06-10 15:31:20 -0700
commite50097d233cb52551702165324514cb6018a7627 (patch)
treeb089af77a85d083f577654a595228a4f8d733040 /lib/vconn-ssl.c
parentd798447957d98428fdddae744f2e58d2802286d8 (diff)
Fix glibc 2.7 strtok_r() bug in a more permanent fashion.
The glibc 2.7 headers contain a bug that causes strtok_r() to segfault in some circumstances. Until now, we have been working around this problem at each invocation, but this depends on the programmer to remember to do so each time. This commit instead adds a shim that adds a work-around to the string.h header itself, so that it is much more difficult to miss the workaround.
Diffstat (limited to 'lib/vconn-ssl.c')
-rw-r--r--lib/vconn-ssl.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/vconn-ssl.c b/lib/vconn-ssl.c
index 20bfb979..96890e6b 100644
--- a/lib/vconn-ssl.c
+++ b/lib/vconn-ssl.c
@@ -279,12 +279,8 @@ ssl_open(const char *name, char *suffix, struct vconn **vconnp)
return retval;
}
- /* Glibc 2.7 has a bug in strtok_r when compiling with optimization that
- * can cause segfaults here:
- * http://sources.redhat.com/bugzilla/show_bug.cgi?id=5614.
- * Using "::" instead of the obvious ":" works around it. */
- host_name = strtok_r(suffix, "::", &save_ptr);
- port_string = strtok_r(NULL, "::", &save_ptr);
+ host_name = strtok_r(suffix, ":", &save_ptr);
+ port_string = strtok_r(NULL, ":", &save_ptr);
if (!host_name) {
ovs_error(0, "%s: bad peer name format", name);
return EAFNOSUPPORT;