Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inetsrv/ndp.c

    r5a324d99 r1d94e21  
    3939#include <malloc.h>
    4040#include <io/log.h>
     41#include <net/socket_codes.h>
    4142#include "ntrans.h"
    4243#include "addrobj.h"
     
    4849#define NDP_REQUEST_TIMEOUT  (3 * 1000 * 1000)
    4950
     51static addr48_t solicited_node_mac =
     52    {0x33, 0x33, 0xff, 0, 0, 0};
     53
    5054static addr128_t solicited_node_ip =
    5155    {0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0};
     56
     57/** Compute solicited node MAC multicast address from target IPv6 address
     58 *
     59 * @param ip_addr  Target IPv6 address
     60 * @param mac_addr Solicited MAC address to be assigned
     61 *
     62 */
     63static void ndp_solicited_node_mac(addr128_t ip_addr, addr48_t mac_addr)
     64{
     65        memcpy(mac_addr, solicited_node_mac, 3);
     66        memcpy(mac_addr + 3, ip_addr + 13, 3);
     67}
    5268
    5369/** Compute solicited node IPv6 multicast address from target IPv6 address
     
    170186        addr128(src_addr, packet.sender_proto_addr);
    171187        addr128(ip_addr, packet.solicited_ip);
    172         addr48_solicited_node(ip_addr, packet.target_hw_addr);
     188        ndp_solicited_node_mac(ip_addr, packet.target_hw_addr);
    173189        ndp_solicited_node_ip(ip_addr, packet.target_proto_addr);
    174190       
Note: See TracChangeset for help on using the changeset viewer.