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