···559559extern int ipv6_skip_exthdr(const struct sk_buff *, int start,560560 u8 *nexthdrp, __be16 *frag_offp);561561562562-extern int ipv6_ext_hdr(u8 nexthdr);562562+extern bool ipv6_ext_hdr(u8 nexthdr);563563564564extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);565565
+1-1
include/net/rawv6.h
···5566void raw6_icmp_error(struct sk_buff *, int nexthdr,77 u8 type, u8 code, int inner_offset, __be32);88-int raw6_local_deliver(struct sk_buff *, int);88+bool raw6_local_deliver(struct sk_buff *, int);991010extern int rawv6_rcv(struct sock *sk,1111 struct sk_buff *skb);
+12-12
net/ipv6/addrlabel.c
···129129 ip6addrlbl_free(container_of(h, struct ip6addrlbl_entry, rcu));130130}131131132132-static inline int ip6addrlbl_hold(struct ip6addrlbl_entry *p)132132+static bool ip6addrlbl_hold(struct ip6addrlbl_entry *p)133133{134134 return atomic_inc_not_zero(&p->refcnt);135135}···141141}142142143143/* Find label */144144-static int __ip6addrlbl_match(struct net *net,145145- struct ip6addrlbl_entry *p,146146- const struct in6_addr *addr,147147- int addrtype, int ifindex)144144+static bool __ip6addrlbl_match(struct net *net,145145+ const struct ip6addrlbl_entry *p,146146+ const struct in6_addr *addr,147147+ int addrtype, int ifindex)148148{149149 if (!net_eq(ip6addrlbl_net(p), net))150150- return 0;150150+ return false;151151 if (p->ifindex && p->ifindex != ifindex)152152- return 0;152152+ return false;153153 if (p->addrtype && p->addrtype != addrtype)154154- return 0;154154+ return false;155155 if (!ipv6_prefix_equal(addr, &p->prefix, p->prefixlen))156156- return 0;157157- return 1;156156+ return false;157157+ return true;158158}159159160160static struct ip6addrlbl_entry *__ipv6_addr_label(struct net *net,···456456 return err;457457}458458459459-static inline void ip6addrlbl_putmsg(struct nlmsghdr *nlh,460460- int prefixlen, int ifindex, u32 lseq)459459+static void ip6addrlbl_putmsg(struct nlmsghdr *nlh,460460+ int prefixlen, int ifindex, u32 lseq)461461{462462 struct ifaddrlblmsg *ifal = nlmsg_data(nlh);463463 ifal->ifal_family = AF_INET6;
+3-3
net/ipv6/ah6.c
···113113 __alignof__(struct scatterlist));114114}115115116116-static int zero_out_mutable_opts(struct ipv6_opt_hdr *opthdr)116116+static bool zero_out_mutable_opts(struct ipv6_opt_hdr *opthdr)117117{118118 u8 *opt = (u8 *)opthdr;119119 int len = ipv6_optlen(opthdr);···145145 len -= optlen;146146 }147147 if (len == 0)148148- return 1;148148+ return true;149149150150bad:151151- return 0;151151+ return false;152152}153153154154#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
+6-6
net/ipv6/anycast.c
···342342 * check if the interface has this anycast address343343 * called with rcu_read_lock()344344 */345345-static int ipv6_chk_acast_dev(struct net_device *dev, const struct in6_addr *addr)345345+static bool ipv6_chk_acast_dev(struct net_device *dev, const struct in6_addr *addr)346346{347347 struct inet6_dev *idev;348348 struct ifacaddr6 *aca;···356356 read_unlock_bh(&idev->lock);357357 return aca != NULL;358358 }359359- return 0;359359+ return false;360360}361361362362/*363363 * check if given interface (or any, if dev==0) has this anycast address364364 */365365-int ipv6_chk_acast_addr(struct net *net, struct net_device *dev,366366- const struct in6_addr *addr)365365+bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,366366+ const struct in6_addr *addr)367367{368368- int found = 0;368368+ bool found = false;369369370370 rcu_read_lock();371371 if (dev)···373373 else374374 for_each_netdev_rcu(net, dev)375375 if (ipv6_chk_acast_dev(dev, addr)) {376376- found = 1;376376+ found = true;377377 break;378378 }379379 rcu_read_unlock();
···9696/*9797 * Parsing tlv encoded headers.9898 *9999- * Parsing function "func" returns 1, if parsing succeed100100- * and 0, if it failed.9999+ * Parsing function "func" returns true, if parsing succeed100100+ * and false, if it failed.101101 * It MUST NOT touch skb->h.102102 */103103104104struct tlvtype_proc {105105 int type;106106- int (*func)(struct sk_buff *skb, int offset);106106+ bool (*func)(struct sk_buff *skb, int offset);107107};108108109109/*********************···112112113113/* An unknown option is detected, decide what to do */114114115115-static int ip6_tlvopt_unknown(struct sk_buff *skb, int optoff)115115+static bool ip6_tlvopt_unknown(struct sk_buff *skb, int optoff)116116{117117 switch ((skb_network_header(skb)[optoff] & 0xC0) >> 6) {118118 case 0: /* ignore */119119- return 1;119119+ return true;120120121121 case 1: /* drop packet */122122 break;···129129 break;130130 case 2: /* send ICMP PARM PROB regardless and drop packet */131131 icmpv6_param_prob(skb, ICMPV6_UNK_OPTION, optoff);132132- return 0;132132+ return false;133133 }134134135135 kfree_skb(skb);136136- return 0;136136+ return false;137137}138138139139/* Parse tlv encoded option header (hop-by-hop or destination) */140140141141-static int ip6_parse_tlv(struct tlvtype_proc *procs, struct sk_buff *skb)141141+static bool ip6_parse_tlv(const struct tlvtype_proc *procs, struct sk_buff *skb)142142{143143- struct tlvtype_proc *curr;143143+ const struct tlvtype_proc *curr;144144 const unsigned char *nh = skb_network_header(skb);145145 int off = skb_network_header_len(skb);146146 int len = (skb_transport_header(skb)[1] + 1) << 3;···186186 /* type specific length/alignment187187 checks will be performed in the188188 func(). */189189- if (curr->func(skb, off) == 0)190190- return 0;189189+ if (curr->func(skb, off) == false)190190+ return false;191191 break;192192 }193193 }194194 if (curr->type < 0) {195195 if (ip6_tlvopt_unknown(skb, off) == 0)196196- return 0;196196+ return false;197197 }198198 break;199199 }···201201 len -= optlen;202202 }203203 if (len == 0)204204- return 1;204204+ return true;205205bad:206206 kfree_skb(skb);207207- return 0;207207+ return false;208208}209209210210/*****************************···212212 *****************************/213213214214#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)215215-static int ipv6_dest_hao(struct sk_buff *skb, int optoff)215215+static bool ipv6_dest_hao(struct sk_buff *skb, int optoff)216216{217217 struct ipv6_destopt_hao *hao;218218 struct inet6_skb_parm *opt = IP6CB(skb);···266266 if (skb->tstamp.tv64 == 0)267267 __net_timestamp(skb);268268269269- return 1;269269+ return true;270270271271 discard:272272 kfree_skb(skb);273273- return 0;273273+ return false;274274}275275#endif276276277277-static struct tlvtype_proc tlvprocdestopt_lst[] = {277277+static const struct tlvtype_proc tlvprocdestopt_lst[] = {278278#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)279279 {280280 .type = IPV6_TLV_HAO,···579579580580/* Router Alert as of RFC 2711 */581581582582-static int ipv6_hop_ra(struct sk_buff *skb, int optoff)582582+static bool ipv6_hop_ra(struct sk_buff *skb, int optoff)583583{584584 const unsigned char *nh = skb_network_header(skb);585585586586 if (nh[optoff + 1] == 2) {587587 IP6CB(skb)->ra = optoff;588588- return 1;588588+ return true;589589 }590590 LIMIT_NETDEBUG(KERN_DEBUG "ipv6_hop_ra: wrong RA length %d\n",591591 nh[optoff + 1]);592592 kfree_skb(skb);593593- return 0;593593+ return false;594594}595595596596/* Jumbo payload */597597598598-static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)598598+static bool ipv6_hop_jumbo(struct sk_buff *skb, int optoff)599599{600600 const unsigned char *nh = skb_network_header(skb);601601 struct net *net = ipv6_skb_net(skb);···614614 IP6_INC_STATS_BH(net, ipv6_skb_idev(skb),615615 IPSTATS_MIB_INHDRERRORS);616616 icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);617617- return 0;617617+ return false;618618 }619619 if (ipv6_hdr(skb)->payload_len) {620620 IP6_INC_STATS_BH(net, ipv6_skb_idev(skb),621621 IPSTATS_MIB_INHDRERRORS);622622 icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff);623623- return 0;623623+ return false;624624 }625625626626 if (pkt_len > skb->len - sizeof(struct ipv6hdr)) {···632632 if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr)))633633 goto drop;634634635635- return 1;635635+ return true;636636637637drop:638638 kfree_skb(skb);639639- return 0;639639+ return false;640640}641641642642-static struct tlvtype_proc tlvprochopopt_lst[] = {642642+static const struct tlvtype_proc tlvprochopopt_lst[] = {643643 {644644 .type = IPV6_TLV_ROUTERALERT,645645 .func = ipv6_hop_ra,
+1-1
net/ipv6/exthdrs_core.c
···99 * find out if nexthdr is a well-known extension header or a protocol1010 */11111212-int ipv6_ext_hdr(u8 nexthdr)1212+bool ipv6_ext_hdr(u8 nexthdr)1313{1414 /*1515 * find out if nexthdr is an extension header or a protocol
+7-7
net/ipv6/icmp.c
···131131 * --ANK (980726)132132 */133133134134-static int is_ineligible(struct sk_buff *skb)134134+static bool is_ineligible(const struct sk_buff *skb)135135{136136 int ptr = (u8 *)(ipv6_hdr(skb) + 1) - skb->data;137137 int len = skb->len - ptr;···139139 __be16 frag_off;140140141141 if (len < 0)142142- return 1;142142+ return true;143143144144 ptr = ipv6_skip_exthdr(skb, ptr, &nexthdr, &frag_off);145145 if (ptr < 0)146146- return 0;146146+ return false;147147 if (nexthdr == IPPROTO_ICMPV6) {148148 u8 _type, *tp;149149 tp = skb_header_pointer(skb,···151151 sizeof(_type), &_type);152152 if (tp == NULL ||153153 !(*tp & ICMPV6_INFOMSG_MASK))154154- return 1;154154+ return true;155155 }156156- return 0;156156+ return false;157157}158158159159/*···208208 * highest-order two bits set to 10209209 */210210211211-static __inline__ int opt_unrec(struct sk_buff *skb, __u32 offset)211211+static bool opt_unrec(struct sk_buff *skb, __u32 offset)212212{213213 u8 _optval, *op;214214215215 offset += skb_network_offset(skb);216216 op = skb_header_pointer(skb, offset, sizeof(_optval), &_optval);217217 if (op == NULL)218218- return 1;218218+ return true;219219 return (*op & 0xC0) == 0x80;220220}221221