Changeset 331 for EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/nd6_nbr.c
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/nd6_nbr.c
r321 r331 2 2 * TINET (TCP/IP Protocol Stack) 3 3 * 4 * Copyright (C) 2001-20 09by Dep. of Computer Science and Engineering4 * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * … … 93 93 #include <net/ppp_ipcp.h> 94 94 #include <net/net.h> 95 #include <net/net_endian.h> 95 96 #include <net/net_var.h> 96 97 #include <net/net_buf.h> … … 100 101 #include <netinet/in.h> 101 102 #include <netinet/in_var.h> 102 103 #include <netinet6/in6.h> 104 #include <netinet6/in6_var.h> 103 #include <netinet/ip.h> 104 #include <netinet/ip_var.h> 105 #include <netinet/ip_icmp.h> 106 105 107 #include <netinet6/nd6.h> 106 108 107 #include <netinet/ip6.h>108 #include <netinet/icmp6.h>109 #include <netinet6/ip6_var.h>110 111 109 #include <net/if6_var.h> 112 110 113 #ifdef SUPPORT_INET6111 #ifdef _IP6_CFG 114 112 115 113 /* … … 363 361 364 362 void 365 nd6_ns_output (T_IFNET *ifp, T_IN6_ADDR *daddr,366 T_IN6_ADDR *taddr, T_LLINFO_ND6 *ln, bool_t dad)363 nd6_ns_output (T_IFNET *ifp, const T_IN6_ADDR *daddr, 364 const T_IN6_ADDR *taddr, T_LLINFO_ND6 *ln, bool_t dad) 367 365 { 368 366 T_NEIGHBOR_SOLICIT_HDR *nsh; … … 429 427 430 428 if (saddr && in6_lookup_ifaddr(ifp, saddr)) 431 ip6h->src = *saddr;429 memcpy(&ip6h->src, saddr, sizeof(T_IN6_ADDR)); 432 430 else { 433 431 /* … … 441 439 return; 442 440 } 443 ip6h->src = ifa->addr;441 memcpy(&ip6h->src, &ifa->addr, sizeof(T_IN6_ADDR)); 444 442 } 445 443 } … … 455 453 nsh->hdr.code = 0; 456 454 nsh->hdr.data.data32 = 0; 457 nsh->target = *taddr;455 memcpy(&nsh->target, taddr, sizeof(T_IN6_ADDR)); 458 456 459 457 if (!dad && (mac = IF_SOFTC_TO_IFADDR(ifp->ic)) != NULL) { … … 699 697 700 698 void 701 nd6_na_output (T_IFNET *ifp, T_IN6_ADDR *daddr,702 T_IN6_ADDR *taddr, uint32_t flags, bool_t tlladdr)699 nd6_na_output (T_IFNET *ifp, const T_IN6_ADDR *daddr, 700 const T_IN6_ADDR *taddr, uint32_t flags, bool_t tlladdr) 703 701 { 704 702 T_NEIGHBOR_ADVERT_HDR *nah; … … 747 745 } 748 746 else 749 ip6h->dst = *daddr;747 memcpy(&ip6h->dst, daddr, sizeof(T_IN6_ADDR)); 750 748 751 749 /* … … 757 755 return; 758 756 } 759 ip6h->src = ifa->addr;760 761 762 763 764 765 nah->target = *taddr;757 memcpy(&ip6h->src, &ifa->addr, sizeof(T_IN6_ADDR)); 758 759 /* 近隣通知ヘッダを設定する。*/ 760 nah = GET_NEIGHBOR_ADVERT_HDR(output, IF_IP6_NEIGHBOR_ADVERT_HDR_OFFSET); 761 nah->hdr.type = ND_NEIGHBOR_ADVERT; 762 nah->hdr.code = 0; 763 memcpy(&nah->target, taddr, sizeof(T_IN6_ADDR)); 766 764 767 765 /* tlladdr が真ならネットワークインタフェースのアドレスを追加する。*/ … … 851 849 } 852 850 853 #endif /* of #ifdef SUPPORT_INET6*/851 #endif /* of #ifdef _IP6_CFG */
Note:
See TracChangeset
for help on using the changeset viewer.