Revision: 574
          http://sourceforge.net/p/vde/svn/574
Author:   rd235
Date:     2014-02-08 15:07:29 +0000 (Sat, 08 Feb 2014)
Log Message:
-----------
libvdeplug_vx: optimized argmgmt-still incomplete

Modified Paths:
--------------
    branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug_vxlan.c
    branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug_vxvde.c

Modified: branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug_vxlan.c
===================================================================
--- branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug_vxlan.c  2014-02-08 
14:49:49 UTC (rev 573)
+++ branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug_vxlan.c  2014-02-08 
15:07:29 UTC (rev 574)
@@ -118,6 +118,7 @@
        int s;
        char *portstr;
        char *vnistr;
+       char *sockname;
        struct sockaddr *multiaddr=NULL;
        int multifd=-1;
        int ttl=STDTTL;
@@ -127,19 +128,11 @@
        hints.ai_family = AF_UNSPEC;    /* Allow IPv4 or IPv6 */
        hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
        hints.ai_protocol = 0;          /* Any protocol */
-       vnistr=strchr(given_sockname,'/');
-       if (vnistr) {
-               *vnistr=0;
-               vnistr++;
-               portstr=strchr(vnistr,'/');
-               if (portstr) {
-                       *portstr=0;
-                       portstr++;
-               } else
-                       portstr=STDPORTSTR;
-       } else
+       sockname=strsep(&given_sockname,":/");
+       vnistr=strsep(&given_sockname,":/");
+       if ((portstr=strsep(&given_sockname,":/")) == NULL)
                portstr=STDPORTSTR;
-       s = getaddrinfo(given_sockname, portstr, &hints, &result);
+       s = getaddrinfo(sockname, portstr, &hints, &result);
        if (s < 0) {
                fprintf(stderr, "vxlan getaddrinfo: %s\n", gai_strerror(s));
                errno=ENOENT;

Modified: branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug_vxvde.c
===================================================================
--- branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug_vxvde.c  2014-02-08 
14:49:49 UTC (rev 573)
+++ branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug_vxvde.c  2014-02-08 
15:07:29 UTC (rev 574)
@@ -123,6 +123,7 @@
        int s;
        char *portstr;
        char *vnistr;
+       char *sockname;
        struct sockaddr *multiaddr=NULL;
        int multifd=-1;
        int unifd=-1;
@@ -135,19 +136,11 @@
        hints.ai_family = AF_UNSPEC;    /* Allow IPv4 or IPv6 */
        hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
        hints.ai_protocol = 0;          /* Any protocol */
-       vnistr=strchr(given_sockname,'/');
-       if (vnistr) {
-               *vnistr=0;
-               vnistr++;
-               portstr=strchr(vnistr,'/');
-               if (portstr) {
-                       *portstr=0;
-                       portstr++;
-               } else
-                       portstr=STDPORTSTR;
-       } else
+       sockname=strsep(&given_sockname,":/");
+       vnistr=strsep(&given_sockname,":/");
+       if ((portstr=strsep(&given_sockname,":/")) == NULL)
                portstr=STDPORTSTR;
-       s = getaddrinfo(given_sockname, portstr, &hints, &result);
+       s = getaddrinfo(sockname, portstr, &hints, &result);
        if (s < 0) {
                fprintf(stderr, "vxvde getaddrinfo: %s\n", gai_strerror(s));
                errno=ENOENT;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
vde-users mailing list
vde-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vde-users

Reply via email to