Drop RS when Option len is 0
Change-Id: I973d472da23c601eb726236687113c14b49cde0a
diff --git a/src/radv.c b/src/radv.c
index c69a43e..1a79d99 100644
--- a/src/radv.c
+++ b/src/radv.c
@@ -216,9 +216,9 @@
lease_ping_reply(&from.sin6_addr, packet, interface);
else if ((packet[0] == ND_ROUTER_SOLICIT) && (hoplimit == 255))
{
+ if (!((sz > 8) && (packet[9] == 0))) {
inet_ntop(AF_INET6, &from.sin6_addr, daemon->addrbuff, ADDRSTRLEN);
- if ((!((strncmp(daemon->addrbuff, "::",2)==0) && (packet[8] == ICMP6_OPT_SOURCE_MAC))) ||
- (!(packet[9] == 0)))
+ if (!((strncmp(daemon->addrbuff, "::",2)==0) && (packet[8] == ICMP6_OPT_SOURCE_MAC)))
{
char *mac = "";
struct dhcp_bridge *bridge, *alias;
@@ -283,6 +283,7 @@
ts.tv_nsec = tms * 1000000;
nanosleep(&ts, NULL);
}
+ }
}
}