[Xorp-hackers] xorp svn VRRP centos

Eric S. Johnson esj at cs.fiu.edu
Wed Feb 24 09:47:01 PST 2010


greearb at candelatech.com said:
>> Ok, I got VRRP to  *almost* work with SVN xorp on Centos 5.
>> Without patch below it will start, but will crash as soon as
>> it becomes master for an interface.

> You mean 'With the patch' ? 

No. Without *any* patches the svn would compile fine, and even 
appear to configure and function fine as a "backup" router.

As soon as it tried to become the virtual router (change of priority
or other router(s) stopped) the vrrp and fea would crash.

With the patch of the last message, it starts, and now
when it becomes the primary for an interface the MAC is correctly
changed to the virtual mac, but the virtual IP doesn't get
added to the interface. 

>Can you post a full diff -u of all your changes?  I'd like to
>apply what I can to my tree, and if time allows, try to fix
>up scons to do the pcap detection and such better...

Included below. Thanks.

E


[root at test-router src]# diff -ru xorp-svn-20100217.orig xorp-svn-20100217
diff -ru xorp-svn-20100217.orig/BUILD_NOTES xorp-svn-20100217/BUILD_NOTES
--- xorp-svn-20100217.orig/BUILD_NOTES  2010-02-17 10:26:48.000000000 -0500
+++ xorp-svn-20100217/BUILD_NOTES       2010-02-17 10:48:54.000000000 -0500
@@ -386,6 +386,21 @@
     - The code compiles, and the internal tests appear to succeed.
     - gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)
 
+  * Linux CentOS 5.4 (2.6.18-164.6.1.el5)
+    - You must install the following packages:
+      - gcc
+      - gcc-c++
+      - openssl-devel
+      - scons-1.2.0-1.el5.rf
+    - Optionally install the following packages:
+      - libpcap-devel
+        This package is needed for sending/receiving link layer data frames.
+    - gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)
+    - must comment out:  if has_netinet_in_h:
+                             prereq_linux_mroute_h.append('netinet/in.h')
+      around line 550 of site_scons/config/allconfig.py
+
+
   * Linux Debian-3.1 (sarge) (2.4.27-3-386):
     - You must install the following packages:
       - libssl (e.g., libssl0.9.7)
diff -ru xorp-svn-20100217.orig/fea/data_plane/ifconfig/ifconfig_set_netlink_socket.cc xorp-svn-20100217/fea/data_plane/ifconfig/ifconfig_set_netlink_socket.cc
--- xorp-svn-20100217.orig/fea/data_plane/ifconfig/ifconfig_set_netlink_socket.cc       2010-02-17 10:25:17.000000000 -0500
+++ xorp-svn-20100217/fea/data_plane/ifconfig/ifconfig_set_netlink_socket.cc    2010-02-24 10:27:49.000000000 -0500
@@ -538,6 +538,8 @@
     else
        interface_flags &= ~IFF_UP;
 
+// ESJ
+#define HAVE_NETLINK_SOCKETS_SET_FLAGS_IS_BROKEN
 #ifndef HAVE_NETLINK_SOCKETS_SET_FLAGS_IS_BROKEN
     static const size_t        buffer_size = sizeof(struct nlmsghdr)
        + sizeof(struct ifinfomsg) + 2*sizeof(struct rtattr) + 512;
diff -ru xorp-svn-20100217.orig/fea/data_plane/io/io_link_pcap.hh xorp-svn-20100217/fea/data_plane/io/io_link_pcap.hh
--- xorp-svn-20100217.orig/fea/data_plane/io/io_link_pcap.hh    2010-02-17 10:25:18.000000000 -0500
+++ xorp-svn-20100217/fea/data_plane/io/io_link_pcap.hh 2010-02-23 16:39:18.000000000 -0500
@@ -34,6 +34,7 @@
 
 #ifdef HAVE_PCAP_H
 #include <pcap.h>
+#define HAVE_PCAP
 #endif
 
 #include "fea/io_link.hh"
Only in xorp-svn-20100217: obj
diff -ru xorp-svn-20100217.orig/ospf/auth.cc xorp-svn-20100217/ospf/auth.cc
--- xorp-svn-20100217.orig/ospf/auth.cc 2010-02-17 10:26:02.000000000 -0500
+++ xorp-svn-20100217/ospf/auth.cc      2010-02-19 07:17:43.000000000 -0500
@@ -496,12 +496,15 @@
     MD5_CTX ctx;
     uint8_t digest[MD5_DIGEST_LENGTH];
 
+    // length to compute MD5 over
+    uint32_t md5_packet_length = extract_16(&ptr[Packet::LEN_OFFSET]);
+
     MD5_Init(&ctx);
-    MD5_Update(&ctx, &ptr[0], pkt.size() - MD5_DIGEST_LENGTH);
+    MD5_Update(&ctx, &ptr[0], md5_packet_length);
     MD5_Update(&ctx, key->key_data(), key->key_data_bytes());
     MD5_Final(&digest[0], &ctx);
 
