From 914965a03a34a31d3e85709ccdbbd03963b66c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?YOSHIFUJI=20Hideaki=20/=20=E5=90=89=E8=97=A4=E8=8B=B1?= =?UTF-8?q?=E6=98=8E?= Date: Tue, 8 Jan 2013 06:47:08 +0000 Subject: [PATCH] --- yaml --- r: 351330 b: refs/heads/master c: a0376db0f234a8053100bddf26c073be79546b2b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/net/dsfield.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 21dfedf01167..0f7e3aca185e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6c40d100ce3311a44ef82c678fb46833a270c007 +refs/heads/master: a0376db0f234a8053100bddf26c073be79546b2b diff --git a/trunk/include/net/dsfield.h b/trunk/include/net/dsfield.h index 8a8d4e06900d..e1ad903a8d6a 100644 --- a/trunk/include/net/dsfield.h +++ b/trunk/include/net/dsfield.h @@ -43,11 +43,9 @@ static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask, static inline void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask, __u8 value) { - __u16 tmp; + __be16 *p = (__force __be16 *)ipv6h; - tmp = ntohs(*(__be16 *) ipv6h); - tmp = (tmp & ((mask << 4) | 0xf00f)) | (value << 4); - *(__be16 *) ipv6h = htons(tmp); + *p = (*p & htons((((u16)mask << 4) | 0xf00f))) | htons((u16)value << 4); }