[ipv6] Update the NDP cache when receiving a router advertisement
authorMatthew Iselin <matthew@theiselins.net>
Sat, 4 Jun 2011 02:20:52 +0000 (12:20 +1000)
committerMarty Connor <mdc@etherboot.org>
Thu, 21 Jul 2011 01:05:24 +0000 (21:05 -0400)
Signed-off-by: Matthew Iselin <matthew@theiselins.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
src/net/ndp.c

index 8e61ca9..4c0b537 100644 (file)
@@ -206,8 +206,17 @@ int ndp_process_radvert ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src
                rc = 0;
                }
                break;
                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;
            }
 
            offset += options->length * 8;