-    if (0 != memcmp(&digest[0], &ptr[pkt.size() - MD5_DIGEST_LENGTH],
+    if (0 != memcmp(&digest[0], &ptr[md5_packet_length],
                    MD5_DIGEST_LENGTH)) {
        set_error(c_format("authentication digest doesn't match local key "
                           "(key ID = %d)", key->id()));
diff -ru xorp-svn-20100217.orig/ospf/peer.cc xorp-svn-20100217/ospf/peer.cc
--- xorp-svn-20100217.orig/ospf/peer.cc 2010-02-17 10:26:02.000000000 -0500
+++ xorp-svn-20100217/ospf/peer.cc      2010-02-17 10:48:54.000000000 -0500
@@ -2609,16 +2609,17 @@
     case Loopback: {
        // XXX - We should be checking to see if this is p2p unnumbered.
        uint16_t prefix_length;
-       if (_passive_host)
+       if (_passive_host) {
            prefix_length = IPv4::ADDR_BITLEN;
-       else {
+           router_link.set_metric(0);
+       } else {
            prefix_length = get_interface_prefix_length();
+            router_link.set_metric(_peerout.get_interface_cost());
        }
        IPNet<IPv4> net(get_interface_address(), prefix_length);
        router_link.set_type(RouterLink::stub);
        router_link.set_link_id(ntohl(net.masked_addr().addr()));
        router_link.set_link_data(ntohl(net.netmask().addr()));
-       router_link.set_metric(0);
        router_links.push_back(router_link);
     }
        return;
Only in xorp-svn-20100217: relpath.pyc
diff -ru xorp-svn-20100217.orig/SConstruct xorp-svn-20100217/SConstruct
--- xorp-svn-20100217.orig/SConstruct   2010-02-17 10:26:48.000000000 -0500
+++ xorp-svn-20100217/SConstruct        2010-02-22 20:51:51.000000000 -0500
@@ -136,7 +136,7 @@
                  ENV = os.environ,
                  BUILDDIR = builddir,
                  CPPPATH=['/usr/local/include', '$BUILDDIR'],
-                 LIBPATH=['/usr/local/lib'],
+                 LIBPATH=['/usr/lib', '/usr/local/lib'],
                  variables = vars)
 
 prefix = env['prefix']
@@ -477,14 +477,18 @@
 and shared libraries. This is UNSUPPORTED, and probably will not link.
 """
     strip_pg_flags = [ '-pg', '-finstrument-functions', '-fno-omit-frame-pointer', '-fno-optimize-sibling-calls' ]
-    env.Replace( CFLAGS = filter(
-       lambda s: not s.startswith(tuple(strip_pg_flags)),
-       Split(env['CFLAGS']))
-    )
-    env.Replace( CXXFLAGS = filter(
-       lambda s: not s.startswith(tuple(strip_pg_flags)),
-       Split(env['CXXFLAGS']))
-    )
+    try:
+         env.Replace( CFLAGS = filter(
+            lambda s: not s.startswith(tuple(strip_pg_flags)),
+            Split(env['CFLAGS']))
+         )
+         env.Replace( CXXFLAGS = filter(
+            lambda s: not s.startswith(tuple(strip_pg_flags)),
+            Split(env['CXXFLAGS']))
+         )
+    except TypeError:
+        print "Scons type error, shared libs and profiled code cannot work..and cannot work-around this automatically with your scons version."
+
     # Full use of profiling may require more than one flag, so Split() them.
     pgdict = {'no': '',
               'gprof': '-pg',
diff -ru xorp-svn-20100217.orig/site_scons/config/allconfig.py xorp-svn-20100217/site_scons/config/allconfig.py
--- xorp-svn-20100217.orig/site_scons/config/allconfig.py       2010-02-17 10:26:14.000000000 -0500
+++ xorp-svn-20100217/site_scons/config/allconfig.py    2010-02-17 10:48:54.000000000 -0500
@@ -543,13 +543,16 @@
     # <linux/in.h> might conflict with <netinet/in.h> that was included
     # earlier.  This is currently difficult to replicate in SCons, as
     # you can't pass arbitrary code that is prepended to the test.
+    #
+    # for Centos5 at least, netinet/in.h is not needed and breaks things
+    #
     prereq_linux_mroute_h = []
     if has_sys_types_h:
        prereq_linux_mroute_h.append('sys/types.h')
     if has_sys_socket_h:
        prereq_linux_mroute_h.append('sys/socket.h')
-    if has_netinet_in_h:
-       prereq_linux_mroute_h.append('netinet/in.h')
+    #if has_netinet_in_h:
+    #   prereq_linux_mroute_h.append('netinet/in.h')
     if has_linux_types_h:
        prereq_linux_mroute_h.append('linux/types.h')
     linux_mroute_h = 'linux/mroute.h'
Only in xorp-svn-20100217/site_scons/config: allconfig.pyc
Only in xorp-svn-20100217/site_scons/config: boost.pyc
Only in xorp-svn-20100217/site_scons/config: endian.pyc
Only in xorp-svn-20100217/site_scons/config: __init__.pyc
Only in xorp-svn-20100217/site_scons/config: member.pyc
Only in xorp-svn-20100217/site_scons/config: sysctl.pyc
Only in xorp-svn-20100217/site_scons/site_tools: autotest.pyc
Only in xorp-svn-20100217/site_scons/site_tools: clntgen.pyc
Only in xorp-svn-20100217/site_scons/site_tools: tgtgen.pyc
Only in xorp-svn-20100217/site_scons/site_tools: TOOL_SUBST.pyc
Only in xorp-svn-20100217/xrl/scripts/Xif: __init__.pyc
Only in xorp-svn-20100217/xrl/scripts/Xif: kdoc.pyc
Only in xorp-svn-20100217/xrl/scripts/Xif: parse.pyc
Only in xorp-svn-20100217/xrl/scripts/Xif: util.pyc
Only in xorp-svn-20100217/xrl/scripts/Xif: xiftypes.pyc



More information about the Xorp-hackers mailing list