From nobody Mon Mar 20 14:14:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PgGvT2k17z3ymlM; Mon, 20 Mar 2023 14:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PgGvT2BTsz3kjG; Mon, 20 Mar 2023 14:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679321669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EZdJMZWkKV2D8XVUi5AmDYhze8cDfLJIO01OJHhrVyY=; b=v/FfgZBxoIsDLMtzs0rU8B5dSo55LCB6dcY9cWUEs+PlvpzS4en2J4iWiB0sCBnkJ9XPTa eD3BIFDhuKMBu4jJPOnR/9gUqRK1Icl4ol/FEj5iorpVcXpRSTCRBAXDJ1OPo0imjFtUoH zrdlUec9WRoUYiN6G0ixbej7VbnWEKhExbEXgwGb/rGy5IlD7yqt/odl4Q0zXlucWF54UP DmFy0MPCX93fIuMrXe0KmsP7hdxljiHY+av9lrGvaA6e9j2/KabJZDT1Zit16tvNz9s0Y6 WlQY/6AGAPlN+rsfpztMA6+xj3fx0DCrsB8Z/jzekm/VQOxjhpqBdoHkEiXuXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679321669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EZdJMZWkKV2D8XVUi5AmDYhze8cDfLJIO01OJHhrVyY=; b=iQ9buy/Nsw5euYabHhNJiroqLdX3yh4qq0g123Xl3ntnTOfVyy/mVT1ccsIo1HwkWxe3ds Oqdv0KjzqukkerClWeUbA/gT4ZOBIvXAKduBMGQAePJ57x0cK0Opfge80GdCNPOxbO9Lzf atMJrjh88X1dlLWv35MRprg8bnL0SkNWQRW9k6MGH9fckVMRSdNSDm3OwfNHrxsDZR0wqm OukCnv6FNujogPc6ofJJPPB4/W+j6KmoIDKYVRhA9sQrKNLURrgEpBNUSLsFCuuXviAf2S OjKo8tmylTcOoE8Osa4wFhbrKjtW2kOJjQSGfYYHSLYNQojPYOQWRxq+lkWQmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679321669; a=rsa-sha256; cv=none; b=d22aJf5pFKAYyQ6k4XHOnNM7hfnrIFPr09mqJNlzDTGEIvx5ALTn8yvrhCIvwPf3zoC6J/ +6Qi8ZLdhXUtQb5noV0kxwz/5J0femI2AYxSpEFf3HBP+eHfBxdFkj43UHLQ8a7zlGvLdu FGuIjRSvPU9TrMrtlp7TL6RI8hO38PID1NugnjBDH3FoPUmfA7d9Ud4qZG8hqgu/ZSlr+t 8DEoMjoO5hVbuOIgqM/l2nDy7wgFIlxObJzOjSCGmOc6pZ5Emq+acIKHklebd+Uo++ghvQ GK9yVk2xcploANmErL0PpGTPFHzRHKcoafSu3O69IUMf4NuHepi5sQEpJ4CqZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PgGvT0nlVzYQK; Mon, 20 Mar 2023 14:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32KEETxZ039893; Mon, 20 Mar 2023 14:14:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32KEETbc039892; Mon, 20 Mar 2023 14:14:29 GMT (envelope-from git) Date: Mon, 20 Mar 2023 14:14:29 GMT Message-Id: <202303201414.32KEETbc039892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 511a6d5ed34b - main - carp: use if_name() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 511a6d5ed34bf3dd335ebb0ce32a7e2276e9813d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=511a6d5ed34bf3dd335ebb0ce32a7e2276e9813d commit 511a6d5ed34bf3dd335ebb0ce32a7e2276e9813d Author: Kristof Provost AuthorDate: 2023-03-20 09:22:39 +0000 Commit: Kristof Provost CommitDate: 2023-03-20 13:37:10 +0000 carp: use if_name() Reported by: melifaro Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netinet/ip_carp.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 2219e00140b1..a4ed121aeeb2 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -510,7 +510,7 @@ carp_input(struct mbuf **mp, int *offp, int proto) CARPSTATS_INC(carps_badlen); CARP_DEBUG("%s: received len %zd < sizeof(struct carp_header) " "on %s\n", __func__, m->m_len - sizeof(struct ip), - m->m_pkthdr.rcvif->if_xname); + if_name(m->m_pkthdr.rcvif)); m_freem(m); return (IPPROTO_DONE); } @@ -534,7 +534,7 @@ carp_input(struct mbuf **mp, int *offp, int proto) CARPSTATS_INC(carps_badlen); CARP_DEBUG("%s: packet too short %d on %s\n", __func__, m->m_pkthdr.len, - m->m_pkthdr.rcvif->if_xname); + if_name(m->m_pkthdr.rcvif)); m_freem(m); return (IPPROTO_DONE); } @@ -551,7 +551,7 @@ carp_input(struct mbuf **mp, int *offp, int proto) if (in_cksum(m, len - iplen)) { CARPSTATS_INC(carps_badsum); CARP_DEBUG("%s: checksum failed on %s\n", __func__, - m->m_pkthdr.rcvif->if_xname); + if_name(m->m_pkthdr.rcvif)); m_freem(m); return (IPPROTO_DONE); } @@ -582,7 +582,7 @@ carp6_input(struct mbuf **mp, int *offp, int proto) if (m->m_pkthdr.rcvif->if_carp == NULL) { CARPSTATS_INC(carps_badif); CARP_DEBUG("%s: packet received on non-carp interface: %s\n", - __func__, m->m_pkthdr.rcvif->if_xname); + __func__, if_name(m->m_pkthdr.rcvif)); m_freem(m); return (IPPROTO_DONE); } @@ -605,7 +605,7 @@ carp6_input(struct mbuf **mp, int *offp, int proto) if (in_cksum(m, sizeof(*ch))) { CARPSTATS_INC(carps_badsum); CARP_DEBUG("%s: checksum failed, on %s\n", __func__, - m->m_pkthdr.rcvif->if_xname); + if_name(m->m_pkthdr.rcvif)); m_freem(m); return (IPPROTO_DONE); } @@ -702,7 +702,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl) if (ifa == NULL) { if (error == ELOOP) { CARP_DEBUG("dropping looped packet on interface %s\n", - ifp->if_xname); + if_name(ifp)); CARPSTATS_INC(carps_badif); /* ??? */ } else { CARPSTATS_INC(carps_badvhid); @@ -714,7 +714,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl) /* verify the CARP version. */ if (ch->carp_version != CARP_VERSION) { CARPSTATS_INC(carps_badver); - CARP_DEBUG("%s: invalid version %d\n", ifp->if_xname, + CARP_DEBUG("%s: invalid version %d\n", if_name(ifp), ch->carp_version); ifa_free(ifa); m_freem(m); @@ -734,14 +734,14 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl) if (multicast && ttl != CARP_DFLTTL) { CARPSTATS_INC(carps_badttl); CARP_DEBUG("%s: received ttl %d != 255 on %s\n", __func__, - ttl, m->m_pkthdr.rcvif->if_xname); + ttl, if_name(m->m_pkthdr.rcvif)); goto out; } if (carp_hmac_verify(sc, ch->carp_counter, ch->carp_md)) { CARPSTATS_INC(carps_badauth); CARP_DEBUG("%s: incorrect hash for VHID %u@%s\n", __func__, - sc->sc_vhid, ifp->if_xname); + sc->sc_vhid, if_name(ifp)); goto out; } @@ -900,7 +900,7 @@ carp_send_ad_error(struct carp_softc *sc, int error) static const char fmt[] = "send error %d on %s"; char msg[sizeof(fmt) + IFNAMSIZ]; - sprintf(msg, fmt, error, sc->sc_carpdev->if_xname); + sprintf(msg, fmt, error, if_name(sc->sc_carpdev)); carp_demote_adj(V_carp_senderr_adj, msg); } sc->sc_sendad_success = 0; @@ -910,7 +910,7 @@ carp_send_ad_error(struct carp_softc *sc, int error) static const char fmt[] = "send ok on %s"; char msg[sizeof(fmt) + IFNAMSIZ]; - sprintf(msg, fmt, sc->sc_carpdev->if_xname); + sprintf(msg, fmt, if_name(sc->sc_carpdev)); carp_demote_adj(-V_carp_senderr_adj, msg); } sc->sc_sendad_errors = 0; @@ -1343,7 +1343,7 @@ carp_master_down_locked(struct carp_softc *sc, const char *reason) #ifdef INVARIANTS panic("carp: VHID %u@%s: master_down event in %s state\n", sc->sc_vhid, - sc->sc_carpdev->if_xname, + if_name(sc->sc_carpdev), sc->sc_state ? "MASTER" : "INIT"); #endif break; @@ -1615,7 +1615,7 @@ carp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa) break; default: printf("%s: carp is not supported for the %d interface type\n", - ifp->if_xname, ifp->if_type); + if_name(ifp), ifp->if_type); return (EOPNOTSUPP); } @@ -1725,7 +1725,7 @@ carp_alloc_if(struct ifnet *ifp) if ((error = ifpromisc(ifp, 1)) != 0) printf("%s: ifpromisc(%s) failed: %d\n", - __func__, ifp->if_xname, error); + __func__, if_name(ifp), error); else cif->cif_flags |= CIF_PROMISC; @@ -2113,7 +2113,7 @@ carp_set_state(struct carp_softc *sc, int state, const char *reason) char subsys[IFNAMSIZ+5]; snprintf(subsys, IFNAMSIZ+5, "%u@%s", sc->sc_vhid, - sc->sc_carpdev->if_xname); + if_name(sc->sc_carpdev)); CARP_LOG("%s: %s -> %s (%s)\n", subsys, carp_states[sc->sc_state], carp_states[state], reason);