diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2009-08-09 04:12:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-13 19:43:31 -0400 |
commit | e651f03afe833326faa0abe55948c1c6cfd0b8ac (patch) | |
tree | 77058921e3842568e885f23b7b6829c628a0051b /net/ipv6/ip6_output.c | |
parent | 9ec04da7489d2c9ae01ea6e9b5fa313ccf3d35fb (diff) |
inet6: Conversion from u8 to int
This replaces assignments of the type "int on LHS" = "u8 on RHS" with
simpler code. The LHS can express all of the unsigned right hand side
values, hence the assigned value can not be negative.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r-- | net/ipv6/ip6_output.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 93beee944657..6ad5aadf81ad 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -194,7 +194,8 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, | |||
194 | struct ipv6hdr *hdr; | 194 | struct ipv6hdr *hdr; |
195 | u8 proto = fl->proto; | 195 | u8 proto = fl->proto; |
196 | int seg_len = skb->len; | 196 | int seg_len = skb->len; |
197 | int hlimit, tclass; | 197 | int hlimit = -1; |
198 | int tclass = 0; | ||
198 | u32 mtu; | 199 | u32 mtu; |
199 | 200 | ||
200 | if (opt) { | 201 | if (opt) { |
@@ -237,19 +238,13 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, | |||
237 | /* | 238 | /* |
238 | * Fill in the IPv6 header | 239 | * Fill in the IPv6 header |
239 | */ | 240 | */ |
240 | 241 | if (np) { | |
241 | hlimit = -1; | 242 | tclass = np->tclass; |
242 | if (np) | ||
243 | hlimit = np->hop_limit; | 243 | hlimit = np->hop_limit; |
244 | } | ||
244 | if (hlimit < 0) | 245 | if (hlimit < 0) |
245 | hlimit = ip6_dst_hoplimit(dst); | 246 | hlimit = ip6_dst_hoplimit(dst); |
246 | 247 | ||
247 | tclass = -1; | ||
248 | if (np) | ||
249 | tclass = np->tclass; | ||
250 | if (tclass < 0) | ||
251 | tclass = 0; | ||
252 | |||
253 | *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | fl->fl6_flowlabel; | 248 | *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | fl->fl6_flowlabel; |
254 | 249 | ||
255 | hdr->payload_len = htons(seg_len); | 250 | hdr->payload_len = htons(seg_len); |