1 diff -Nur olsrd-0.4.10.orig/src/link_set.c olsrd-0.4.10/src/link_set.c
2 --- olsrd-0.4.10.orig/src/link_set.c 2006-12-01 09:04:56.000000000 +0100
3 +++ olsrd-0.4.10/src/link_set.c 2006-12-01 09:06:22.000000000 +0100
8 + *Delete all interface link entries
10 + *@param interface ip address
14 +del_if_link_entries(union olsr_ip_addr *int_addr)
16 + struct link_entry *tmp_link_set, *last_link_entry;
18 + if(link_set == NULL)
21 + tmp_link_set = link_set;
22 + last_link_entry = NULL;
27 + if(COMP_IP(int_addr, &tmp_link_set->local_iface_addr))
29 + if(last_link_entry != NULL)
31 + last_link_entry->next = tmp_link_set->next;
33 + /* Delete neighbor entry */
34 + if(tmp_link_set->neighbor->linkcount == 1)
35 + olsr_delete_neighbor_table(&tmp_link_set->neighbor->neighbor_main_addr);
37 + tmp_link_set->neighbor->linkcount--;
39 + //olsr_delete_neighbor_if_no_link(&tmp_link_set->neighbor->neighbor_main_addr);
40 + changes_neighborhood = OLSR_TRUE;
43 + tmp_link_set = last_link_entry;
47 + link_set = tmp_link_set->next; /* CHANGED */
49 + /* Delete neighbor entry */
50 + if(tmp_link_set->neighbor->linkcount == 1)
51 + olsr_delete_neighbor_table(&tmp_link_set->neighbor->neighbor_main_addr);
53 + tmp_link_set->neighbor->linkcount--;
55 + changes_neighborhood = OLSR_TRUE;
58 + tmp_link_set = link_set;
63 + last_link_entry = tmp_link_set;
64 + tmp_link_set = tmp_link_set->next;
71 *Nothing mysterious here.
72 *Adding a new link entry to the link set.
74 diff -Nur olsrd-0.4.10.orig/src/link_set.h olsrd-0.4.10/src/link_set.h
75 --- olsrd-0.4.10.orig/src/link_set.h 2005-10-23 22:58:14.000000000 +0200
76 +++ olsrd-0.4.10/src/link_set.h 2006-12-01 09:06:22.000000000 +0100
79 olsr_init_link_set(void);
82 +del_if_link_entries(union olsr_ip_addr *);
85 get_best_link_to_neighbor(union olsr_ip_addr *);
87 diff -Nur olsrd-0.4.10.orig/src/linux/kernel_routes.c olsrd-0.4.10/src/linux/kernel_routes.c
88 --- olsrd-0.4.10.orig/src/linux/kernel_routes.c 2005-02-27 19:39:43.000000000 +0100
89 +++ olsrd-0.4.10/src/linux/kernel_routes.c 2006-12-01 09:06:22.000000000 +0100
91 inet_ntop(AF_INET, &destination->rt_mask.v4, mask_str, 16);
92 inet_ntop(AF_INET, &destination->rt_router.v4, router_str, 16);
94 - OLSR_PRINTF(1, "(ioctl)Deleting route with metric %d to %s/%s via %s/%s.\n",
95 - destination->rt_metric, dst_str, mask_str, router_str,
96 - destination->rt_if->int_name)
97 + OLSR_PRINTF(1, "(ioctl)Deleting route with metric %d to %s/%s via %s.\n",
98 + destination->rt_metric, dst_str, mask_str, router_str)
100 memset(&kernel_route,0,sizeof(struct rtentry));
102 diff -Nur olsrd-0.4.10.orig/src/lq_packet.c olsrd-0.4.10/src/lq_packet.c
103 --- olsrd-0.4.10.orig/src/lq_packet.c 2006-12-01 09:04:56.000000000 +0100
104 +++ olsrd-0.4.10/src/lq_packet.c 2006-12-01 09:06:22.000000000 +0100
107 link = get_best_link_to_neighbor(&neigh->main);
109 - neigh->link_quality = link->loss_link_quality;
110 - neigh->neigh_link_quality = link->neigh_link_quality;
112 + neigh->link_quality = link->loss_link_quality;
113 + neigh->neigh_link_quality = link->neigh_link_quality;
116 // queue the neighbour entry
118 diff -Nur olsrd-0.4.10.orig/src/unix/ifnet.c olsrd-0.4.10/src/unix/ifnet.c
119 --- olsrd-0.4.10.orig/src/unix/ifnet.c 2006-12-01 09:04:56.000000000 +0100
120 +++ olsrd-0.4.10/src/unix/ifnet.c 2006-12-01 09:06:22.000000000 +0100
122 #include "mantissa.h"
123 #include "lq_packet.h"
125 +#include "link_set.h"
127 #include <sys/types.h>
130 OLSR_PRINTF(1, "Removing interface %s\n", iface->name)
131 olsr_syslog(OLSR_LOG_INFO, "Removing interface %s\n", iface->name);
133 + del_if_link_entries(&ifp->ip_addr);
136 *Call possible ifchange functions registered by plugins