Changes in uspace/srv/net/inetsrv/icmpv6.c [9749e47:1d94e21] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/icmpv6.c
r9749e47 r1d94e21 40 40 #include <mem.h> 41 41 #include <stdlib.h> 42 #include < types/inetping.h>42 #include <net/socket_codes.h> 43 43 #include "icmpv6.h" 44 44 #include "icmpv6_std.h" 45 45 #include "inetsrv.h" 46 #include "inetping .h"46 #include "inetping6.h" 47 47 #include "pdu.h" 48 48 … … 58 58 59 59 addr128_t src_v6; 60 ip_ver_t src_ver= inet_addr_get(&dgram->src, NULL, &src_v6);60 uint16_t src_af = inet_addr_get(&dgram->src, NULL, &src_v6); 61 61 62 62 addr128_t dest_v6; 63 ip_ver_t dest_ver= inet_addr_get(&dgram->dest, NULL, &dest_v6);64 65 if ((src_ ver != dest_ver) || (src_ver != ip_v6))63 uint16_t dest_af = inet_addr_get(&dgram->dest, NULL, &dest_v6); 64 65 if ((src_af != dest_af) || (src_af != AF_INET6)) 66 66 return EINVAL; 67 67 … … 80 80 inet_get_srcaddr(&dgram->src, 0, &rdgram.src); 81 81 rdgram.dest = dgram->src; 82 rdgram.iplink = 0;83 82 rdgram.tos = 0; 84 83 rdgram.data = reply; … … 116 115 return EINVAL; 117 116 118 inetping_sdu_t sdu; 119 120 sdu.src = dgram->src; 121 sdu.dest = dgram->dest; 117 inetping6_sdu_t sdu; 118 119 uint16_t src_af = inet_addr_get(&dgram->src, NULL, &sdu.src); 120 uint16_t dest_af = inet_addr_get(&dgram->dest, NULL, &sdu.dest); 121 122 if ((src_af != dest_af) || (src_af != AF_INET6)) 123 return EINVAL; 122 124 123 125 icmpv6_message_t *reply = (icmpv6_message_t *) dgram->data; … … 129 131 uint16_t ident = uint16_t_be2host(reply->un.echo.ident); 130 132 131 return inetping _recv(ident, &sdu);133 return inetping6_recv(ident, &sdu); 132 134 } 133 135 … … 157 159 } 158 160 159 int icmpv6_ping_send(uint16_t ident, inetping _sdu_t *sdu)161 int icmpv6_ping_send(uint16_t ident, inetping6_sdu_t *sdu) 160 162 { 161 163 size_t rsize = sizeof(icmpv6_message_t) + sdu->size; … … 176 178 inet_dgram_t dgram; 177 179 178 dgram.src = sdu->src; 179 dgram.dest = sdu->dest; 180 dgram.iplink = 0; 180 inet_addr_set6(sdu->src, &dgram.src); 181 inet_addr_set6(sdu->dest, &dgram.dest); 181 182 dgram.tos = 0; 182 183 dgram.data = rdata; … … 185 186 icmpv6_phdr_t phdr; 186 187 187 assert(sdu->src.version == ip_v6); 188 assert(sdu->dest.version == ip_v6); 189 190 host2addr128_t_be(sdu->src.addr6, phdr.src_addr); 191 host2addr128_t_be(sdu->dest.addr6, phdr.dest_addr); 188 host2addr128_t_be(sdu->src, phdr.src_addr); 189 host2addr128_t_be(sdu->dest, phdr.dest_addr); 192 190 phdr.length = host2uint32_t_be(dgram.size); 193 191 memset(phdr.zeroes, 0, 3);
Note:
See TracChangeset
for help on using the changeset viewer.