diff options
41 files changed, 735 insertions, 0 deletions
diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c index b9f4a85b..ea3dfe03 100644 --- a/bgpd/bgp_advertise.c +++ b/bgpd/bgp_advertise.c @@ -72,10 +72,19 @@ baa_hash_key (void *p) } static int +<<<<<<< HEAD:bgpd/bgp_advertise.c +baa_hash_cmp (void *p1, void *p2) +======= baa_hash_cmp (const void *p1, const void *p2) +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_advertise.c { +<<<<<<< HEAD:bgpd/bgp_advertise.c + struct bgp_advertise_attr * baa1 = (struct bgp_advertise_attr *) p1; + struct bgp_advertise_attr * baa2 = (struct bgp_advertise_attr *) p2; +======= const struct bgp_advertise_attr * baa1 = p1; const struct bgp_advertise_attr * baa2 = p2; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_advertise.c return attrhash_cmp (baa1->attr, baa2->attr); } diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index d116c30f..217e0cba 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -131,13 +131,29 @@ cluster_hash_key_make (void *p) } static int +<<<<<<< HEAD:bgpd/bgp_attr.c +cluster_hash_cmp (void *p1, void *p2) +======= cluster_hash_cmp (const void *p1, const void *p2) +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.c { +<<<<<<< HEAD:bgpd/bgp_attr.c + struct cluster_list * cluster1 = (struct cluster_list *) p1; + struct cluster_list * cluster2 = (struct cluster_list *) p2; +======= const struct cluster_list * cluster1 = p1; const struct cluster_list * cluster2 = p2; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.c +<<<<<<< HEAD:bgpd/bgp_attr.c + if (cluster1->length == cluster2->length && + memcmp (cluster1->list, cluster2->list, cluster1->length) == 0) + return 1; + return 0; +======= return (cluster1->length == cluster2->length && memcmp (cluster1->list, cluster2->list, cluster1->length) == 0); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.c } static void @@ -265,13 +281,29 @@ transit_hash_key_make (void *p) } static int +<<<<<<< HEAD:bgpd/bgp_attr.c +transit_hash_cmp (void *p1, void *p2) +======= transit_hash_cmp (const void *p1, const void *p2) +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.c { +<<<<<<< HEAD:bgpd/bgp_attr.c + struct transit * transit1 = (struct transit *) p1; + struct transit * transit2 = (struct transit *) p2; +======= const struct transit * transit1 = p1; const struct transit * transit2 = p2; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.c +<<<<<<< HEAD:bgpd/bgp_attr.c + if (transit1->length == transit2->length && + memcmp (transit1->val, transit2->val, transit1->length) == 0) + return 1; + return 0; +======= return (transit1->length == transit2->length && memcmp (transit1->val, transit2->val, transit1->length) == 0); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.c } static void @@ -389,10 +421,19 @@ attrhash_key_make (void *p) } int +<<<<<<< HEAD:bgpd/bgp_attr.c +attrhash_cmp (void *p1, void *p2) +======= attrhash_cmp (const void *p1, const void *p2) +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.c { +<<<<<<< HEAD:bgpd/bgp_attr.c + struct attr * attr1 = (struct attr *) p1; + struct attr * attr2 = (struct attr *) p2; +======= const struct attr * attr1 = p1; const struct attr * attr2 = p2; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.c if (attr1->flag == attr2->flag && attr1->origin == attr2->origin @@ -404,8 +445,13 @@ attrhash_cmp (const void *p1, const void *p2) && attr1->pathlimit.ttl == attr2->pathlimit.ttl && attr1->pathlimit.as == attr2->pathlimit.as) { +<<<<<<< HEAD:bgpd/bgp_attr.c + struct attr_extra *ae1 = attr1->extra; + struct attr_extra *ae2 = attr2->extra; +======= const struct attr_extra *ae1 = attr1->extra; const struct attr_extra *ae2 = attr2->extra; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.c if (ae1 && ae2 && ae1->aggregator_as == ae2->aggregator_as diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h index 12149a17..b0ff8234 100644 --- a/bgpd/bgp_attr.h +++ b/bgpd/bgp_attr.h @@ -163,7 +163,11 @@ extern bgp_size_t bgp_packet_withdraw (struct peer *peer, struct stream *s, struct prefix_rd *, u_char *); extern void bgp_dump_routes_attr (struct stream *, struct attr *, struct prefix *); +<<<<<<< HEAD:bgpd/bgp_attr.h +extern int attrhash_cmp (void *, void *); +======= extern int attrhash_cmp (const void *, const void *); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_attr.h extern unsigned int attrhash_key_make (void *); extern void attr_show_all (struct vty *); extern unsigned long int attr_count (void); diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index c08673ce..6b79eec0 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -247,13 +247,24 @@ ecommunity_hash_make (void *arg) /* Compare two Extended Communities Attribute structure. */ int +<<<<<<< HEAD:bgpd/bgp_ecommunity.c +ecommunity_cmp (void *arg1, void *arg2) +======= ecommunity_cmp (const void *arg1, const void *arg2) +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_ecommunity.c { const struct ecommunity *ecom1 = arg1; const struct ecommunity *ecom2 = arg2; +<<<<<<< HEAD:bgpd/bgp_ecommunity.c + if (ecom1->size == ecom2->size + && memcmp (ecom1->val, ecom2->val, ecom1->size * ECOMMUNITY_SIZE) == 0) + return 1; + return 0; +======= return (ecom1->size == ecom2->size && memcmp (ecom1->val, ecom2->val, ecom1->size * ECOMMUNITY_SIZE) == 0); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_ecommunity.c } /* Initialize Extended Comminities related hash. */ diff --git a/bgpd/bgp_ecommunity.h b/bgpd/bgp_ecommunity.h index 278721c8..0d1eb585 100644 --- a/bgpd/bgp_ecommunity.h +++ b/bgpd/bgp_ecommunity.h @@ -72,7 +72,11 @@ extern struct ecommunity *ecommunity_parse (u_int8_t *, u_short); extern struct ecommunity *ecommunity_dup (struct ecommunity *); extern struct ecommunity *ecommunity_merge (struct ecommunity *, struct ecommunity *); extern struct ecommunity *ecommunity_intern (struct ecommunity *); +<<<<<<< HEAD:bgpd/bgp_ecommunity.h +extern int ecommunity_cmp (void *, void *); +======= extern int ecommunity_cmp (const void *, const void *); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_ecommunity.h extern void ecommunity_unintern (struct ecommunity *); extern unsigned int ecommunity_hash_make (void *); extern struct ecommunity *ecommunity_str2com (const char *, int, int); diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index 5dbd4872..fb8a7dd3 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -314,11 +314,14 @@ bgp_connect (struct peer *peer) sockopt_reuseaddr (peer->fd); sockopt_reuseport (peer->fd); +<<<<<<< HEAD:bgpd/bgp_network.c +======= #ifdef IPTOS_PREC_INTERNETCONTROL if (sockunion_family (&peer->su) == AF_INET) setsockopt_ipv4_tos (peer->fd, IPTOS_PREC_INTERNETCONTROL); #endif +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_network.c if (peer->password) bgp_md5_set_connect (peer->fd, &peer->su, peer->password); diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 50407e4e..9d149cbb 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -9176,7 +9176,11 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi) vty_out (vty, "%12llu%s", ts.counts[i], VTY_NEWLINE); if (ts.counts[BGP_STATS_MAXBITLEN] < 9) break; +<<<<<<< HEAD:bgpd/bgp_route.c + vty_out (vty, "%30s: ", "\% announced "); +======= vty_out (vty, "%30s: ", "%% announced "); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_route.c vty_out (vty, "%12.2f%s", 100 * (float)ts.counts[BGP_STATS_SPACE] / (float)((uint64_t)1UL << ts.counts[BGP_STATS_MAXBITLEN]), diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 7acf27cc..b2164503 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9872,7 +9872,10 @@ bgp_vty_init (void) /* "show bgp memory" commands. */ install_element (VIEW_NODE, &show_bgp_memory_cmd); +<<<<<<< HEAD:bgpd/bgp_vty.c +======= install_element (RESTRICTED_NODE, &show_bgp_memory_cmd); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_vty.c install_element (ENABLE_NODE, &show_bgp_memory_cmd); /* Community-list. */ diff --git a/isisd/dict.c b/isisd/dict.c index 6c3e1e7f..b2bb5940 100644 --- a/isisd/dict.c +++ b/isisd/dict.c @@ -14,8 +14,13 @@ * into proprietary software; there is no requirement for such software to * contain a copyright notice related to this source. * +<<<<<<< HEAD:isisd/dict.c + * $Id: dict.c,v 1.5 2007/08/07 18:49:18 paul Exp $ + * $Name: $ +======= * $Id$ * $Name$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:isisd/dict.c */ #include <stdlib.h> diff --git a/isisd/isis_dlpi.c b/isisd/isis_dlpi.c index 3cbe0b4f..21512e19 100644 --- a/isisd/isis_dlpi.c +++ b/isisd/isis_dlpi.c @@ -42,6 +42,11 @@ #include "isisd/isis_circuit.h" #include "isisd/isis_flags.h" #include "isisd/isisd.h" +<<<<<<< HEAD:isisd/isis_dlpi.c +#include "isisd/isis_constants.h" +#include "isisd/isis_circuit.h" +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:isisd/isis_dlpi.c #include "isisd/isis_network.h" #include "privs.h" @@ -313,6 +318,14 @@ open_dlpi_dev (struct isis_circuit *circuit) circuit->interface->name); return ISIS_WARNING; } +<<<<<<< HEAD:isisd/isis_dlpi.c + + /* Try first as Style 1 */ + (void) snprintf(devpath, sizeof (devpath), "/dev/%s", + circuit->interface->name); + unit = -1; + fd = dlpiopen (devpath, &acklen); +======= /* Try the vanity node first, if permitted */ if (getenv("DLPI_DEVONLY") == NULL) @@ -330,6 +343,7 @@ open_dlpi_dev (struct isis_circuit *circuit) unit = -1; fd = dlpiopen (devpath, &acklen); } +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:isisd/isis_dlpi.c /* If that fails, try again as Style 2 */ if (fd == -1) @@ -461,11 +475,17 @@ open_dlpi_dev (struct isis_circuit *circuit) if (ioctl (fd, I_PUSH, "pfmod") == 0) { struct packetfilt pfil; +<<<<<<< HEAD:isisd/isis_dlpi.c +======= struct strioctl sioc; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:isisd/isis_dlpi.c pfil.Pf_Priority = 0; pfil.Pf_FilterLen = sizeof (pf_filter) / sizeof (u_short); memcpy (pfil.Pf_Filter, pf_filter, sizeof (pf_filter)); +<<<<<<< HEAD:isisd/isis_dlpi.c + ioctl (fd, PFIOCSETF, &pfil); +======= /* pfmod does not support transparent ioctls */ sioc.ic_cmd = PFIOCSETF; sioc.ic_timout = 5; @@ -474,6 +494,7 @@ open_dlpi_dev (struct isis_circuit *circuit) if (ioctl (fd, I_STR, &sioc) == -1) zlog_warn("%s: could not perform PF_IOCSETF on %s", __func__, circuit->interface->name); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:isisd/isis_dlpi.c } circuit->fd = fd; diff --git a/isisd/iso_checksum.c b/isisd/iso_checksum.c index 294fe994..abd101b9 100644 --- a/isisd/iso_checksum.c +++ b/isisd/iso_checksum.c @@ -75,3 +75,100 @@ iso_csum_verify (u_char * buffer, int len, uint16_t * csum) return 0; return 1; } +<<<<<<< HEAD:isisd/iso_checksum.c + +/* + * Creates the checksum. *csum points to the position of the checksum in the + * PDU. + * Based on Annex C.4 of ISO/IEC 8473 + */ +#define FIXED_CODE +u_int16_t +iso_csum_create (u_char * buffer, int len, u_int16_t n) +{ + + u_int8_t *p; + int x; + int y; + u_int32_t mul; + u_int32_t c0; + u_int32_t c1; + u_int16_t checksum; + u_int16_t *csum; + int i, init_len, partial_len; + + checksum = 0; + + /* + * Zero the csum in the packet. + */ + csum = (u_int16_t *) (buffer + n); + *(csum) = checksum; + + p = buffer; + c0 = 0; + c1 = 0; + init_len = len; + + while (len != 0) + { + partial_len = MIN(len, 5803); + + for (i = 0; i < partial_len; i++) + { + c0 = c0 + *(p++); + c1 += c0; + } + + c0 = c0 % 255; + c1 = c1 % 255; + + len -= partial_len; + } + + mul = (init_len - n)*(c0); + +#ifdef FIXED_CODE + x = mul - c0 - c1; + y = c1 - mul - 1; + + if (y > 0) + y++; + if (x < 0) + x--; + + x %= 255; + y %= 255; + + if (x == 0) + x = 255; + if (y == 0) + y = 1; + + checksum = (y << 8) | (x & 0xFF); + +#else + x = mul - c0 - c1; + x %= 255; + + y = c1 - mul - 1; + y %= 255; + + if (x == 0) + x = 255; + if (y == 0) + y = 255; + + checksum = ((y << 8) | x); +#endif + + /* + * Now we write this to the packet + */ + *(csum) = checksum; + + /* return the checksum for user usage */ + return checksum; +} +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:isisd/iso_checksum.c diff --git a/lib/command.c b/lib/command.c index 4887f94f..0ca86dd3 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1,5 +1,9 @@ /* +<<<<<<< HEAD:lib/command.c + $Id: command.c,v 1.55 2007/04/28 22:14:10 ajs Exp $ +======= $Id$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/command.c Command interpreter routine for virtual terminal [aka TeletYpe] Copyright (C) 1997, 98, 99 Kunihiro Ishiguro diff --git a/lib/command.h b/lib/command.h index d093df3c..5a19874d 100644 --- a/lib/command.h +++ b/lib/command.h @@ -101,7 +101,11 @@ enum node_type DUMP_NODE, /* Packet dump node. */ FORWARDING_NODE, /* IP forwarding node. */ PROTOCOL_NODE, /* protocol filtering node */ +<<<<<<< HEAD:lib/command.h + VTY_NODE /* Vty node. */ +======= VTY_NODE, /* Vty node. */ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/command.h }; /* Node which has some commands and prompt string and configuration @@ -1,5 +1,9 @@ /* +<<<<<<< HEAD:lib/log.c + * $Id: log.c,v 1.34 2008/02/28 23:26:02 paul Exp $ +======= * $Id$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/log.c * * Logging of zebra * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro @@ -1,5 +1,9 @@ /* +<<<<<<< HEAD:lib/log.h + * $Id: log.h,v 1.20 2008/02/28 23:26:02 paul Exp $ +======= * $Id$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/log.h * * Zebra logging funcions. * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro @@ -144,7 +148,11 @@ extern int zlog_rotate (struct zlog *); /* For hackey massage lookup and check */ #define LOOKUP(x, y) mes_lookup(x, x ## _max, y, "(no item found)") +<<<<<<< HEAD:lib/log.h +extern const char *lookup (struct message *, int); +======= extern const char *lookup (const struct message *, int); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/log.h extern const char *mes_lookup (struct message *meslist, int max, int index, const char *no_item); diff --git a/lib/memtypes.c b/lib/memtypes.c index dd365ddb..bec6663c 100644 --- a/lib/memtypes.c +++ b/lib/memtypes.c @@ -6,7 +6,11 @@ * The script is sensitive to the format (though not whitespace), see * the top of memtypes.awk for more details. * +<<<<<<< HEAD:lib/memtypes.c + * $Id: memtypes.c,v 1.13 2008/07/21 21:02:50 paul Exp $ +======= * $Id$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/memtypes.c */ #include "zebra.h" diff --git a/lib/route_types.awk b/lib/route_types.awk index eb3d382a..e5c8e496 100644 --- a/lib/route_types.awk +++ b/lib/route_types.awk @@ -1,4 +1,8 @@ +<<<<<<< HEAD:lib/route_types.awk +# $Id: route_types.awk,v 1.3 2006/06/27 10:42:18 paul Exp $ +======= # $Id$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/route_types.awk # # Scan a file of route-type definitions (see eg route_types.txt) and # generate a corresponding header file with: diff --git a/lib/sockopt.c b/lib/sockopt.c index 4ba7e874..b07a3fc2 100644 --- a/lib/sockopt.c +++ b/lib/sockopt.c @@ -499,7 +499,10 @@ int sockopt_tcp_signature (int sock, union sockunion *su, const char *password) { #if HAVE_DECL_TCP_MD5SIG +<<<<<<< HEAD:lib/sockopt.c +======= int ret; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/sockopt.c #ifndef GNU_LINUX /* * XXX Need to do PF_KEY operation here to add/remove an SA entry, @@ -510,6 +513,10 @@ sockopt_tcp_signature (int sock, union sockunion *su, const char *password) int keylen = password ? strlen (password) : 0; struct tcp_md5sig md5sig; union sockunion *su2, *susock; +<<<<<<< HEAD:lib/sockopt.c + int ret; +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/sockopt.c /* Figure out whether the socket and the sockunion are the same family.. * adding AF_INET to AF_INET6 needs to be v4 mapped, you'd think.. @@ -553,9 +560,16 @@ sockopt_tcp_signature (int sock, union sockunion *su, const char *password) md5sig.tcpm_keylen = keylen; if (keylen) memcpy (md5sig.tcpm_key, password, keylen); +<<<<<<< HEAD:lib/sockopt.c +======= sockunion_free (susock); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/sockopt.c #endif /* GNU_LINUX */ ret = setsockopt (sock, IPPROTO_TCP, TCP_MD5SIG, &md5sig, sizeof md5sig); +<<<<<<< HEAD:lib/sockopt.c + sockunion_free (susock); +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/sockopt.c return ret; #else /* HAVE_TCP_MD5SIG */ return -2; diff --git a/lib/sockopt.h b/lib/sockopt.h index cb05c6fb..db2f94f0 100644 --- a/lib/sockopt.h +++ b/lib/sockopt.h @@ -89,7 +89,10 @@ extern int setsockopt_multicast_ipv4(int sock, int optname, unsigned int ifindex /* optional: if non-zero, may be used instead of if_addr */); +<<<<<<< HEAD:lib/sockopt.h +======= extern int setsockopt_ipv4_tos(int sock, int tos); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/sockopt.h /* Ask for, and get, ifindex, by whatever method is supported. */ extern int setsockopt_ifindex (int, int, int); diff --git a/lib/sockunion.c b/lib/sockunion.c index 8fbe3450..3052063f 100644 --- a/lib/sockunion.c +++ b/lib/sockunion.c @@ -225,6 +225,8 @@ sockunion_su2str (union sockunion *su) #endif /* HAVE_IPV6 */ } return XSTRDUP (MTYPE_TMP, str); +<<<<<<< HEAD:lib/sockunion.c +======= } /* Convert IPv4 compatible IPv6 address to IPv4 address. */ @@ -243,6 +245,7 @@ sockunion_normalise_mapped (union sockunion *su) memcpy (su, &sin, sizeof (struct sockaddr_in)); } #endif /* HAVE_IPV6 */ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/sockunion.c } /* Return socket of sockunion. */ @@ -271,6 +274,26 @@ sockunion_accept (int sock, union sockunion *su) len = sizeof (union sockunion); client_sock = accept (sock, (struct sockaddr *) su, &len); +<<<<<<< HEAD:lib/sockunion.c + /* Convert IPv4 compatible IPv6 address to IPv4 address. */ +#if 0 +#ifdef HAVE_IPV6 + if (su->sa.sa_family == AF_INET6) + { + if (IN6_IS_ADDR_V4MAPPED (&su->sin6.sin6_addr)) + { + struct sockaddr_in sin; + + memset (&sin, 0, sizeof (struct sockaddr_in)); + sin.sin_family = AF_INET; + memcpy (&sin.sin_addr, ((char *)&su->sin6.sin6_addr) + 12, 4); + memcpy (su, &sin, sizeof (struct sockaddr_in)); + } + } +#endif /* HAVE_IPV6 */ +#endif +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/sockunion.c return client_sock; } @@ -593,7 +616,22 @@ sockunion_getsockname (int fd) { su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion)); memcpy (su, &name, sizeof (struct sockaddr_in6)); +<<<<<<< HEAD:lib/sockunion.c + +#if 0 + if (IN6_IS_ADDR_V4MAPPED (&su->sin6.sin6_addr)) + { + struct sockaddr_in sin; + + sin.sin_family = AF_INET; + memcpy (&sin.sin_addr, ((char *)&su->sin6.sin6_addr) + 12, 4); + sin.sin_port = su->sin6.sin6_port; + memcpy (su, &sin, sizeof (struct sockaddr_in)); + } +#endif +======= sockunion_normalise_mapped (su); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/sockunion.c return su; } #endif /* HAVE_IPV6 */ @@ -638,7 +676,21 @@ sockunion_getpeername (int fd) { su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion)); memcpy (su, &name, sizeof (struct sockaddr_in6)); +<<<<<<< HEAD:lib/sockunion.c +#if 0 + if (IN6_IS_ADDR_V4MAPPED (&su->sin6.sin6_addr)) + { + struct sockaddr_in sin; + + sin.sin_family = AF_INET; + memcpy (&sin.sin_addr, ((char *)&su->sin6.sin6_addr) + 12, 4); + sin.sin_port = su->sin6.sin6_port; + memcpy (su, &sin, sizeof (struct sockaddr_in)); + } +#endif +======= sockunion_normalise_mapped (su); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:lib/sockunion.c return su; } #endif /* HAVE_IPV6 */ diff --git a/m4/Makefile.am b/m4/Makefile.am index 49a29bdf..7a043897 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1 +1,5 @@ +<<<<<<< HEAD:m4/Makefile.am +EXTRA_DIST= ChangeLog Makefile.am README.txt +======= EXTRA_DIST=Makefile.am README.txt +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:m4/Makefile.am diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index 103e8fc2..bba63f47 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -1291,6 +1291,58 @@ ospf6_brouter_debug_print (struct ospf6_route *brouter) } void +ospf6_brouter_debug_print (struct ospf6_route *brouter) +{ + u_int32_t brouter_id; + char brouter_name[16]; + char area_name[16]; + char destination[64]; + char installed[16], changed[16]; + struct timeval now, res; + char id[16], adv_router[16]; + char capa[16], options[16]; + + brouter_id = ADV_ROUTER_IN_PREFIX (&brouter->prefix); + inet_ntop (AF_INET, &brouter_id, brouter_name, sizeof (brouter_name)); + inet_ntop (AF_INET, &brouter->path.area_id, area_name, sizeof (area_name)); + ospf6_linkstate_prefix2str (&brouter->prefix, destination, + sizeof (destination)); + + gettimeofday (&now, (struct timezone *) NULL); + timersub (&now, &brouter->installed, &res); + timerstring (&res, installed, sizeof (installed)); + + gettimeofday (&now, (struct timezone *) NULL); + timersub (&now, &brouter->changed, &res); + timerstring (&res, changed, sizeof (changed)); + + inet_ntop (AF_INET, &brouter->path.origin.id, id, sizeof (id)); + inet_ntop (AF_INET, &brouter->path.origin.adv_router, adv_router, + sizeof (adv_router)); + + ospf6_options_printbuf (brouter->path.options, options, sizeof (options)); + ospf6_capability_printbuf (brouter->path.router_bits, capa, sizeof (capa)); + + zlog_info ("Brouter: %s via area %s", brouter_name, area_name); + zlog_info (" memory: prev: %p this: %p next: %p parent rnode: %p", + brouter->prev, brouter, brouter->next, brouter->rnode); + zlog_info (" type: %d prefix: %s installed: %s changed: %s", + brouter->type, destination, installed, changed); + zlog_info (" lock: %d flags: %s%s%s%s", brouter->lock, + (CHECK_FLAG (brouter->flag, OSPF6_ROUTE_BEST) ? "B" : "-"), + (CHECK_FLAG (brouter->flag, OSPF6_ROUTE_ADD) ? "A" : "-"), + (CHECK_FLAG (brouter->flag, OSPF6_ROUTE_REMOVE) ? "R" : "-"), + (CHECK_FLAG (brouter->flag, OSPF6_ROUTE_CHANGE) ? "C" : "-")); + zlog_info (" path type: %s ls-origin %s id: %s adv-router %s", + OSPF6_PATH_TYPE_NAME (brouter->path.type), + ospf6_lstype_name (brouter->path.origin.type), + id, adv_router); + zlog_info (" options: %s router-bits: %s metric-type: %d metric: %d/%d", + options, capa, brouter->path.metric_type, + brouter->path.cost, brouter->path.cost_e2); +} + +void ospf6_intra_brouter_calculation (struct ospf6_area *oa) { struct ospf6_route *brouter, *copy; diff --git a/ospf6d/ospf6_intra.h b/ospf6d/ospf6_intra.h index 31643fd8..19c1f121 100644 --- a/ospf6d/ospf6_intra.h +++ b/ospf6d/ospf6_intra.h @@ -210,5 +210,8 @@ extern void ospf6_intra_init (void); extern int config_write_ospf6_debug_brouter (struct vty *vty); extern void install_element_ospf6_debug_brouter (void); +int config_write_ospf6_debug_brouter (struct vty *vty); +void install_element_ospf6_debug_brouter (); + #endif /* OSPF6_LSA_H */ diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index 8dcc877f..d12e0ce0 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -279,10 +279,17 @@ extern struct ospf6_route *ospf6_route_match_head (struct prefix *prefix, extern struct ospf6_route *ospf6_route_match_next (struct prefix *prefix, struct ospf6_route *route); +<<<<<<< HEAD:ospf6d/ospf6_route.h +void ospf6_route_remove_all (struct ospf6_route_table *); +struct ospf6_route_table *ospf6_route_table_create (int s, int t); +void ospf6_route_table_delete (struct ospf6_route_table *); +void ospf6_route_dump (struct ospf6_route_table *table); +======= extern void ospf6_route_remove_all (struct ospf6_route_table *); extern struct ospf6_route_table *ospf6_route_table_create (int s, int t); extern void ospf6_route_table_delete (struct ospf6_route_table *); extern void ospf6_route_dump (struct ospf6_route_table *table); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospf6d/ospf6_route.h extern void ospf6_route_show (struct vty *vty, struct ospf6_route *route); diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index f59b6f95..569994c0 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -562,7 +562,11 @@ ALIAS (show_ipv6_ospf6_route_match, ROUTE_STR "Specify IPv6 prefix\n" "Display routes longer than the specified route\n" +<<<<<<< HEAD:ospf6d/ospf6_top.c + ); +======= ) +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospf6d/ospf6_top.c DEFUN (show_ipv6_ospf6_route_match_detail, show_ipv6_ospf6_route_longer_detail_cmd, diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index f453353d..8981b57f 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -182,8 +182,17 @@ ospf_lsa_checksum (struct lsa_header *lsa) u_char *buffer = (u_char *) &lsa->options; int options_offset = buffer - (u_char *) &lsa->ls_age; /* should be 2 */ +<<<<<<< HEAD:ospfd/ospf_lsa.c + x = (((int)length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255; + if (x <= 0) + x += 255; + y = 510 - c0 - x; + if (y > 255) + y -= 255; +======= /* Skip the AGE field */ u_int16_t len = ntohs(lsa->length) - options_offset; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_lsa.c /* Checksum offset starts from "options" field, not the beginning of the lsa_header struct. The offset is 14, rather than 16. */ diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 5f0d99da..c7279c9a 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -765,6 +765,27 @@ ospf_hello (struct ip *iph, struct ospf_header *ospfh, return; } +<<<<<<< HEAD:ospfd/ospf_packet.c + /* If incoming interface is passive one, ignore Hello. */ + if (OSPF_IF_PASSIVE_STATUS (oi) == OSPF_IF_PASSIVE) { + char buf[3][INET_ADDRSTRLEN]; + zlog_debug ("ignoring HELLO from router %s sent to %s, " + "received on a passive interface, %s", + inet_ntop(AF_INET, &ospfh->router_id, buf[0], sizeof(buf[0])), + inet_ntop(AF_INET, &iph->ip_dst, buf[1], sizeof(buf[1])), + inet_ntop(AF_INET, &oi->address->u.prefix4, + buf[2], sizeof(buf[2]))); + if (iph->ip_dst.s_addr == htonl(OSPF_ALLSPFROUTERS)) + { + /* Try to fix multicast membership. */ + OI_MEMBER_JOINED(oi, MEMBER_ALLROUTERS); + ospf_if_set_multicast(oi); + } + return; + } + +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_packet.c /* get neighbor prefix. */ p.family = AF_INET; p.prefixlen = ip_masklen (hello->network_mask); diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index 82f0fedd..2c5064e5 100644 --- a/ospfd/ospf_spf.c +++ b/ospfd/ospf_spf.c @@ -200,11 +200,21 @@ ospf_vertex_free (void *data) * vertices */ //assert (listcount (v->parents) == 0); +<<<<<<< HEAD:ospfd/ospf_spf.c +======= if (v->children) list_delete (v->children); v->children = NULL; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_spf.c +<<<<<<< HEAD:ospfd/ospf_spf.c + if (v->children) + list_delete (v->children); + v->children = NULL; + +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_spf.c if (v->parents) list_delete (v->parents); v->parents = NULL; @@ -432,7 +442,20 @@ ospf_spf_add_parent (struct vertex *v, struct vertex *w, /* we must have a newhop, and a distance */ assert (v && w && newhop); assert (distance); +<<<<<<< HEAD:ospfd/ospf_spf.c +======= + + /* IFF w has already been assigned a distance, then we shouldn't get here + * unless callers have determined V(l)->W is shortest / equal-shortest + * path (0 is a special case distance (no distance yet assigned)). + */ + if (w->distance) + assert (distance <= w->distance); + else + w->distance = distance; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_spf.c +<<<<<<< HEAD:ospfd/ospf_spf.c /* IFF w has already been assigned a distance, then we shouldn't get here * unless callers have determined V(l)->W is shortest / equal-shortest * path (0 is a special case distance (no distance yet assigned)). @@ -442,6 +465,8 @@ ospf_spf_add_parent (struct vertex *v, struct vertex *w, else w->distance = distance; +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_spf.c if (IS_DEBUG_OSPF_EVENT) { char buf[2][INET_ADDRSTRLEN]; diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index e27f1394..6188ec83 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -266,7 +266,13 @@ ospf_interface_address_add (int command, struct zclient *zclient, zlog_debug("Zebra: interface %s address add %s", c->ifp->name, buf); } +<<<<<<< HEAD:ospfd/ospf_zebra.c + ospf = ospf_lookup (); + if (ospf != NULL) + ospf_if_update (ospf); +======= ospf_if_update (NULL, c->ifp); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospf_zebra.c #ifdef HAVE_SNMP ospf_snmp_if_update (c->ifp); diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index c951a29a..1d38adcf 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -958,7 +958,65 @@ ospf_network_run (struct prefix *p, struct ospf_area *area) /* Get target interface. */ for (ALL_LIST_ELEMENTS_RO (om->iflist, node, ifp)) +<<<<<<< HEAD:ospfd/ospfd.c + { + struct listnode *cnode; + + if (memcmp (ifp->name, "VLINK", 5) == 0) + continue; + + /* if interface prefix is match specified prefix, + then create socket and join multicast group. */ + for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, co)) + { + struct prefix *addr; + + if (CHECK_FLAG(co->flags,ZEBRA_IFA_SECONDARY)) + continue; + + addr = CONNECTED_ID(co); + + if (p->family == co->address->family + && ! ospf_if_is_configured (ospf, &(addr->u.prefix4)) + && ospf_network_match_iface(co,p)) + { + struct ospf_interface *oi; + + oi = ospf_if_new (ospf, ifp, co->address); + oi->connected = co; + + oi->area = area; + + oi->params = ospf_lookup_if_params (ifp, oi->address->u.prefix4); + oi->output_cost = ospf_if_get_output_cost (oi); + + /* Add pseudo neighbor. */ + ospf_nbr_add_self (oi); + + /* Relate ospf interface to ospf instance. */ + oi->ospf = ospf; + + /* update network type as interface flag */ + /* If network type is specified previously, + skip network type setting. */ + oi->type = IF_DEF_PARAMS (ifp)->type; + + ospf_area_add_if (oi->area, oi); + + /* if router_id is not configured, dont bring up + * interfaces. + * ospf_router_id_update() will call ospf_if_update + * whenever r-id is configured instead. + */ + if ((ospf->router_id.s_addr != 0) + && if_is_operative (ifp)) + ospf_if_up (oi); + } + } + } +======= ospf_network_run_interface (p, area, ifp); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ospfd/ospfd.c } void diff --git a/ripd/ripd.c b/ripd/ripd.c index 2525679c..632d338e 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -84,7 +84,10 @@ static const struct message rip_msg[] = {RIP_TRACEOFF, "TRACEOFF"}, {RIP_POLL, "POLL"}, {RIP_POLL_ENTRY, "POLL ENTRY"}, +<<<<<<< HEAD:ripd/ripd.c +======= {0, NULL}, +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ripd/ripd.c }; /* Utility function to set boradcast option to the socket. */ diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index d76e3a13..983db5b7 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -450,10 +450,19 @@ ripng_interface_address_add (int command, struct zclient *zclient, if (!ri->running) { /* Check if this interface is RIP enabled or not.*/ ripng_enable_apply (c->ifp); +<<<<<<< HEAD:ripngd/ripng_interface.c +======= /* Apply distribute list to the interface. */ ripng_distribute_update_interface (c->ifp); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ripngd/ripng_interface.c +<<<<<<< HEAD:ripngd/ripng_interface.c + /* Apply distribute list to the interface. */ + ripng_distribute_update_interface (c->ifp); + +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:ripngd/ripng_interface.c /* Check interface routemap. */ ripng_if_rmap_update_interface (c->ifp); } diff --git a/solaris/Makefile.am b/solaris/Makefile.am index 674f4ebf..e2cb4df6 100644 --- a/solaris/Makefile.am +++ b/solaris/Makefile.am @@ -1,5 +1,9 @@ # Solaris packages automake file +<<<<<<< HEAD:solaris/Makefile.am +# $Id: Makefile.am,v 1.9 2008/01/13 18:52:15 paul Exp $ +======= # $Id$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:solaris/Makefile.am # XXX This file uses GNU make extensions. diff --git a/solaris/quagga.init.in b/solaris/quagga.init.in index 8b298c37..a85686be 100755 --- a/solaris/quagga.init.in +++ b/solaris/quagga.init.in @@ -20,7 +20,11 @@ # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # +<<<<<<< HEAD:solaris/quagga.init.in +# $Id: quagga.init.in,v 1.8 2008/07/03 20:41:08 paul Exp $ +======= # $Id$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:solaris/quagga.init.in # # Starts/stops the given daemon diff --git a/tests/heavy-wq.c b/tests/heavy-wq.c index a2c609d4..14a0cf64 100644 --- a/tests/heavy-wq.c +++ b/tests/heavy-wq.c @@ -1,5 +1,9 @@ /* +<<<<<<< HEAD:tests/heavy-wq.c + * $Id: heavy-wq.c,v 1.4 2006/08/27 06:53:24 paul Exp $ +======= * $Id$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:tests/heavy-wq.c * * This file is part of Quagga. * diff --git a/watchquagga/watchquagga.c b/watchquagga/watchquagga.c index f4c483cf..4f7855ab 100644 --- a/watchquagga/watchquagga.c +++ b/watchquagga/watchquagga.c @@ -1,5 +1,9 @@ /* +<<<<<<< HEAD:watchquagga/watchquagga.c + $Id: watchquagga.c,v 1.12 2007/05/10 02:38:52 paul Exp $ +======= $Id$ +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:watchquagga/watchquagga.c Monitor status of quagga daemons and restart if necessary. diff --git a/zebra/debug.c b/zebra/debug.c index 175029b8..7350e576 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -236,7 +236,11 @@ DEFUN (no_debug_zebra_rib, DEFUN (no_debug_zebra_rib_q, no_debug_zebra_rib_q_cmd, +<<<<<<< HEAD:zebra/debug.c + "no debug zebra rib queueu", +======= "no debug zebra rib queue", +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/debug.c NO_STR DEBUG_STR "Zebra configuration\n" diff --git a/zebra/kernel_socket.h b/zebra/kernel_socket.h index e9558ad6..ad6770ca 100644 --- a/zebra/kernel_socket.h +++ b/zebra/kernel_socket.h @@ -28,6 +28,10 @@ extern int ifam_read (struct ifa_msghdr *); extern int ifm_read (struct if_msghdr *); extern int rtm_write (int, union sockunion *, union sockunion *, union sockunion *, unsigned int, int, int); +<<<<<<< HEAD:zebra/kernel_socket.h +extern struct message rtm_type_str[]; +======= extern const struct message rtm_type_str[]; +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/kernel_socket.h #endif /* __ZEBRA_KERNEL_SOCKET_H */ diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 05254498..07e86647 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1831,12 +1831,57 @@ kernel_read (struct thread *thread) return 0; } +<<<<<<< HEAD:zebra/rt_netlink.c +/* Filter out messages from self that occur on listener socket */ +static void netlink_install_filter (int sock) +======= /* Filter out messages from self that occur on listener socket, caused by our actions on the command socket */ static void netlink_install_filter (int sock, __u32 pid) +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/rt_netlink.c { +<<<<<<< HEAD:zebra/rt_netlink.c + /* + * Filter is equivalent to netlink_route_change + * + * if (h->nlmsg_type == RTM_DELROUTE || h->nlmsg_type == RTM_NEWROUTE) { + * if (rtm->rtm_type != RTM_UNICAST) + * return 0; + * if (rtm->rtm_flags & RTM_F_CLONED) + * return 0; + * if (rtm->rtm_protocol == RTPROT_REDIRECT) + * return 0; + * if (rtm->rtm_protocol == RTPROT_KERNEL) + * return 0; + * if (rtm->rtm_protocol == RTPROT_ZEBRA && h->nlmsg_type == RTM_NEWROUTE) + * return 0; + * } + * return 0xffff; + */ +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/rt_netlink.c struct sock_filter filter[] = { +<<<<<<< HEAD:zebra/rt_netlink.c + /* 0*/ BPF_STMT(BPF_LD|BPF_ABS|BPF_H, offsetof(struct nlmsghdr, nlmsg_type)), + /* 1*/ BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, htons(RTM_DELROUTE), 1, 0), + /* 2*/ BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, htons(RTM_NEWROUTE), 0, 11), + /* 3*/ BPF_STMT(BPF_LD|BPF_ABS|BPF_B, + sizeof(struct nlmsghdr) + offsetof(struct rtmsg, rtm_type)), + /* 4*/ BPF_JUMP(BPF_JMP|BPF_B, RTN_UNICAST, 0, 8), + /* 5*/ BPF_STMT(BPF_LD|BPF_ABS|BPF_B, + sizeof(struct nlmsghdr) + offsetof(struct rtmsg, rtm_flags)), + /* 6*/ BPF_JUMP(BPF_JMP|BPF_JSET|BPF_K, RTM_F_CLONED, 6, 0), + /* 7*/ BPF_STMT(BPF_LD|BPF_ABS|BPF_B, + sizeof(struct nlmsghdr) + offsetof(struct rtmsg, rtm_protocol)), + /* 8*/ BPF_JUMP(BPF_JMP+ BPF_B, RTPROT_REDIRECT, 4, 0), + /* 9*/ BPF_JUMP(BPF_JMP+ BPF_B, RTPROT_KERNEL, 0, 1), + /*10*/ BPF_JUMP(BPF_JMP+ BPF_B, RTPROT_ZEBRA, 0, 3), + /*11*/ BPF_STMT(BPF_LD|BPF_ABS|BPF_H, offsetof(struct nlmsghdr, nlmsg_type)), + /*12*/ BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, htons(RTM_NEWROUTE), 0, 1), + /*13*/ BPF_STMT(BPF_RET|BPF_K, 0), /* drop */ + /*14*/ BPF_STMT(BPF_RET|BPF_K, 0xffff), /* keep */ +======= /* 0: ldh [4] */ BPF_STMT(BPF_LD|BPF_ABS|BPF_H, offsetof(struct nlmsghdr, nlmsg_type)), /* 1: jeq 0x18 jt 3 jf 6 */ @@ -1851,6 +1896,7 @@ static void netlink_install_filter (int sock, __u32 pid) BPF_STMT(BPF_RET|BPF_K, 0), /* 6: ret 0xffff (keep) */ BPF_STMT(BPF_RET|BPF_K, 0xffff), +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/rt_netlink.c }; struct sock_fprog prog = { @@ -1879,6 +1925,9 @@ kernel_init (void) /* Register kernel socket. */ if (netlink.sock > 0) { +<<<<<<< HEAD:zebra/rt_netlink.c + netlink_install_filter (netlink.sock); +======= /* Only want non-blocking on the netlink event socket */ if (fcntl (netlink.sock, F_SETFL, O_NONBLOCK) < 0) zlog (NULL, LOG_ERR, "Can't set %s socket flags: %s", netlink.name, @@ -1889,6 +1938,7 @@ kernel_init (void) netlink_recvbuf (&netlink, nl_rcvbufsize); netlink_install_filter (netlink.sock, netlink_cmd.snl.nl_pid); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/rt_netlink.c thread_add_read (zebrad.master, kernel_read, NULL, netlink.sock); } } diff --git a/zebra/rtadv.h b/zebra/rtadv.h index abd1c6fc..658bc5ff 100644 --- a/zebra/rtadv.h +++ b/zebra/rtadv.h @@ -23,7 +23,10 @@ #ifndef _ZEBRA_RTADV_H #define _ZEBRA_RTADV_H +<<<<<<< HEAD:zebra/rtadv.h +======= #include "vty.h" +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/rtadv.h #include "zebra/interface.h" /* Router advertisement prefix. */ diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 90db932b..1cb9856a 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -683,12 +683,21 @@ rib_lookup_ipv4_route (struct prefix_ipv4 *p, union sockunion * qgate) /* Find out if a "selected" RR for the discovered RIB entry exists ever. */ for (match = rn->info; match; match = match->next) +<<<<<<< HEAD:zebra/zebra_rib.c + { + if (CHECK_FLAG (match->status, RIB_ENTRY_REMOVED)) + continue; + if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED)) + break; + } +======= { if (CHECK_FLAG (match->status, RIB_ENTRY_REMOVED)) continue; if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED)) break; } +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c /* None such found :( */ if (!match) @@ -1191,6 +1200,7 @@ rib_process (struct route_node *rn) rn->p.prefixlen, del, rn); rib_unlink (rn, del); } +<<<<<<< HEAD:zebra/zebra_rib.c end: if (IS_ZEBRA_DEBUG_RIB_Q) @@ -1201,6 +1211,107 @@ end: * it and processed by rib_process(). Don't process more, than one RN record; operate * only in the specified sub-queue. */ +unsigned int +process_subq (struct list * subq, u_char qindex) +{ + struct listnode *lnode; + struct route_node *rnode; + if (!(lnode = listhead (subq))) + return 0; + rnode = listgetdata (lnode); + rib_process (rnode); + if (rnode->info) /* The first RIB record is holding the flags bitmask. */ + UNSET_FLAG (((struct rib *)rnode->info)->rn_status, RIB_ROUTE_QUEUED(qindex)); + route_unlock_node (rnode); + list_delete_node (subq, lnode); + return 1; +} + +/* Dispatch the meta queue by picking, processing and unlocking the next RN from + * a non-empty sub-queue with lowest priority. wq is equal to zebra->ribq and data + * is pointed to the meta queue structure. + */ +static wq_item_status +meta_queue_process (struct work_queue *dummy, void *data) +{ + struct meta_queue * mq = data; + u_char i; + for (i = 0; i < MQ_SIZE; i++) + if (process_subq (mq->subq[i], i)) + { + mq->size--; + break; + } + return mq->size ? WQ_REQUEUE : WQ_SUCCESS; +} +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c + +<<<<<<< HEAD:zebra/zebra_rib.c +/* Look into the RN and queue it into one or more priority queues, increasing the size + * for each data push done. + */ +void rib_meta_queue_add (struct meta_queue *mq, struct route_node *rn) +{ + u_char qindex; + struct rib *rib; + char buf[INET6_ADDRSTRLEN]; +======= +end: +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c + if (IS_ZEBRA_DEBUG_RIB_Q) +<<<<<<< HEAD:zebra/zebra_rib.c + inet_ntop (rn->p.family, &rn->p.u.prefix, buf, INET6_ADDRSTRLEN); + for (rib = rn->info; rib; rib = rib->next) + { + switch (rib->type) + { + case ZEBRA_ROUTE_KERNEL: + case ZEBRA_ROUTE_CONNECT: + qindex = 0; + break; + case ZEBRA_ROUTE_STATIC: + qindex = 1; + break; + case ZEBRA_ROUTE_RIP: + case ZEBRA_ROUTE_RIPNG: + case ZEBRA_ROUTE_OSPF: + case ZEBRA_ROUTE_OSPF6: + case ZEBRA_ROUTE_ISIS: + qindex = 2; + break; + case ZEBRA_ROUTE_BGP: + qindex = 3; + break; + default: + qindex = 4; + break; + } + /* Invariant: at this point we always have rn->info set. */ + if (CHECK_FLAG (((struct rib *)rn->info)->rn_status, RIB_ROUTE_QUEUED(qindex))) + { + if (IS_ZEBRA_DEBUG_RIB_Q) + zlog_debug ("%s: %s/%d: rn %p is already queued in sub-queue %u", __func__, buf, rn->p.prefixlen, rn, qindex); + continue; + } + SET_FLAG (((struct rib *)rn->info)->rn_status, RIB_ROUTE_QUEUED(qindex)); + listnode_add (mq->subq[qindex], rn); + route_lock_node (rn); + mq->size++; + if (IS_ZEBRA_DEBUG_RIB_Q) + zlog_debug ("%s: %s/%d: queued rn %p into sub-queue %u", __func__, buf, rn->p.prefixlen, rn, qindex); + } +======= + zlog_debug ("%s: %s/%d: rn %p dequeued", __func__, buf, rn->p.prefixlen, rn); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c +} + +<<<<<<< HEAD:zebra/zebra_rib.c +======= +/* Take a list of route_node structs and return 1, if there was a record picked from + * it and processed by rib_process(). Don't process more, than one RN record; operate + * only in the specified sub-queue. + */ static unsigned int process_subq (struct list * subq, u_char qindex) { @@ -1287,6 +1398,7 @@ rib_meta_queue_add (struct meta_queue *mq, struct route_node *rn) } } +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c /* Add route_node to work queue and schedule processing */ static void rib_queue_add (struct zebra_t *zebra, struct route_node *rn) @@ -1329,16 +1441,30 @@ rib_queue_add (struct zebra_t *zebra, struct route_node *rn) work_queue_add (zebra->ribq, zebra->mq); rib_meta_queue_add (zebra->mq, rn); +<<<<<<< HEAD:zebra/zebra_rib.c +======= + + if (IS_ZEBRA_DEBUG_RIB_Q) + zlog_debug ("%s: %s/%d: rn %p queued", __func__, buf, rn->p.prefixlen, rn); +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c +<<<<<<< HEAD:zebra/zebra_rib.c if (IS_ZEBRA_DEBUG_RIB_Q) zlog_debug ("%s: %s/%d: rn %p queued", __func__, buf, rn->p.prefixlen, rn); +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c return; } /* Create new meta queue. A destructor function doesn't seem to be necessary here. */ +<<<<<<< HEAD:zebra/zebra_rib.c +struct meta_queue * +meta_queue_new () +======= static struct meta_queue * meta_queue_new (void) +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c { struct meta_queue *new; unsigned i, failed = 0; @@ -1461,7 +1587,32 @@ rib_link (struct route_node *rn, struct rib *rib) static void rib_addnode (struct route_node *rn, struct rib *rib) +<<<<<<< HEAD:zebra/zebra_rib.c +======= +{ + /* RIB node has been un-removed before route-node is processed. + * route_node must hence already be on the queue for processing.. + */ + if (CHECK_FLAG (rib->status, RIB_ENTRY_REMOVED)) + { + if (IS_ZEBRA_DEBUG_RIB) + { + char buf[INET6_ADDRSTRLEN]; + inet_ntop (rn->p.family, &rn->p.u.prefix, buf, INET6_ADDRSTRLEN); + zlog_debug ("%s: %s/%d: rn %p, un-removed rib %p", + __func__, buf, rn->p.prefixlen, rn, rib); + } + UNSET_FLAG (rib->status, RIB_ENTRY_REMOVED); + return; + } + rib_link (rn, rib); +} + +static void +rib_unlink (struct route_node *rn, struct rib *rib) +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c { +<<<<<<< HEAD:zebra/zebra_rib.c /* RIB node has been un-removed before route-node is processed. * route_node must hence already be on the queue for processing.. */ @@ -1483,6 +1634,8 @@ rib_addnode (struct route_node *rn, struct rib *rib) static void rib_unlink (struct route_node *rn, struct rib *rib) { +======= +>>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:zebra/zebra_rib.c struct nexthop *nexthop, *next; char buf[INET6_ADDRSTRLEN]; |