- case OSPF_TYPE_HELLO:
- printf("\n\tOptions [%s]",
- bittok2str(ospf6_option_values, "none",
- EXTRACT_32BITS(&op->ospf6_hello.hello_options)));
-
- TCHECK(op->ospf6_hello.hello_deadint);
- printf("\n\t Hello Timer %us, Dead Timer %us, Interface-ID %s, Priority %u",
- EXTRACT_16BITS(&op->ospf6_hello.hello_helloint),
- EXTRACT_16BITS(&op->ospf6_hello.hello_deadint),
- ipaddr_string(&op->ospf6_hello.hello_ifid),
- op->ospf6_hello.hello_priority);
-
- TCHECK(op->ospf6_hello.hello_dr);
- if (op->ospf6_hello.hello_dr != 0)
- printf("\n\t Designated Router %s",
- ipaddr_string(&op->ospf6_hello.hello_dr));
- TCHECK(op->ospf6_hello.hello_bdr);
- if (op->ospf6_hello.hello_bdr != 0)
- printf(", Backup Designated Router %s",
- ipaddr_string(&op->ospf6_hello.hello_bdr));
- if (vflag > 1) {
- printf("\n\t Neighbor List:");
- ap = op->ospf6_hello.hello_neighbor;
- while ((u_char *)ap < dataend) {
- TCHECK(*ap);
- printf("\n\t %s", ipaddr_string(ap));
+ case OSPF_TYPE_HELLO: {
+ register const struct hello6 *hellop = (const struct hello6 *)((const uint8_t *)op + OSPF6HDR_LEN);
+
+ ND_TCHECK_4(&hellop->hello_options);
+ ND_PRINT((ndo, "\n\tOptions [%s]",
+ bittok2str(ospf6_option_values, "none",
+ EXTRACT_BE_U_4(&hellop->hello_options))));
+
+ ND_TCHECK(hellop->hello_deadint);
+ ND_PRINT((ndo, "\n\t Hello Timer %us, Dead Timer %us, Interface-ID %s, Priority %u",
+ EXTRACT_BE_U_2(&hellop->hello_helloint),
+ EXTRACT_BE_U_2(&hellop->hello_deadint),
+ ipaddr_string(ndo, &hellop->hello_ifid),
+ hellop->hello_priority));
+
+ ND_TCHECK(hellop->hello_dr);
+ if (EXTRACT_BE_U_4(&hellop->hello_dr) != 0)
+ ND_PRINT((ndo, "\n\t Designated Router %s",
+ ipaddr_string(ndo, &hellop->hello_dr)));
+ ND_TCHECK(hellop->hello_bdr);
+ if (EXTRACT_BE_U_4(&hellop->hello_bdr) != 0)
+ ND_PRINT((ndo, ", Backup Designated Router %s",
+ ipaddr_string(ndo, &hellop->hello_bdr)));
+ if (ndo->ndo_vflag > 1) {
+ ND_PRINT((ndo, "\n\t Neighbor List:"));
+ ap = hellop->hello_neighbor;
+ while ((const u_char *)ap < dataend) {
+ ND_TCHECK(*ap);
+ ND_PRINT((ndo, "\n\t %s", ipaddr_string(ndo, ap)));