On 02/24/2010 09:47 AM, Eric S. Johnson wrote:
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;
Without this, does it fail to compile, or does it compile and just not work?
I'm hoping for some way to auto-detect what to do here either at run-time
or during scons configuration...
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
I don't see any reason to have the HAVE_PCAP define...I'm going to change all
checks to
HAVE_PCAP_H so that this hack isn't needed.
I'm attaching my version of your changes. Assuming the allconfig.py detection
for mcast works, I'll go ahead and push this into my tree.
Thanks,
Ben
--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com
diff --git a/SConstruct b/SConstruct
index 326d41d..a490214 100644
--- a/SConstruct
+++ b/SConstruct
@@ -143,7 +143,7 @@ env = Environment(
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']
@@ -484,14 +484,23 @@ WARNING: You have requested GNU gprof style profiling
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 """
+ WARNING: Your version of scons and/or python has a syntax issue with
this code.
+ It cannot strip out the gprof related flags. If your compile fails,
please try
+ disabling gprof profiling and/or shared libraries. If the compile
works, then
+ you can ignore this warning.
+ """
+
# Full use of profiling may require more than one flag, so Split() them.
pgdict = {'no': '',
'gprof': '-pg',
diff --git a/fea/data_plane/io/io_link_pcap.cc
b/fea/data_plane/io/io_link_pcap.cc
index 0a60301..3cd69ed 100644
--- a/fea/data_plane/io/io_link_pcap.cc
+++ b/fea/data_plane/io/io_link_pcap.cc
@@ -45,7 +45,7 @@
#include "io_link_pcap.hh"
-#ifdef HAVE_PCAP
+#ifdef HAVE_PCAP_H
IoLinkPcap::IoLinkPcap(FeaDataPlaneManager& fea_data_plane_manager,
const IfTree& iftree, const string& if_name,
@@ -612,4 +612,4 @@ IoLinkPcap::reopen_pcap_access(string& error_msg)
return (XORP_OK);
}
-#endif // HAVE_PCAP
+#endif // HAVE_PCAP_H
diff --git a/fea/data_plane/managers/fea_data_plane_manager_bsd.cc
b/fea/data_plane/managers/fea_data_plane_manager_bsd.cc
index 617c509..66c5aca 100644
--- a/fea/data_plane/managers/fea_data_plane_manager_bsd.cc
+++ b/fea/data_plane/managers/fea_data_plane_manager_bsd.cc
@@ -200,7 +200,7 @@ FeaDataPlaneManagerBsd::allocate_io_link(const IfTree&
iftree,
UNUSED(ether_type);
UNUSED(filter_program);
-#ifdef HAVE_PCAP
+#ifdef HAVE_PCAP_H
io_link = new IoLinkPcap(*this, iftree, if_name, vif_name, ether_type,
filter_program);
_io_link_list.push_back(io_link);
diff --git a/fea/data_plane/managers/fea_data_plane_manager_linux.cc
b/fea/data_plane/managers/fea_data_plane_manager_linux.cc
index 6af9ed9..f51da6b 100644
--- a/fea/data_plane/managers/fea_data_plane_manager_linux.cc
+++ b/fea/data_plane/managers/fea_data_plane_manager_linux.cc
@@ -209,7 +209,7 @@ FeaDataPlaneManagerLinux::allocate_io_link(const IfTree&
iftree,
UNUSED(ether_type);
UNUSED(filter_program);
-#ifdef HAVE_PCAP
+#ifdef HAVE_PCAP_H
io_link = new IoLinkPcap(*this, iftree, if_name, vif_name, ether_type,
filter_program);
_io_link_list.push_back(io_link);
diff --git a/fea/tests/test_fea_rawlink.cc b/fea/tests/test_fea_rawlink.cc
index c1da756..d577b32 100644
--- a/fea/tests/test_fea_rawlink.cc
+++ b/fea/tests/test_fea_rawlink.cc
@@ -493,9 +493,9 @@ test_main(IPv4 finder_host, uint16_t finder_port,
bool eflag(false); // Error flag set by timed events
Mac mac;
-#ifndef HAVE_PCAP
+#ifndef HAVE_PCAP_H
fprintf(stdout, "Test Skipped: No L2 I/O mechanism found: "
- "HAVE_PCAP is not defined.\n");
+ "HAVE_PCAP_H is not defined.\n");
return 0;
#endif
diff --git a/ospf/auth.cc b/ospf/auth.cc
index a06d2ba..4ddfbee 100644
--- a/ospf/auth.cc
+++ b/ospf/auth.cc
@@ -496,12 +496,15 @@ MD5AuthHandler::authenticate_inbound(const
vector<uint8_t>& pkt,
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 --git a/ospf/peer.cc b/ospf/peer.cc
index 32d8511..5c57480 100644
--- a/ospf/peer.cc
+++ b/ospf/peer.cc
@@ -2618,20 +2618,21 @@ Peer<IPv4>::update_router_linksV2(list<RouterLink>&
router_links)
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;
+ 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;
- break;
+ }
case Waiting:
break;
case Point2Point:
diff --git a/site_scons/config/allconfig.py b/site_scons/config/allconfig.py
index 917e640..4a39226 100644
--- a/site_scons/config/allconfig.py
+++ b/site_scons/config/allconfig.py
@@ -557,6 +557,21 @@ def DoAllConfig(env, conf, host_os):
if has_linux_mroute_h:
prereq_mroute_h = prereq_linux_mroute_h
mroute_h = linux_mroute_h
+ else:
+ # Try without netinet/in.h, older releases (CentOS 5, for instance)
doesn't need it
+ # and break with it.
+ 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_linux_types_h:
+ prereq_linux_mroute_h.append('linux/types.h')
+ linux_mroute_h = 'linux/mroute.h'
+ has_linux_mroute_h = conf.CheckHeader(prereq_linux_mroute_h + [
linux_mroute_h ])
+ if has_linux_mroute_h:
+ prereq_mroute_h = prereq_linux_mroute_h
+ mroute_h = linux_mroute_h
mfcctl2_includes = []
for s in prereq_mroute_h + [ mroute_h ]:
_______________________________________________
Xorp-hackers mailing list
[email protected]
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers