diff options
author | Sumit Bose <sbose@redhat.com> | 2011-09-01 15:18:46 +0200 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-07-11 15:16:55 +1000 |
commit | 3dc280f5b0d84a5950cd710441b8ddfdcb87914d (patch) | |
tree | d3e571de6de89a7b406e13ee57a8f968397c3af2 /ctdb/common/system_linux.c | |
parent | 1f96f42b73f0de70b7f915b029952fa1324c6ff7 (diff) | |
download | samba-3dc280f5b0d84a5950cd710441b8ddfdcb87914d.tar.gz samba-3dc280f5b0d84a5950cd710441b8ddfdcb87914d.tar.xz samba-3dc280f5b0d84a5950cd710441b8ddfdcb87914d.zip |
IPv6 neighbor solicit cleanup
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit a81edf7eb908659a379f0cb55fd5d04551dc2c37)
Diffstat (limited to 'ctdb/common/system_linux.c')
-rw-r--r-- | ctdb/common/system_linux.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c index 9bda6d59a5..ab232f0aaf 100644 --- a/ctdb/common/system_linux.c +++ b/ctdb/common/system_linux.c @@ -75,7 +75,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface) struct ether_header *eh; struct arphdr *ah; struct ip6_hdr *ip6; - struct icmp6_hdr *icmp6; + struct nd_neighbor_solicit *nd_ns; struct ifreq if_hwaddr; unsigned char buffer[78]; /* ipv6 neigh solicitation size */ char *ptr; @@ -223,17 +223,18 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface) ip6 = (struct ip6_hdr *)(eh+1); ip6->ip6_vfc = 0x60; - ip6->ip6_plen = htons(24); + ip6->ip6_plen = htons(sizeof(*nd_ns)); ip6->ip6_nxt = IPPROTO_ICMPV6; ip6->ip6_hlim = 255; ip6->ip6_dst = addr->ip6.sin6_addr; - icmp6 = (struct icmp6_hdr *)(ip6+1); - icmp6->icmp6_type = ND_NEIGHBOR_SOLICIT; - icmp6->icmp6_code = 0; - memcpy(&icmp6->icmp6_data32[1], &addr->ip6.sin6_addr, 16); + nd_ns = (struct nd_neighbor_solicit *)(ip6+1); + nd_ns->nd_ns_type = ND_NEIGHBOR_SOLICIT; + nd_ns->nd_ns_code = 0; + nd_ns->nd_ns_reserved = 0; + nd_ns->nd_ns_target = addr->ip6.sin6_addr; - icmp6->icmp6_cksum = tcp_checksum6((uint16_t *)icmp6, ntohs(ip6->ip6_plen), ip6); + nd_ns->nd_ns_cksum = tcp_checksum6((uint16_t *)nd_ns, ntohs(ip6->ip6_plen), ip6); sall.sll_family = AF_PACKET; sall.sll_halen = 6; |