Просмотр исходного кода

fixed DHCPv6 relay decoding

tags/v1.0.0
Pascal Gloor 5 лет назад
Родитель
Сommit
24f66455d8
1 измененных файлов: 7 добавлений и 4 удалений
  1. 7
    4
      dhcp_protect.c

+ 7
- 4
dhcp_protect.c Просмотреть файл

@@ -296,11 +296,14 @@ void dp_dhcpv6_check(dp_conf *conf, unsigned char *pkt, int pktlen, int offset,
offset += 2; // msg-type, hop-count
}

while(offset+1<pktlen) {
uint8_t code = (uint8_t)pkt[offset];
uint8_t len = (uint8_t)pkt[offset+1];
while(offset+4<=pktlen) {
uint16_t code = ntohs((uint16_t)pkt[offset]);
uint16_t len = ntohs((uint16_t)pkt[offset+2]);

offset+=2;
offset+=4;

if ( code == 9 ) // relay message
continue;

if ( code == 1 ) { // Client identifier / DUID
// make sure there's enough space

Загрузка…
Отмена
Сохранить