[gPXE-devel] [PATCH 22/31] [ipv6] update the NDP cache when receiving a router advertisement

matthew at theiselins.net matthew at theiselins.net
Fri Jul 8 10:28:31 EDT 2011


From: Matthew Iselin <matthew at theiselins.net>

Signed-off-by: Matthew Iselin <matthew at theiselins.net>
---
 src/net/ndp.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/net/ndp.c b/src/net/ndp.c
index 35747dd..2781b9b 100644
--- a/src/net/ndp.c
+++ b/src/net/ndp.c
@@ -206,8 +206,17 @@ int ndp_process_radvert ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src
 	        rc = 0;
 	        }
 	        break;
-        default:
-		DBG ( "unhandled ndp option %d\n", options->type );
+	case NDP_OPTION_SOURCE_LL:
+		{
+	        struct ll_option *opt = (struct ll_option *) options;
+	        
+		/* Add entry in the neighbour cache for the router */
+		if ( ! ndp_find_entry ( &router_addr ) ) {
+			add_ndp_entry ( netdev, &router_addr, opt->address, NDP_STATE_REACHABLE );
+		}
+		
+		}
+		break;
 	    }
 	
 	    offset += options->length * 8;
-- 
1.7.2.5



More information about the gPXE-devel mailing list