summaryrefslogtreecommitdiffstats
path: root/src/net/ipv6.c
diff options
context:
space:
mode:
authorMichael Brown2013-10-25 14:48:18 +0200
committerMichael Brown2013-10-25 14:49:51 +0200
commitfec127cb07c05bb0497e6bf672179132b8dd5456 (patch)
treed6333b9de0c822eab3224e651db91b794aeb48d3 /src/net/ipv6.c
parent[ipv6] Support stateless address autoconfiguration (SLAAC) (diff)
downloadipxe-fec127cb07c05bb0497e6bf672179132b8dd5456.tar.gz
ipxe-fec127cb07c05bb0497e6bf672179132b8dd5456.tar.xz
ipxe-fec127cb07c05bb0497e6bf672179132b8dd5456.zip
[ipv6] Treat sin6_scope_id consistently
sin6_scope_id is never exposed outside of the local system, and so should be a native-endian quantity. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/ipv6.c')
-rw-r--r--src/net/ipv6.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net/ipv6.c b/src/net/ipv6.c
index 4cd67209..dcaad371 100644
--- a/src/net/ipv6.c
+++ b/src/net/ipv6.c
@@ -386,7 +386,7 @@ static int ipv6_tx ( struct io_buffer *iobuf,
sizeof ( iphdr->src ) );
}
if ( ( ! IN6_IS_ADDR_MULTICAST ( next_hop ) ) &&
- ( ( miniroute = ipv6_route ( ntohl ( sin6_dest->sin6_scope_id ),
+ ( ( miniroute = ipv6_route ( sin6_dest->sin6_scope_id,
&next_hop ) ) != NULL ) ) {
memcpy ( &iphdr->src, &miniroute->address,
sizeof ( iphdr->src ) );
@@ -599,12 +599,12 @@ static int ipv6_rx ( struct io_buffer *iobuf, struct net_device *netdev,
src.sin6.sin6_family = AF_INET6;
memcpy ( &src.sin6.sin6_addr, &iphdr->src,
sizeof ( src.sin6.sin6_addr ) );
- src.sin6.sin6_scope_id = htonl ( netdev->index );
+ src.sin6.sin6_scope_id = netdev->index;
memset ( &dest, 0, sizeof ( dest ) );
dest.sin6.sin6_family = AF_INET6;
memcpy ( &dest.sin6.sin6_addr, &iphdr->dest,
sizeof ( dest.sin6.sin6_addr ) );
- dest.sin6.sin6_scope_id = htonl ( netdev->index );
+ dest.sin6.sin6_scope_id = netdev->index;
iob_pull ( iobuf, hdrlen );
pshdr_csum = ipv6_pshdr_chksum ( iphdr, iob_len ( iobuf ),
next_header, TCPIP_EMPTY_CSUM );