Changeset 1453435 for libpacketdump


Ignore:
Timestamp:
01/06/12 16:43:16 (9 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
cb64286
Parents:
f46f7f4
Message:
  • Fixed bug where OSPF Hello packets did not support multiple neighbours
  • Updated OSPF Hello libpacketdump decoder to report all neighbours
  • Updated documentation to describe OSPF structures
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/ospf2_1.c

    re224862 r1453435  
    1010
    1111        libtrace_ospf_hello_v2_t *hello = (libtrace_ospf_hello_v2_t *)packet;
    12        
     12        struct in_addr *neigh;
     13
    1314        if (len < 4)
    1415                return;
     
    5354                return;
    5455
    55         printf(" OSPF Hello: Designated Router: %s\n", inet_ntoa(hello->designated));
     56        printf(" OSPF Hello: Designated Router %s\n", inet_ntoa(hello->designated));
    5657
    5758        if (len < 20)
    5859                return;
    5960
    60         printf(" OSPF Hello: Backup Designated Router: %s\n", inet_ntoa(hello->backup));
     61        printf(" OSPF Hello: Backup Designated Router %s\n", inet_ntoa(hello->backup));
    6162
    62         if (len < 24)
    63                 return;
    64        
    65         printf(" OSPF Hello: Neighbour: %s\n", inet_ntoa(hello->backup));
     63        neigh = (struct in_addr *)(packet + sizeof(libtrace_ospf_hello_v2_t));
     64        len -= sizeof(libtrace_ospf_hello_v2_t);
     65        while (len >= 4) {
     66                printf(" OSPF Hello: Neighbour %s\n", inet_ntoa(*neigh));
     67                neigh++;
     68                len -= sizeof(struct in_addr);
     69        }
     70
     71
    6672
    6773        return;
Note: See TracChangeset for help on using the changeset viewer.