diff --git a/sys/netinet/libalias/alias.h b/sys/netinet/libalias/alias.h --- a/sys/netinet/libalias/alias.h +++ b/sys/netinet/libalias/alias.h @@ -120,10 +120,12 @@ int LibAliasSaveFragment(struct libalias *, void *_ptr); /* Miscellaneous functions. */ -int LibAliasCheckNewLink(struct libalias *); unsigned short LibAliasInternetChecksum(struct libalias *, unsigned short *_ptr, int _nbytes); void LibAliasSetTarget(struct libalias *, struct in_addr _target_addr); +/* never used and never worked, to be removed in FreeBSD 14 */ +int LibAliasCheckNewLink(struct libalias *); + /* Transparent proxying routines. */ int LibAliasProxyRule(struct libalias *, const char *_cmd); diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -1330,7 +1330,6 @@ goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); alias_addr = pip->ip_dst; /* Defense against mangled packets */ @@ -1461,7 +1460,6 @@ goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); /* Defense against mangled packets */ if (ntohs(pip->ip_len) > maxpacketsize diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1675,7 +1675,6 @@ lnk = FindLinkIn(la, ANY_ADDR, alias_addr, 0, 0, LINK_ADDR, 0); if (lnk == NULL) { - la->newDefaultLink = 1; if (la->targetAddress.s_addr == INADDR_ANY) return (alias_addr); else if (la->targetAddress.s_addr == INADDR_NONE) @@ -2052,13 +2051,6 @@ } } -void -ClearCheckNewLink(struct libalias *la) -{ - LIBALIAS_LOCK_ASSERT(la); - la->newDefaultLink = 0; -} - void SetProtocolFlags(struct alias_link *lnk, int pflags) { @@ -2548,15 +2540,12 @@ return (res); } +/* never used and never worked, to be removed in FreeBSD 14 */ int LibAliasCheckNewLink(struct libalias *la) { - int res; - - LIBALIAS_LOCK(la); - res = la->newDefaultLink; - LIBALIAS_UNLOCK(la); - return (res); + (void)la; + return (0); } #ifndef NO_FW_PUNCH diff --git a/sys/netinet/libalias/alias_local.h b/sys/netinet/libalias/alias_local.h --- a/sys/netinet/libalias/alias_local.h +++ b/sys/netinet/libalias/alias_local.h @@ -118,9 +118,6 @@ #else FILE *logDesc; #endif - /* Indicates if a new aliasing link has been created - * after a call to PacketAliasIn/Out(). */ - int newDefaultLink; #ifndef NO_FW_PUNCH /* File descriptor to be able to control firewall. @@ -323,7 +320,6 @@ void AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len, u_long th_seq, u_int th_off); void SetExpire (struct alias_link *_lnk, int _expire); -void ClearCheckNewLink(struct libalias *la); void SetProtocolFlags(struct alias_link *_lnk, int _pflags); int GetProtocolFlags(struct alias_link *_lnk); void SetDestCallId(struct alias_link *_lnk, u_int16_t _cid); diff --git a/sys/netinet/libalias/libalias.3 b/sys/netinet/libalias/libalias.3 --- a/sys/netinet/libalias/libalias.3 +++ b/sys/netinet/libalias/libalias.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 1, 2020 +.Dd May 31, 2021 .Dt LIBALIAS 3 .Os .Sh NAME @@ -863,16 +863,6 @@ can route packets to the machine in question. .Ed .Pp -.Ft int -.Fn LibAliasCheckNewLink "struct libalias *" -.Bd -ragged -offset indent -This function returns a non-zero value when a new aliasing link is created. -In circumstances where incoming traffic is being sequentially sent to -different local servers, this function can be used to trigger when -.Fn LibAliasSetTarget -is called to change the default target address. -.Ed -.Pp .Ft u_short .Fn LibAliasInternetChecksum "struct libalias *" "u_short *buffer" "int nbytes" .Bd -ragged -offset indent