svn commit: r186771 - user/piso/sys/netinet/libalias
Paolo Pisati
piso at FreeBSD.org
Mon Jan 5 04:58:48 PST 2009
Author: piso
Date: Mon Jan 5 12:58:43 2009
New Revision: 186771
URL: http://svn.freebsd.org/changeset/base/186771
Log:
get rid of the doxygen bits and reformat FindSctpRedirectAddress.
Modified:
user/piso/sys/netinet/libalias/alias_db.c
Modified: user/piso/sys/netinet/libalias/alias_db.c
==============================================================================
--- user/piso/sys/netinet/libalias/alias_db.c Mon Jan 5 12:39:10 2009 (r186770)
+++ user/piso/sys/netinet/libalias/alias_db.c Mon Jan 5 12:58:43 2009 (r186771)
@@ -2901,37 +2901,29 @@ LibAliasSetSkinnyPort(struct libalias *l
LIBALIAS_UNLOCK(la);
}
-/**
- * @brief Find the address to redirect incoming packets
- *
- * The function is located in alias_db.c due to calls to static functions
- *
- *
- * @param la pointer to the libalias instance
- * @param sm pointer to the incoming message
- *
- * @return address to redirect an incoming INIT to
+/*
+ * Find the address to redirect incoming packets
*/
struct in_addr
FindSctpRedirectAddress(struct libalias *la, struct sctp_nat_msg *sm)
{
- struct alias_link *lnk;
- struct in_addr redir;
+ struct alias_link *lnk;
+ struct in_addr redir;
- LIBALIAS_LOCK_ASSERT(la);
- lnk = FindLinkIn(la, sm->ip_hdr->ip_src, sm->ip_hdr->ip_dst,
- sm->sctp_hdr->dest_port,sm->sctp_hdr->dest_port, LINK_SCTP, 1);
- if (lnk != NULL) {
- return(lnk->src_addr); /* port redirect */
- } else {
- redir = FindOriginalAddress(la,sm->ip_hdr->ip_dst);
- if (redir.s_addr == la->aliasAddress.s_addr ||
- redir.s_addr == la->targetAddress.s_addr) { /* No address found */
- lnk = FindLinkIn(la, sm->ip_hdr->ip_src, sm->ip_hdr->ip_dst,
- NO_DEST_PORT, 0, LINK_SCTP, 1);
- if (lnk != NULL)
- return(lnk->src_addr); /* redirect proto */
- }
- return(redir); /* address redirect */
- }
+ LIBALIAS_LOCK_ASSERT(la);
+ lnk = FindLinkIn(la, sm->ip_hdr->ip_src, sm->ip_hdr->ip_dst,
+ sm->sctp_hdr->dest_port,sm->sctp_hdr->dest_port, LINK_SCTP, 1);
+ if (lnk != NULL) {
+ return(lnk->src_addr); /* port redirect */
+ } else {
+ redir = FindOriginalAddress(la,sm->ip_hdr->ip_dst);
+ if (redir.s_addr == la->aliasAddress.s_addr ||
+ redir.s_addr == la->targetAddress.s_addr) { /* No address found */
+ lnk = FindLinkIn(la, sm->ip_hdr->ip_src, sm->ip_hdr->ip_dst,
+ NO_DEST_PORT, 0, LINK_SCTP, 1);
+ if (lnk != NULL)
+ return(lnk->src_addr); /* redirect proto */
+ }
+ return(redir); /* address redirect */
+ }
}
More information about the svn-src-user
mailing list