git: 21f2245de219 - main - if_me: Do not reuse gre(4)'s static sysctl OID number

From: R. Christian McDonald <rcm_at_FreeBSD.org>
Date: Sat, 10 Oct 2026 13:14:59 UTC
The branch main has been updated by rcm:

URL: https://cgit.FreeBSD.org/src/commit/?id=21f2245de21931cf388120d8cb464442aaa84c6f

commit 21f2245de21931cf388120d8cb464442aaa84c6f
Author:     R. Christian McDonald <rcm@FreeBSD.org>
AuthorDate: 2026-10-10 13:13:22 +0000
Commit:     R. Christian McDonald <rcm@FreeBSD.org>
CommitDate: 2026-10-10 13:13:22 +0000

    if_me: Do not reuse gre(4)'s static sysctl OID number
    
    if_me(4) registers its net.link.me node with the static OID number
    IFT_TUNNEL, the same number if_gre(4) has used for net.link.gre since
    2003, so the two tunnel drivers collide under net.link.  Until
    d35c4cfad580 that only printed a warning and left two nodes with the
    same number; since then sysctl_register_oid() panics, so loading if_me
    after if_gre (or the other way round) takes the box down:
    
      kldload if_gre
      kldload if_me
      panic: sysctl: OID number(131) is already in use for 'me'
    
    Use OID_AUTO like the other tunnel drivers.  Nothing addresses the node
    by number.
    
    Reviewed by:            ae
    MFC after:              3 days
    Sponsored by:           Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D60536
---
 sys/net/if_me.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/net/if_me.c b/sys/net/if_me.c
index b839730d2e37..9e690daab166 100644
--- a/sys/net/if_me.c
+++ b/sys/net/if_me.c
@@ -125,7 +125,7 @@ static int	me_set_tunnel(struct me_softc *, in_addr_t, in_addr_t);
 static void	me_delete_tunnel(struct me_softc *);
 
 SYSCTL_DECL(_net_link);
-static SYSCTL_NODE(_net_link, IFT_TUNNEL, me, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+static SYSCTL_NODE(_net_link, OID_AUTO, me, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
     "Minimal Encapsulation for IP (RFC 2004)");
 #ifndef MAX_ME_NEST
 #define MAX_ME_NEST 1