Changes in uspace/lib/net/il/ip_client.c [46d4d9f:7bf12387] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/il/ip_client.c
r46d4d9f r7bf12387 124 124 125 125 // TODO IPv6 126 /* case AF_INET6: 126 #if 0 127 case AF_INET6: 127 128 if (addrlen != sizeof(struct sockaddr_in6)) 128 129 return EINVAL; … … 130 131 address_in6 = (struct sockaddr_in6 *) addr; 131 132 return EOK; 132 */ 133 #endif 133 134 134 135 default: … … 159 160 size_t padding; 160 161 161 // compute the padding if IP options are set 162 // multiple of 4 bytes 162 /* 163 * Compute the padding if IP options are set 164 * multiple of 4 bytes 165 */ 163 166 padding = ipopt_length % 4; 164 167 if (padding) { … … 167 170 } 168 171 169 / / prefix the header172 /* Prefix the header */ 170 173 data = (uint8_t *) packet_prefix(packet, sizeof(ip_header_t) + padding); 171 174 if (!data) 172 175 return ENOMEM; 173 176 174 / / add the padding177 /* Add the padding */ 175 178 while (padding--) 176 179 data[sizeof(ip_header_t) + padding] = IPOPT_NOOP; 177 180 178 / / set the header181 /* Set the header */ 179 182 header = (ip_header_t *) data; 180 header->header_length = IP_COMPUTE_HEADER_LENGTH(sizeof(ip_header_t) +181 ipopt_length);183 SET_IP_HEADER_LENGTH(header, 184 (IP_COMPUTE_HEADER_LENGTH(sizeof(ip_header_t) + ipopt_length))); 182 185 header->ttl = (ttl ? ttl : IPDEFTTL); 183 186 header->tos = tos; … … 185 188 186 189 if (dont_fragment) 187 header->flags = IPFLAG_DONT_FRAGMENT;190 SET_IP_HEADER_FLAGS(header, IPFLAG_DONT_FRAGMENT); 188 191 189 192 return EOK; … … 224 227 *tos = header->tos; 225 228 if (dont_fragment) 226 *dont_fragment = header->flags& IPFLAG_DONT_FRAGMENT;229 *dont_fragment = GET_IP_HEADER_FLAGS(header) & IPFLAG_DONT_FRAGMENT; 227 230 if (ipopt_length) { 228 231 *ipopt_length = IP_HEADER_LENGTH(header) - sizeof(ip_header_t);
Note:
See TracChangeset
for help on using the changeset viewer.