diff options
author | davem <davem> | 2002-01-23 14:06:18 +0000 |
---|---|---|
committer | davem <davem> | 2002-01-23 14:06:18 +0000 |
commit | 7215901c6f17b73c84b917ebf21c340f7b962f01 (patch) | |
tree | 687b5b7fdb20348fd4b7b72b0768ad9916d32ea5 | |
parent | b951e102c34f0cdecaedeff8893015f1817eecb7 (diff) | |
download | netdev-vger-cvs-7215901c6f17b73c84b917ebf21c340f7b962f01.tar.gz |
Forgotten ntohs on ipv6 header payload_len.
-rw-r--r-- | net/ipv6/ndisc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 08d79394c..838f7eebc 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -957,6 +957,7 @@ int ndisc_rcv(struct sk_buff *skb) struct nd_msg *msg = (struct nd_msg *) skb->h.raw; struct neighbour *neigh; struct inet6_ifaddr *ifp; + unsigned int payload_len; __skb_push(skb, skb->data-skb->h.raw); @@ -979,10 +980,11 @@ int ndisc_rcv(struct sk_buff *skb) * (Some checking in ndisc_find_option) */ + payload_len = ntohs(skb->nh.ipv6h->payload_len); switch (msg->icmph.icmp6_type) { case NDISC_NEIGHBOUR_SOLICITATION: /* XXX: import nd_neighbor_solicit from glibc netinet/icmp6.h */ - if (skb->nh.ipv6h->payload_len < 8+16) { + if (payload_len < 8+16) { if (net_ratelimit()) printk(KERN_WARNING "ICMP NS: packet too short\n"); return 0; @@ -1112,7 +1114,7 @@ int ndisc_rcv(struct sk_buff *skb) case NDISC_NEIGHBOUR_ADVERTISEMENT: /* XXX: import nd_neighbor_advert from glibc netinet/icmp6.h */ - if (skb->nh.ipv6h->payload_len < 16+8 ) { + if (payload_len < 16+8 ) { if (net_ratelimit()) printk(KERN_WARNING "ICMP NA: packet too short\n"); return 0; @@ -1174,7 +1176,7 @@ int ndisc_rcv(struct sk_buff *skb) case NDISC_ROUTER_ADVERTISEMENT: /* XXX: import nd_router_advert from glibc netinet/icmp6.h */ - if (skb->nh.ipv6h->payload_len < 8+4+4) { + if (payload_len < 8+4+4) { if (net_ratelimit()) printk(KERN_WARNING "ICMP RA: packet too short\n"); return 0; @@ -1184,7 +1186,7 @@ int ndisc_rcv(struct sk_buff *skb) case NDISC_REDIRECT: /* XXX: import nd_redirect from glibc netinet/icmp6.h */ - if (skb->nh.ipv6h->payload_len < 8+16+16) { + if (payload_len < 8+16+16) { if (net_ratelimit()) printk(KERN_WARNING "ICMP redirect: packet too short\n"); return 0; @@ -1196,7 +1198,7 @@ int ndisc_rcv(struct sk_buff *skb) /* No RS support in the kernel, but we do some required checks */ /* XXX: import nd_router_solicit from glibc netinet/icmp6.h */ - if (skb->nh.ipv6h->payload_len < 8) { + if (payload_len < 8) { if (net_ratelimit()) printk(KERN_WARNING "ICMP RS: packet too short\n"); return 0; |