@@ -164,7 +164,7 @@ print_messagedump(FILE * handle, uint8_t * msg, int16_t size)
164
164
static void
165
165
print_hellomsg (FILE * handle , uint8_t * data , int16_t totsize )
166
166
{
167
- union olsr_ip_addr * haddr ;
167
+ uint8_t * haddr ;
168
168
int hellosize = totsize - ((olsr_cnf -> ip_version == AF_INET ) ? OLSR_MSGHDRSZ_IPV4 : OLSR_MSGHDRSZ_IPV6 );
169
169
170
170
fprintf (handle , " +Htime: %u ms\n" , me_to_reltime (data [2 ]));
@@ -184,10 +184,10 @@ print_hellomsg(FILE * handle, uint8_t * data, int16_t totsize)
184
184
fprintf (handle , " ++ Link: %s, Status: %s, Size: %d\n" , olsr_link_to_string (EXTRACT_LINK (hinf -> link_code )),
185
185
olsr_status_to_string (EXTRACT_STATUS (hinf -> link_code )), ntohs (hinf -> size ));
186
186
187
- for (haddr = (union olsr_ip_addr * )& hinf -> neigh_addr ; ( char * ) haddr < (char * )hinf + ntohs (hinf -> size );
188
- haddr += sizeof (haddr -> v4 )) {
187
+ for (haddr = (uint8_t * )& hinf -> neigh_addr [ 0 ]; haddr < (uint8_t * )hinf + ntohs (hinf -> size );
188
+ haddr += sizeof (struct in_addr )) {
189
189
struct ipaddr_str buf ;
190
- fprintf (handle , " ++ %s\n" , olsr_ip_to_string (& buf , haddr ));
190
+ fprintf (handle , " ++ %s\n" , olsr_ip_to_string (& buf , ( union olsr_ip_addr * ) ARM_NOWARN_ALIGN ( haddr ) ));
191
191
}
192
192
}
193
193
@@ -203,9 +203,10 @@ print_hellomsg(FILE * handle, uint8_t * data, int16_t totsize)
203
203
fprintf (handle , " ++ Link: %s, Status: %s, Size: %d\n" , olsr_link_to_string (EXTRACT_LINK (hinf6 -> link_code )),
204
204
olsr_status_to_string (EXTRACT_STATUS (hinf6 -> link_code )), ntohs (hinf6 -> size ));
205
205
206
- for (haddr = (union olsr_ip_addr * )hinf6 -> neigh_addr ; (char * )haddr < (char * )hinf6 + ntohs (hinf6 -> size ); haddr ++ ) {
206
+ for (haddr = (uint8_t * )& hinf6 -> neigh_addr [0 ]; haddr < (uint8_t * )hinf6 + ntohs (hinf6 -> size );
207
+ haddr += sizeof (struct in6_addr )) {
207
208
struct ipaddr_str buf ;
208
- fprintf (handle , " ++ %s\n" , olsr_ip_to_string (& buf , haddr ));
209
+ fprintf (handle , " ++ %s\n" , olsr_ip_to_string (& buf , ( union olsr_ip_addr * ) ARM_NOWARN_ALIGN ( haddr ) ));
209
210
}
210
211
}
211
212
@@ -216,7 +217,7 @@ print_hellomsg(FILE * handle, uint8_t * data, int16_t totsize)
216
217
static void
217
218
print_hellomsg_lq (FILE * handle , uint8_t * data , int16_t totsize )
218
219
{
219
- union olsr_ip_addr * haddr ;
220
+ uint8_t * haddr ;
220
221
int hellosize = totsize - ((olsr_cnf -> ip_version == AF_INET ) ? OLSR_MSGHDRSZ_IPV4 : OLSR_MSGHDRSZ_IPV6 );
221
222
222
223
fprintf (handle , " +Htime: %u ms\n" , me_to_reltime (data [2 ]));
@@ -236,11 +237,11 @@ print_hellomsg_lq(FILE * handle, uint8_t * data, int16_t totsize)
236
237
fprintf (handle , " ++ Link: %s, Status: %s, Size: %d\n" , olsr_link_to_string (EXTRACT_LINK (hinf -> link_code )),
237
238
olsr_status_to_string (EXTRACT_STATUS (hinf -> link_code )), ntohs (hinf -> size ));
238
239
239
- for (haddr = (union olsr_ip_addr * )& hinf -> neigh_addr ; ( char * ) haddr < (char * )hinf + ntohs (hinf -> size );
240
- haddr += sizeof (haddr -> v4 ) ) {
240
+ for (haddr = (uint8_t * )& hinf -> neigh_addr [ 0 ]; haddr < (uint8_t * )hinf + ntohs (hinf -> size );
241
+ haddr += sizeof (struct in_addr ) + active_lq_handler -> hello_lqdata_size ) {
241
242
struct ipaddr_str buf ;
242
- uint8_t * quality = ( uint8_t * ) haddr + olsr_cnf -> ipsize ;
243
- fprintf (handle , " ++ %s\n" , olsr_ip_to_string (& buf , haddr ));
243
+ uint8_t * quality = haddr + olsr_cnf -> ipsize ;
244
+ fprintf (handle , " ++ %s\n" , olsr_ip_to_string (& buf , ( union olsr_ip_addr * ) ARM_NOWARN_ALIGN ( haddr ) ));
244
245
fprintf (handle , " ++ LQ = %d, RLQ = %d\n" , quality [0 ], quality [1 ]);
245
246
}
246
247
}
@@ -257,10 +258,11 @@ print_hellomsg_lq(FILE * handle, uint8_t * data, int16_t totsize)
257
258
fprintf (handle , " ++ Link: %s, Status: %s, Size: %d\n" , olsr_link_to_string (EXTRACT_LINK (hinf6 -> link_code )),
258
259
olsr_status_to_string (EXTRACT_STATUS (hinf6 -> link_code )), ntohs (hinf6 -> size ));
259
260
260
- for (haddr = (union olsr_ip_addr * )hinf6 -> neigh_addr ; (char * )haddr < (char * )hinf6 + ntohs (hinf6 -> size ) + 4 ; haddr ++ ) {
261
+ for (haddr = (uint8_t * )& hinf6 -> neigh_addr [0 ]; haddr < (uint8_t * )hinf6 + ntohs (hinf6 -> size );
262
+ haddr += sizeof (struct in6_addr ) + active_lq_handler -> hello_lqdata_size ) {
261
263
struct ipaddr_str buf ;
262
- uint8_t * quality = ( uint8_t * ) haddr + olsr_cnf -> ipsize ;
263
- fprintf (handle , " ++ %s\n" , olsr_ip_to_string (& buf , haddr ));
264
+ uint8_t * quality = haddr + olsr_cnf -> ipsize ;
265
+ fprintf (handle , " ++ %s\n" , olsr_ip_to_string (& buf , ( union olsr_ip_addr * ) ARM_NOWARN_ALIGN ( haddr ) ));
264
266
fprintf (handle , " ++ LQ = %d, RLQ = %d\n" , quality [0 ], quality [1 ]);
265
267
}
266
268
}
0 commit comments