Skip to contentSkip to conversation

icmp6 fix no respond to neighbor solicit message

PATCH In review Michael Chang 2 participants 2 messages Nov 3, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 icmp6 fix no respond to neighbor solicit message

The structure size used in grub_netbuff_pull to get the pointer to option header is apparently wrong, which leads to subsequent range check failed and therefore not responding to any neighbor solicit message in my testing.

---
 grub-core/net/icmp6.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
grub-core/net/icmp6.c +1 -1
index bbc9020..796d549 100644
@@ -205,7 +205,7 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb,
 	if (ttl != 0xff)
 	  break;
 	nbh = (struct neighbour_solicit *) nb->data;
-	err = grub_netbuff_pull (nb, sizeof (struct router_adv));
+	err = grub_netbuff_pull (nb, sizeof (*nbh));
 	if (err)
 	  {
 	    grub_netbuff_free (nb);
Signature · 1 line
1.7.3.4
#1 lore raw

В Mon, 3 Nov 2014 16:27:45 +0800
Michael Chang <[email protected]> пишет:

Quoted 4 lines

The structure size used in grub_netbuff_pull to get the pointer to option header is apparently wrong, which leads to subsequent range check failed and therefore not responding to any neighbor solicit message in my testing.

pushed

Quoted 17 lines
---
 grub-core/net/icmp6.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
grub-core/net/icmp6.c +1 -1
index bbc9020..796d549 100644
@@ -205,7 +205,7 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb,
 	if (ttl != 0xff)
 	  break;
 	nbh = (struct neighbour_solicit *) nb->data;
-	err = grub_netbuff_pull (nb, sizeof (struct router_adv));
+	err = grub_netbuff_pull (nb, sizeof (*nbh));
 	if (err)
 	  {
 	    grub_netbuff_free (nb);