diff options
Diffstat (limited to 'ospf6d')
-rw-r--r-- | ospf6d/ospf6_abr.h | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_area.c | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_asbr.c | 7 | ||||
-rw-r--r-- | ospf6d/ospf6_interface.c | 1 | ||||
-rw-r--r-- | ospf6d/ospf6_lsa.c | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_neighbor.c | 25 | ||||
-rw-r--r-- | ospf6d/ospf6_neighbor.h | 25 | ||||
-rw-r--r-- | ospf6d/ospf6_network.c | 18 | ||||
-rw-r--r-- | ospf6d/ospf6_network.h | 6 | ||||
-rw-r--r-- | ospf6d/ospf6_route.h | 5 | ||||
-rw-r--r-- | ospf6d/ospf6_spf.c | 3 | ||||
-rw-r--r-- | ospf6d/ospf6_top.c | 6 |
12 files changed, 42 insertions, 60 deletions
diff --git a/ospf6d/ospf6_abr.h b/ospf6d/ospf6_abr.h index 816f5964..e5e2660b 100644 --- a/ospf6d/ospf6_abr.h +++ b/ospf6d/ospf6_abr.h @@ -24,6 +24,8 @@ /* for struct ospf6_route */ #include "ospf6_route.h" +/* for struct ospf6_prefix */ +#include "ospf6_proto.h" /* Debug option */ extern unsigned char conf_debug_ospf6_abr; diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index 4b4ca130..9b704221 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -518,13 +518,11 @@ DEFUN (no_area_filter_list, "Filter networks sent from this area\n") { struct ospf6_area *area; - struct prefix_list *plist; OSPF6_CMD_AREA_GET (argv[0], area); argc--; argv++; - plist = prefix_list_lookup (AFI_IP6, argv[0]); if (strncmp (argv[1], "in", 2) == 0) { if (PREFIX_NAME_IN (area)) diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 6ba6cdf6..b1620d4a 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -58,18 +58,13 @@ ospf6_as_external_lsa_originate (struct ospf6_route *route) { char buffer[OSPF6_MAX_LSASIZE]; struct ospf6_lsa_header *lsa_header; - struct ospf6_lsa *old, *lsa; + struct ospf6_lsa *lsa; struct ospf6_external_info *info = route->route_option; struct ospf6_as_external_lsa *as_external_lsa; char buf[64]; caddr_t p; - /* find previous LSA */ - old = ospf6_lsdb_lookup (htons (OSPF6_LSTYPE_AS_EXTERNAL), - route->path.origin.id, ospf6->router_id, - ospf6->lsdb); - if (IS_OSPF6_DEBUG_ASBR || IS_OSPF6_DEBUG_ORIGINATE (AS_EXTERNAL)) { prefix2str (&route->prefix, buf, sizeof (buf)); diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index f0ef7909..772caff7 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1283,7 +1283,6 @@ DEFUN (no_ipv6_ospf6_cost, { struct ospf6_interface *oi; struct interface *ifp; - unsigned long int lcost; ifp = (struct interface *) vty->index; assert (ifp); diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 2e615355..e57306bc 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -493,7 +493,7 @@ ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa) vty_out (vty, "Flag: %x %s", lsa->flag, VNL); vty_out (vty, "Lock: %d %s", lsa->lock, VNL); vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VNL); - vty_out (vty, "Threads: Expire: %x, Refresh: %x %s", + vty_out (vty, "Threads: Expire: 0x%p, Refresh: 0x%p %s", lsa->expire, lsa->refresh, VNL); vty_out (vty, "%s", VNL); return; diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c index 7f6c6c5c..f20c83b9 100644 --- a/ospf6d/ospf6_neighbor.c +++ b/ospf6d/ospf6_neighbor.c @@ -46,6 +46,31 @@ const char *ospf6_neighbor_state_str[] = { "None", "Down", "Attempt", "Init", "Twoway", "ExStart", "ExChange", "Loading", "Full", NULL }; +static const char *ospf6_neighbor_event_str[] = + { + "NoEvent", + "HelloReceived", + "2-WayReceived", + "NegotiationDone", + "ExchangeDone", + "LoadingDone", + "AdjOK?", + "SeqNumberMismatch", + "BadLSReq", + "1-WayReceived", + "InactivityTimer", + }; + +static const char * +ospf6_neighbor_event_string (int event) +{ + #define OSPF6_NEIGHBOR_UNKNOWN_EVENT_STRING "UnknownEvent" + + if (event < OSPF6_NEIGHBOR_EVENT_MAX_EVENT) + return ospf6_neighbor_event_str[event]; + return OSPF6_NEIGHBOR_UNKNOWN_EVENT_STRING; +} + int ospf6_neighbor_cmp (void *va, void *vb) { diff --git a/ospf6d/ospf6_neighbor.h b/ospf6d/ospf6_neighbor.h index 65c43fd2..93ffa289 100644 --- a/ospf6d/ospf6_neighbor.h +++ b/ospf6d/ospf6_neighbor.h @@ -122,33 +122,8 @@ struct ospf6_neighbor #define OSPF6_NEIGHBOR_EVENT_INACTIVITY_TIMER 10 #define OSPF6_NEIGHBOR_EVENT_MAX_EVENT 11 -static const char *ospf6_neighbor_event_str[] = - { - "NoEvent", - "HelloReceived", - "2-WayReceived", - "NegotiationDone", - "ExchangeDone", - "LoadingDone", - "AdjOK?", - "SeqNumberMismatch", - "BadLSReq", - "1-WayReceived", - "InactivityTimer", - }; - -static const char *ospf6_neighbor_event_string (int event) -{ - #define OSPF6_NEIGHBOR_UNKNOWN_EVENT_STRING "UnknownEvent" - - if (event < OSPF6_NEIGHBOR_EVENT_MAX_EVENT) - return ospf6_neighbor_event_str[event]; - return OSPF6_NEIGHBOR_UNKNOWN_EVENT_STRING; -} - extern const char *ospf6_neighbor_state_str[]; - /* Function Prototypes */ int ospf6_neighbor_cmp (void *va, void *vb); void ospf6_neighbor_dbex_init (struct ospf6_neighbor *on); diff --git a/ospf6d/ospf6_network.c b/ospf6d/ospf6_network.c index 74cfbec7..e0be38b3 100644 --- a/ospf6d/ospf6_network.c +++ b/ospf6d/ospf6_network.c @@ -37,18 +37,8 @@ int ospf6_sock; struct in6_addr allspfrouters6; struct in6_addr alldrouters6; -/* setsockopt ReUseAddr to on */ -void -ospf6_set_reuseaddr (void) -{ - u_int on = 0; - if (setsockopt (ospf6_sock, SOL_SOCKET, SO_REUSEADDR, &on, - sizeof (u_int)) < 0) - zlog_warn ("Network: set SO_REUSEADDR failed: %s", safe_strerror (errno)); -} - /* setsockopt MulticastLoop to off */ -void +static void ospf6_reset_mcastloop (void) { u_int off = 0; @@ -58,13 +48,13 @@ ospf6_reset_mcastloop (void) safe_strerror (errno)); } -void +static void ospf6_set_pktinfo (void) { setsockopt_ipv6_pktinfo (ospf6_sock, 1); } -void +static void ospf6_set_transport_class (void) { #ifdef IPTOS_PREC_INTERNETCONTROL @@ -72,7 +62,7 @@ ospf6_set_transport_class (void) #endif } -void +static void ospf6_set_checksum (void) { int offset = 12; diff --git a/ospf6d/ospf6_network.h b/ospf6d/ospf6_network.h index 947834d5..127bf45c 100644 --- a/ospf6d/ospf6_network.h +++ b/ospf6d/ospf6_network.h @@ -28,12 +28,6 @@ extern int ospf6_sock; extern struct in6_addr allspfrouters6; extern struct in6_addr alldrouters6; -/* Function Prototypes */ -extern void ospf6_set_reuseaddr (void); -extern void ospf6_reset_mcastloop (void); -extern void ospf6_set_pktinfo (void); -extern void ospf6_set_checksum (void); - extern int ospf6_serv_sock (void); extern void ospf6_sso (u_int ifindex, struct in6_addr *group, int option); diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index b384824c..c0dcf9f1 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -122,6 +122,10 @@ struct ospf6_route /* Destination Type */ u_char type; + /* XXX: It would likely be better to use separate struct in_addr's + * for the advertising router-ID and prefix IDs, instead of stuffing them + * into one. See also XXX below. + */ /* Destination ID */ struct prefix prefix; @@ -235,6 +239,7 @@ extern const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX]; sizeof (struct ospf6_nexthop) * OSPF6_MULTI_PATH_LIMIT) == 0) #define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST)) +/* XXX: This gives GCC heartburn aboutbreaking aliasing rules. */ #define ospf6_linkstate_prefix_adv_router(x) \ (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[0])) #define ospf6_linkstate_prefix_id(x) \ diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 3ef5485f..d0e9101b 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -40,6 +40,7 @@ #include "ospf6_intra.h" #include "ospf6_interface.h" #include "ospf6d.h" +#include "ospf6_abr.h" unsigned char conf_debug_ospf6_spf = 0; @@ -391,7 +392,7 @@ static const char *ospf6_spf_reason_str[] = void ospf6_spf_reason_string (unsigned int reason, char *buf, int size) { - int bit; + size_t bit; int len = 0; if (!buf) diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 71912701..e4e6f17a 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -180,6 +180,7 @@ ospf6_delete (struct ospf6 *o) } static void +__attribute__((unused)) ospf6_enable (struct ospf6 *o) { struct listnode *node, *nnode; @@ -219,7 +220,7 @@ ospf6_disable (struct ospf6 *o) } } -int +static int ospf6_maxage_remover (struct thread *thread) { struct ospf6 *o = (struct ospf6 *) THREAD_ARG (thread); @@ -471,14 +472,11 @@ DEFUN (no_ospf6_interface_area, "OSPF6 area ID in IPv4 address notation\n" ) { - struct ospf6 *o; struct ospf6_interface *oi; struct ospf6_area *oa; struct interface *ifp; u_int32_t area_id; - o = (struct ospf6 *) vty->index; - ifp = if_lookup_by_name (argv[0]); if (ifp == NULL) { |