From: Vitaliy Makkoveev Subject: Re: ipsecflowinfo cleanup To: Alexander Bluhm Cc: tech@openbsd.org Date: Fri, 17 Jul 2026 19:42:20 +0300 On Fri, Jul 17, 2026 at 06:07:07PM +0200, Alexander Bluhm wrote: > Hi, > > ipsecflowinfo is mixture of uint32_t, u_int32_t and int types. Use > uint32_t consistently. > > ok? > sure, ok mvs > bluhm > > Index: net/pipex.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/net/pipex.c,v > diff -u -p -r1.163 pipex.c > --- net/pipex.c 7 Jul 2026 05:39:05 -0000 1.163 > +++ net/pipex.c 17 Jul 2026 15:10:45 -0000 > @@ -1941,12 +1941,12 @@ pipex_l2tp_output(struct mbuf *m0, struc > mtx_enter(&session->pxs_mtx); > if (session->proto.l2tp.ipsecflowinfo > 0) { > if ((mtag = m_tag_get(PACKET_TAG_IPSEC_FLOWINFO, > - sizeof(u_int32_t), M_NOWAIT)) == NULL) { > + sizeof(uint32_t), M_NOWAIT)) == NULL) { > mtx_leave(&session->pxs_mtx); > goto drop; > } > > - *(u_int32_t *)(mtag + 1) = > + *(uint32_t *)(mtag + 1) = > session->proto.l2tp.ipsecflowinfo; > m_tag_prepend(m0, mtag); > } > Index: netinet/ip_input.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_input.c,v > diff -u -p -r1.431 ip_input.c > --- netinet/ip_input.c 16 Jul 2026 12:21:40 -0000 1.431 > +++ netinet/ip_input.c 17 Jul 2026 15:10:52 -0000 > @@ -1954,11 +1954,11 @@ ip_send_do_dispatch(void *xmq, int flags > > NET_LOCK_SHARED(); > while ((m = ml_dequeue(&ml)) != NULL) { > - u_int32_t ipsecflowinfo = 0; > + uint32_t ipsecflowinfo = 0; > > if ((mtag = m_tag_find(m, PACKET_TAG_IPSEC_FLOWINFO, NULL)) > != NULL) { > - ipsecflowinfo = *(u_int32_t *)(mtag + 1); > + ipsecflowinfo = *(uint32_t *)(mtag + 1); > m_tag_delete(m, mtag); > } > ip_output(m, NULL, NULL, flags, NULL, NULL, ipsecflowinfo); > Index: netinet/ip_ipsp.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_ipsp.c,v > diff -u -p -r1.281 ip_ipsp.c > --- netinet/ip_ipsp.c 8 Jul 2025 00:47:41 -0000 1.281 > +++ netinet/ip_ipsp.c 17 Jul 2026 15:23:51 -0000 > @@ -109,7 +109,7 @@ int ipsec_ids_idle = 100; /* keep free > struct pool tdb_pool; > > /* Protected by the NET_LOCK(). */ > -u_int32_t ipsec_ids_next_flow = 1; /* [F] may not be zero */ > +uint32_t ipsec_ids_next_flow = 1; /* [F] may not be zero */ > struct ipsec_ids_tree ipsec_ids_tree; /* [F] */ > struct ipsec_ids_flows ipsec_ids_flows; /* [F] */ > struct ipsec_policy_head ipsec_policy_head = > @@ -1235,7 +1235,7 @@ struct ipsec_ids * > ipsp_ids_insert(struct ipsec_ids *ids) > { > struct ipsec_ids *found; > - u_int32_t start_flow; > + uint32_t start_flow; > > mtx_enter(&ipsec_flows_mtx); > > @@ -1276,7 +1276,7 @@ ipsp_ids_insert(struct ipsec_ids *ids) > } > > struct ipsec_ids * > -ipsp_ids_lookup(u_int32_t ipsecflowinfo) > +ipsp_ids_lookup(uint32_t ipsecflowinfo) > { > struct ipsec_ids key; > struct ipsec_ids *ids; > Index: netinet/ip_ipsp.h > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_ipsp.h,v > diff -u -p -r1.249 ip_ipsp.h > --- netinet/ip_ipsp.h 9 May 2025 19:53:41 -0000 1.249 > +++ netinet/ip_ipsp.h 17 Jul 2026 15:24:21 -0000 > @@ -248,7 +248,7 @@ struct ipsec_ids { > RBT_ENTRY(ipsec_ids) id_node_flow; /* [F] */ > struct ipsec_id *id_local; /* [I] */ > struct ipsec_id *id_remote; /* [I] */ > - u_int32_t id_flow; /* [I] */ > + uint32_t id_flow; /* [I] */ > u_int id_refcount; /* [F] */ > u_int id_gc_ttl; /* [F] */ > }; > @@ -711,7 +711,7 @@ int ipsp_aux_match(struct tdb *, struct > struct sockaddr_encap *, struct sockaddr_encap *); > int ipsp_ids_match(struct ipsec_ids *, struct ipsec_ids *); > struct ipsec_ids *ipsp_ids_insert(struct ipsec_ids *); > -struct ipsec_ids *ipsp_ids_lookup(u_int32_t); > +struct ipsec_ids *ipsp_ids_lookup(uint32_t); > void ipsp_ids_free(struct ipsec_ids *); > > void ipsp_init(void); > Index: netinet/ip_output.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_output.c,v > diff -u -p -r1.418 ip_output.c > --- netinet/ip_output.c 16 Jul 2026 12:21:40 -0000 1.418 > +++ netinet/ip_output.c 17 Jul 2026 15:11:46 -0000 > @@ -83,7 +83,7 @@ static u_int16_t in_cksum_phdr(u_int32_t > void in_delayed_cksum(struct mbuf *); > > int ip_output_ipsec_lookup(struct mbuf *m, int hlen, > - const struct ipsec_level *seclevel, struct tdb **, int ipsecflowinfo); > + const struct ipsec_level *seclevel, struct tdb **, uint32_t ipsecflowinfo); > void ip_output_ipsec_pmtu_update(struct tdb *, struct route *, struct in_addr, > int); > int ip_output_ipsec_send(struct tdb *, struct mbuf *, struct route *, u_int, > @@ -98,7 +98,7 @@ int ip_output_ipsec_send(struct tdb *, s > int > ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, > struct ip_moptions *imo, const struct ipsec_level *seclevel, > - u_int32_t ipsecflowinfo) > + uint32_t ipsecflowinfo) > { > struct ip *ip; > struct ifnet *ifp = NULL; > @@ -501,7 +501,8 @@ bad: > #ifdef IPSEC > int > ip_output_ipsec_lookup(struct mbuf *m, int hlen, > - const struct ipsec_level *seclevel, struct tdb **tdbout, int ipsecflowinfo) > + const struct ipsec_level *seclevel, struct tdb **tdbout, > + uint32_t ipsecflowinfo) > { > struct m_tag *mtag; > struct tdb_ident *tdbi; > Index: netinet/ip_var.h > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_var.h,v > diff -u -p -r1.125 ip_var.h > --- netinet/ip_var.h 16 Jul 2026 12:21:40 -0000 1.125 > +++ netinet/ip_var.h 17 Jul 2026 15:14:17 -0000 > @@ -251,7 +251,7 @@ int ip_mrouter_active(u_int); > int ip_mforward(struct mbuf *, struct ifnet *, int); > int ip_optcopy(struct ip *, struct ip *); > int ip_output(struct mbuf *, struct mbuf *, struct route *, int, > - struct ip_moptions *, const struct ipsec_level *, u_int32_t); > + struct ip_moptions *, const struct ipsec_level *, uint32_t); > void ip_randomid_init(void); > u_int16_t > ip_randomid(void); > Index: netinet/udp_usrreq.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/udp_usrreq.c,v > diff -u -p -r1.350 udp_usrreq.c > --- netinet/udp_usrreq.c 24 Oct 2025 15:09:56 -0000 1.350 > +++ netinet/udp_usrreq.c 17 Jul 2026 15:20:28 -0000 > @@ -171,7 +171,7 @@ struct cpumem *udpcounters; > > void udp_sbappend(struct inpcb *, struct mbuf *, struct ip *, > struct ip6_hdr *, int, struct udphdr *, struct sockaddr *, > - u_int32_t, struct netstack *); > + uint32_t, struct netstack *); > int udp_output(struct inpcb *, struct mbuf *, struct mbuf *, struct mbuf *); > void udp_notify(struct inpcb *, int); > int udp_sysctl_udpstat(void *, size_t *, void *); > @@ -209,7 +209,7 @@ udp_input(struct mbuf **mp, int *offp, i > #endif /* INET6 */ > } srcsa, dstsa; > struct ip6_hdr *ip6 = NULL; > - u_int32_t ipsecflowinfo = 0; > + uint32_t ipsecflowinfo = 0; > #ifdef IPSEC > int udpencap_port_local = atomic_load_int(&udpencap_port); > #endif /* IPSEC */ > @@ -648,7 +648,7 @@ bad: > void > udp_sbappend(struct inpcb *inp, struct mbuf *m, struct ip *ip, > struct ip6_hdr *ip6, int hlen, struct udphdr *uh, > - struct sockaddr *srcaddr, u_int32_t ipsecflowinfo, > + struct sockaddr *srcaddr, uint32_t ipsecflowinfo, > struct netstack *ns) > { > struct socket *so = inp->inp_socket; > @@ -943,7 +943,7 @@ udp_output(struct inpcb *inp, struct mbu > { > struct sockaddr_in *sin = NULL; > struct udpiphdr *ui; > - u_int32_t ipsecflowinfo = 0; > + uint32_t ipsecflowinfo = 0; > struct sockaddr_in src_sin; > int len = m->m_pkthdr.len; > struct in_addr laddr; > @@ -997,7 +997,7 @@ udp_output(struct inpcb *inp, struct mbu > cm->cmsg_len == CMSG_LEN(sizeof(ipsecflowinfo)) && > cm->cmsg_level == IPPROTO_IP && > cm->cmsg_type == IP_IPSECFLOWINFO) { > - ipsecflowinfo = *(u_int32_t *)CMSG_DATA(cm); > + ipsecflowinfo = *(uint32_t *)CMSG_DATA(cm); > } else > #endif > if (cm->cmsg_len == CMSG_LEN(sizeof(struct in_addr)) && >