- bp += sizeof(u_int32_t);
- switch (EXTRACT_16BITS(bp)) {
- case AFI_IP:
- addr_size = sizeof(struct in_addr);
- nla_af = AF_INET;
+ bp += sizeof(uint32_t);
+ nla_afnum = EXTRACT_16BITS(bp);
+ bp += (2 * sizeof(uint16_t));
+ switch (nla_afnum) {
+ case AFNUM_INET:
+ if (opt_len != 12 + sizeof(struct in_addr)) {
+ ND_PRINT((ndo, "[Bad OPT_PGMCC_DATA option, length %u != 12 + address size]", opt_len));
+ return;
+ }
+ ND_TCHECK2(*bp, sizeof(struct in_addr));
+ addrtostr(bp, nla_buf, sizeof(nla_buf));
+ bp += sizeof(struct in_addr);
+ opts_len -= 12 + sizeof(struct in_addr);