summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/netinet
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-11-06 09:35:05 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-11-11 10:08:06 +0100
commit0a57e1db23218393483a356c07868413a45caeeb (patch)
treea2d1dd67f5b05a52b1f79f571c690ebcf299d775 /freebsd/sys/netinet
parentChange license to BSD (diff)
downloadrtems-libbsd-0a57e1db23218393483a356c07868413a45caeeb.tar.bz2
Reduce divergence from FreeBSD sources
Diffstat (limited to 'freebsd/sys/netinet')
-rw-r--r--freebsd/sys/netinet/in.c44
-rw-r--r--freebsd/sys/netinet/in_pcb.c11
-rw-r--r--freebsd/sys/netinet/ip_carp.c12
-rw-r--r--freebsd/sys/netinet/ip_mroute.c12
-rw-r--r--freebsd/sys/netinet/libalias/alias.c6
-rw-r--r--freebsd/sys/netinet/libalias/alias_cuseeme.c4
-rw-r--r--freebsd/sys/netinet/libalias/alias_db.c36
-rw-r--r--freebsd/sys/netinet/libalias/alias_dummy.c4
-rw-r--r--freebsd/sys/netinet/libalias/alias_ftp.c4
-rw-r--r--freebsd/sys/netinet/libalias/alias_irc.c28
-rw-r--r--freebsd/sys/netinet/libalias/alias_local.h2
-rw-r--r--freebsd/sys/netinet/libalias/alias_mod.c4
-rw-r--r--freebsd/sys/netinet/libalias/alias_mod.h38
-rw-r--r--freebsd/sys/netinet/libalias/alias_nbt.c4
-rw-r--r--freebsd/sys/netinet/libalias/alias_pptp.c6
-rw-r--r--freebsd/sys/netinet/libalias/alias_proxy.c4
-rw-r--r--freebsd/sys/netinet/libalias/alias_sctp.c6
-rw-r--r--freebsd/sys/netinet/libalias/alias_sctp.h21
-rw-r--r--freebsd/sys/netinet/libalias/alias_skinny.c4
-rw-r--r--freebsd/sys/netinet/libalias/alias_smedia.c4
-rw-r--r--freebsd/sys/netinet/libalias/alias_util.c4
-rw-r--r--freebsd/sys/netinet/sctp_auth.h2
-rw-r--r--freebsd/sys/netinet/sctp_output.c6
-rw-r--r--freebsd/sys/netinet/sctp_pcb.c6
-rw-r--r--freebsd/sys/netinet/tcp_input.c5
25 files changed, 139 insertions, 138 deletions
diff --git a/freebsd/sys/netinet/in.c b/freebsd/sys/netinet/in.c
index 310800cd..7bf52c6b 100644
--- a/freebsd/sys/netinet/in.c
+++ b/freebsd/sys/netinet/in.c
@@ -347,7 +347,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
iap = ifatoia(ifa);
- if (iap->ia_addr.sin_family == AF_INET) {
+ if (iap->ia_addr.sin_family == AF_INET) {
if (td != NULL &&
prison_check_ip4(td->td_ucred,
&iap->ia_addr.sin_addr) != 0)
@@ -541,13 +541,13 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
hostIsNew = 0;
}
if (ifra->ifra_mask.sin_len) {
- /*
+ /*
* QL: XXX
* Need to scrub the prefix here in case
* the issued command is SIOCAIFADDR with
* the same address, but with a different
* prefix length. And if the prefix length
- * is the same as before, then the call is
+ * is the same as before, then the call is
* un-necessarily executed here.
*/
in_ifscrub(ifp, ia, LLE_STATIC);
@@ -880,11 +880,11 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
if (ia->ia_addr.sin_family == AF_INET)
LIST_INSERT_HEAD(INADDR_HASH(
ia->ia_addr.sin_addr.s_addr), ia, ia_hash);
- else
- /*
- * If oldaddr family is not AF_INET (e.g.
- * interface has been just created) in_control
- * does not call LIST_REMOVE, and we end up
+ else
+ /*
+ * If oldaddr family is not AF_INET (e.g.
+ * interface has been just created) in_control
+ * does not call LIST_REMOVE, and we end up
* with bogus ia entries in hash
*/
LIST_REMOVE(ia, ia_hash);
@@ -966,7 +966,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
RT_ADDREF(ia_ro.ro_rt);
RTFREE_LOCKED(ia_ro.ro_rt);
} else
- error = ifa_add_loopback_route((struct ifaddr *)ia,
+ error = ifa_add_loopback_route((struct ifaddr *)ia,
(struct sockaddr *)&ia->ia_addr);
if (error == 0)
ia->ia_flags |= IFA_RTSELF;
@@ -982,10 +982,10 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
? RTF_HOST : 0)
/*
- * Generate a routing message when inserting or deleting
+ * Generate a routing message when inserting or deleting
* an interface address alias.
*/
-static void in_addralias_rtmsg(int cmd, struct in_addr *prefix,
+static void in_addralias_rtmsg(int cmd, struct in_addr *prefix,
struct in_ifaddr *target)
{
struct route pfx_ro;
@@ -1008,14 +1008,14 @@ static void in_addralias_rtmsg(int cmd, struct in_addr *prefix,
/* QL: XXX
* Point the gateway to the new interface
- * address as if a new prefix route entry has
- * been added through the new address alias.
- * All other parts of the rtentry is accurate,
+ * address as if a new prefix route entry has
+ * been added through the new address alias.
+ * All other parts of the rtentry is accurate,
* e.g., rt_key, rt_mask, rt_ifp etc.
*/
- msg_rt.rt_gateway =
+ msg_rt.rt_gateway =
(struct sockaddr *)&target->ia_addr;
- rt_newaddrmsg(cmd,
+ rt_newaddrmsg(cmd,
(struct ifaddr *)target,
0, &msg_rt);
RTFREE(pfx_ro.ro_rt);
@@ -1065,7 +1065,7 @@ in_addprefix(struct in_ifaddr *target, int flags)
*/
if (ia->ia_flags & IFA_ROUTE) {
#ifdef RADIX_MPATH
- if (ia->ia_addr.sin_addr.s_addr ==
+ if (ia->ia_addr.sin_addr.s_addr ==
target->ia_addr.sin_addr.s_addr) {
IN_IFADDR_RUNLOCK();
return (EEXIST);
@@ -1383,7 +1383,7 @@ in_lltable_free(struct lltable *llt, struct llentry *lle)
(((ntohl((d)->sin_addr.s_addr) ^ (a)->sin_addr.s_addr) & (m)->sin_addr.s_addr)) == 0 )
static void
-in_lltable_prefix_free(struct lltable *llt,
+in_lltable_prefix_free(struct lltable *llt,
const struct sockaddr *prefix,
const struct sockaddr *mask,
u_int flags)
@@ -1521,7 +1521,7 @@ in_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3add
if (lle == NULL) {
#ifdef DIAGNOSTIC
if (flags & LLE_DELETE)
- log(LOG_INFO, "interface address is missing from cache = %p in delete\n", lle);
+ log(LOG_INFO, "interface address is missing from cache = %p in delete\n", lle);
#endif
if (!(flags & LLE_CREATE))
return (NULL);
@@ -1554,11 +1554,11 @@ in_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3add
lle->la_flags = LLE_DELETED;
LLE_WUNLOCK(lle);
#ifdef DIAGNOSTIC
- log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle);
+ log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle);
#endif
}
lle = (void *)-1;
-
+
}
if (LLE_IS_VALID(lle)) {
if (flags & LLE_EXCLUSIVE)
@@ -1590,7 +1590,7 @@ in_lltable_dump(struct lltable *llt, struct sysctl_req *wr)
for (i = 0; i < LLTBL_HASHTBL_SIZE; i++) {
LIST_FOREACH(lle, &llt->lle_head[i], lle_next) {
struct sockaddr_dl *sdl;
-
+
/* skip deleted entries */
if ((lle->la_flags & LLE_DELETED) == LLE_DELETED)
continue;
diff --git a/freebsd/sys/netinet/in_pcb.c b/freebsd/sys/netinet/in_pcb.c
index c6f4c6f7..2b50ae8f 100644
--- a/freebsd/sys/netinet/in_pcb.c
+++ b/freebsd/sys/netinet/in_pcb.c
@@ -471,12 +471,12 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp,
sin->sin_port = 0; /* yech... */
bzero(&sin->sin_zero, sizeof(sin->sin_zero));
/*
- * Is the address a local IP address?
+ * Is the address a local IP address?
* If INP_BINDANY is set, then the socket may be bound
* to any endpoint address, local or not.
*/
if ((inp->inp_flags & INP_BINDANY) == 0 &&
- ifa_ifwithaddr_check((struct sockaddr *)sin) == 0)
+ ifa_ifwithaddr_check((struct sockaddr *)sin) == 0)
return (EADDRNOTAVAIL);
}
laddr = sin->sin_addr;
@@ -645,7 +645,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr,
/*
* If we found a route, use the address corresponding to
* the outgoing interface.
- *
+ *
* Otherwise assume faddr is reachable on a directly connected
* network and try to find a corresponding interface to take
* the source address from.
@@ -1191,8 +1191,9 @@ in_getpeeraddr(struct socket *so, struct sockaddr **nam)
*nam = in_sockaddr(port, &addr);
return 0;
}
-
-void in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr faddr, int errno,
+
+void
+in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr faddr, int errno,
struct inpcb *(*notify)(struct inpcb *, int))
{
struct inpcb *inp, *inp_temp;
diff --git a/freebsd/sys/netinet/ip_carp.c b/freebsd/sys/netinet/ip_carp.c
index aaed21de..a08c3fb8 100644
--- a/freebsd/sys/netinet/ip_carp.c
+++ b/freebsd/sys/netinet/ip_carp.c
@@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sockio.h>
#include <sys/socket.h>
-#ifndef __rtems__
#include <sys/vnode.h>
-#endif
#include <machine/stdarg.h>
@@ -134,7 +132,7 @@ struct carp_softc {
struct callout sc_ad_tmo; /* advertisement timeout */
struct callout sc_md_tmo; /* master down timeout */
struct callout sc_md6_tmo; /* master down timeout */
-
+
LIST_ENTRY(carp_softc) sc_next; /* Interface clue */
};
#define SC2IFP(sc) ((sc)->sc_ifp)
@@ -400,7 +398,7 @@ carp_clone_create(struct if_clone *ifc, int unit, caddr_t params)
free(sc, M_CARP);
return (ENOSPC);
}
-
+
sc->sc_flags_backup = 0;
sc->sc_suppress = 0;
sc->sc_advbase = CARP_DFLTINTV;
@@ -426,7 +424,7 @@ carp_clone_create(struct if_clone *ifc, int unit, caddr_t params)
callout_init(&sc->sc_ad_tmo, CALLOUT_MPSAFE);
callout_init(&sc->sc_md_tmo, CALLOUT_MPSAFE);
callout_init(&sc->sc_md6_tmo, CALLOUT_MPSAFE);
-
+
ifp->if_softc = sc;
if_initname(ifp, CARP_IFNAME, unit);
ifp->if_mtu = ETHERMTU;
@@ -1259,7 +1257,7 @@ carp_iamatch6(struct ifnet *ifp, struct in6_addr *taddr)
IF_ADDR_RUNLOCK(SC2IFP(vh));
}
CARP_UNLOCK(cif);
-
+
return (NULL);
}
@@ -1559,7 +1557,7 @@ carp_set_addr(struct carp_softc *sc, struct sockaddr_in *sin)
free(cif, M_CARP);
goto cleanup;
}
-
+
CARP_LOCK_INIT(cif);
CARP_LOCK(cif);
cif->vhif_ifp = ifp;
diff --git a/freebsd/sys/netinet/ip_mroute.c b/freebsd/sys/netinet/ip_mroute.c
index f35aa002..18419a74 100644
--- a/freebsd/sys/netinet/ip_mroute.c
+++ b/freebsd/sys/netinet/ip_mroute.c
@@ -652,7 +652,7 @@ if_detached_event(void *arg __unused, struct ifnet *ifp)
MROUTER_UNLOCK();
}
-
+
/*
* Enable multicast forwarding.
*/
@@ -747,7 +747,7 @@ X_ip_mrouter_done(void)
bzero((caddr_t)V_viftable, sizeof(V_viftable));
V_numvifs = 0;
V_pim_assert_enabled = 0;
-
+
VIF_UNLOCK();
callout_stop(&V_expire_upcalls_ch);
@@ -2835,7 +2835,7 @@ vnet_mroute_uninit(const void *unused __unused)
V_nexpire = NULL;
}
-VNET_SYSUNINIT(vnet_mroute_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE,
+VNET_SYSUNINIT(vnet_mroute_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE,
vnet_mroute_uninit, NULL);
static int
@@ -2846,7 +2846,7 @@ ip_mroute_modevent(module_t mod, int type, void *unused)
case MOD_LOAD:
MROUTER_LOCK_INIT();
- if_detach_event_tag = EVENTHANDLER_REGISTER(ifnet_departure_event,
+ if_detach_event_tag = EVENTHANDLER_REGISTER(ifnet_departure_event,
if_detached_event, NULL, EVENTHANDLER_PRI_ANY);
if (if_detach_event_tag == NULL) {
printf("ip_mroute: unable to ifnet_deperture_even handler\n");
@@ -2864,8 +2864,8 @@ ip_mroute_modevent(module_t mod, int type, void *unused)
printf("WARNING: %s not a power of 2; using default\n",
"net.inet.ip.mfchashsize");
mfchashsize = MFCHASHSIZE;
- }
-#endif
+ }
+#endif /* __rtems__ */
pim_squelch_wholepkt = 0;
TUNABLE_ULONG_FETCH("net.inet.pim.squelch_wholepkt",
diff --git a/freebsd/sys/netinet/libalias/alias.c b/freebsd/sys/netinet/libalias/alias.c
index 9dee1e93..09db9153 100644
--- a/freebsd/sys/netinet/libalias/alias.c
+++ b/freebsd/sys/netinet/libalias/alias.c
@@ -141,9 +141,9 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_mod.h>
#else
#include <err.h>
-#include <rtems/bsd/local/alias.h>
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias.h"
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
/*
diff --git a/freebsd/sys/netinet/libalias/alias_cuseeme.c b/freebsd/sys/netinet/libalias/alias_cuseeme.c
index a27e937f..1db9a138 100644
--- a/freebsd/sys/netinet/libalias/alias_cuseeme.c
+++ b/freebsd/sys/netinet/libalias/alias_cuseeme.c
@@ -51,8 +51,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#else
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
#define CUSEEME_PORT_NUMBER 7648
diff --git a/freebsd/sys/netinet/libalias/alias_db.c b/freebsd/sys/netinet/libalias/alias_db.c
index 3eb31b63..7385027c 100644
--- a/freebsd/sys/netinet/libalias/alias_db.c
+++ b/freebsd/sys/netinet/libalias/alias_db.c
@@ -158,21 +158,21 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <rtems/bsd/sys/errno.h>
#include <rtems/bsd/sys/time.h>
-#include <unistd.h>
+#include <unistd.h>
#endif
#include <sys/socket.h>
#include <netinet/tcp.h>
-#ifdef _KERNEL
+#ifdef _KERNEL
#include <netinet/libalias/alias.h>
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#include <net/if.h>
#else
-#include <rtems/bsd/local/alias.h>
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias.h"
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead);
@@ -465,9 +465,9 @@ SeqDiff(u_long x, u_long y)
static void
AliasLog(char *str, const char *format, ...)
-{
+{
va_list ap;
-
+
va_start(ap, format);
vsnprintf(str, LIBALIAS_BUF_SIZE, format, ap);
va_end(ap);
@@ -477,7 +477,7 @@ static void
AliasLog(FILE *stream, const char *format, ...)
{
va_list ap;
-
+
va_start(ap, format);
vfprintf(stream, format, ap);
va_end(ap);
@@ -492,12 +492,12 @@ ShowAliasStats(struct libalias *la)
LIBALIAS_LOCK_ASSERT(la);
/* Used for debugging */
if (la->logDesc) {
- int tot = la->icmpLinkCount + la->udpLinkCount +
+ int tot = la->icmpLinkCount + la->udpLinkCount +
(la->sctpLinkCount>>1) + /* sctp counts half associations */
la->tcpLinkCount + la->pptpLinkCount +
la->protoLinkCount + la->fragmentIdLinkCount +
la->fragmentPtrLinkCount;
-
+
AliasLog(la->logDesc,
"icmp=%u, udp=%u, tcp=%u, sctp=%u, pptp=%u, proto=%u, frag_id=%u frag_ptr=%u / tot=%u",
la->icmpLinkCount,
@@ -509,7 +509,7 @@ ShowAliasStats(struct libalias *la)
la->fragmentIdLinkCount,
la->fragmentPtrLinkCount, tot);
#ifndef _KERNEL
- AliasLog(la->logDesc, " (sock=%u)\n", la->sockCount);
+ AliasLog(la->logDesc, " (sock=%u)\n", la->sockCount);
#endif
}
}
@@ -1417,7 +1417,7 @@ FindFragmentIn2(struct libalias *la, struct in_addr dst_addr, /* Doesn't add a l
struct in_addr alias_addr, /* is not found. */
u_short ip_id)
{
-
+
LIBALIAS_LOCK_ASSERT(la);
return FindLinkIn(la, dst_addr, alias_addr,
NO_DEST_PORT, ip_id,
@@ -1904,7 +1904,7 @@ GetAliasAddress(struct alias_link *lnk)
struct in_addr
GetDefaultAliasAddress(struct libalias *la)
{
-
+
LIBALIAS_LOCK_ASSERT(la);
return (la->aliasAddress);
}
@@ -2064,7 +2064,7 @@ packet size was altered is searched.
// XXX ip free
void
-AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len,
+AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len,
u_long th_seq, u_int th_off)
{
/*
@@ -2117,7 +2117,7 @@ SetExpire(struct alias_link *lnk, int expire)
void
ClearCheckNewLink(struct libalias *la)
{
-
+
LIBALIAS_LOCK_ASSERT(la);
la->newDefaultLink = 0;
}
@@ -2217,11 +2217,11 @@ InitPacketAliasLog(struct libalias *la)
#ifdef _KERNEL
if ((la->logDesc = malloc(LIBALIAS_BUF_SIZE)))
;
-#else
+#else
if ((la->logDesc = fopen("/var/log/alias.log", "w")))
- fprintf(la->logDesc, "PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n");
+ fprintf(la->logDesc, "PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n");
#endif
- else
+ else
return (ENOMEM); /* log initialization failed */
la->packetAliasMode |= PKT_ALIAS_LOG;
}
diff --git a/freebsd/sys/netinet/libalias/alias_dummy.c b/freebsd/sys/netinet/libalias/alias_dummy.c
index 6298ecca..ac89d8d7 100644
--- a/freebsd/sys/netinet/libalias/alias_dummy.c
+++ b/freebsd/sys/netinet/libalias/alias_dummy.c
@@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#else
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
static void
diff --git a/freebsd/sys/netinet/libalias/alias_ftp.c b/freebsd/sys/netinet/libalias/alias_ftp.c
index d449bcfc..fbc9c564 100644
--- a/freebsd/sys/netinet/libalias/alias_ftp.c
+++ b/freebsd/sys/netinet/libalias/alias_ftp.c
@@ -95,8 +95,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#else
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
#define FTP_CONTROL_PORT_NUMBER 21
diff --git a/freebsd/sys/netinet/libalias/alias_irc.c b/freebsd/sys/netinet/libalias/alias_irc.c
index 353d3332..240c0f61 100644
--- a/freebsd/sys/netinet/libalias/alias_irc.c
+++ b/freebsd/sys/netinet/libalias/alias_irc.c
@@ -77,8 +77,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#else
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
#define IRC_CONTROL_PORT_NUMBER_1 6667
@@ -91,14 +91,14 @@ char *newpacket;
#define DBprintf(a)
static void
-AliasHandleIrcOut(struct libalias *, struct ip *, struct alias_link *,
+AliasHandleIrcOut(struct libalias *, struct ip *, struct alias_link *,
int maxpacketsize);
-static int
+static int
fingerprint(struct libalias *la, struct alias_data *ah)
{
- if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL ||
+ if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL ||
ah->maxpktsize == 0)
return (-1);
if (ntohs(*ah->dport) == IRC_CONTROL_PORT_NUMBER_1
@@ -107,7 +107,7 @@ fingerprint(struct libalias *la, struct alias_data *ah)
return (-1);
}
-static int
+static int
protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
{
@@ -120,13 +120,13 @@ protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
}
struct proto_handler handlers[] = {
- {
- .pri = 90,
- .dir = OUT,
- .proto = TCP,
- .fingerprint = &fingerprint,
+ {
+ .pri = 90,
+ .dir = OUT,
+ .proto = TCP,
+ .fingerprint = &fingerprint,
.protohandler = &protohandler
- },
+ },
{ EOH }
};
@@ -151,7 +151,7 @@ mod_handler(module_t mod, int type, void *data)
}
#ifdef _KERNEL
-static
+static
#endif
moduledata_t alias_mod = {
"alias_irc", mod_handler, NULL
@@ -441,7 +441,7 @@ lPACKET_DONE:
int delta;
SetAckModified(lnk);
- tc = (struct tcphdr *)ip_next(pip);
+ tc = (struct tcphdr *)ip_next(pip);
delta = GetDeltaSeqOut(tc->th_seq, lnk);
AddSeq(lnk, delta + copyat + iCopy - dlen, pip->ip_hl,
pip->ip_len, tc->th_seq, tc->th_off);
diff --git a/freebsd/sys/netinet/libalias/alias_local.h b/freebsd/sys/netinet/libalias/alias_local.h
index 307442cd..db58bca0 100644
--- a/freebsd/sys/netinet/libalias/alias_local.h
+++ b/freebsd/sys/netinet/libalias/alias_local.h
@@ -60,7 +60,7 @@
#include <netinet/libalias/alias_sctp.h>
#else
-#include <rtems/bsd/local/alias_sctp.h>
+#include "alias_sctp.h"
#endif
/* Sizes of input and output link tables */
diff --git a/freebsd/sys/netinet/libalias/alias_mod.c b/freebsd/sys/netinet/libalias/alias_mod.c
index daf55b82..09fa3624 100644
--- a/freebsd/sys/netinet/libalias/alias_mod.c
+++ b/freebsd/sys/netinet/libalias/alias_mod.c
@@ -49,8 +49,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#else
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
/* Protocol and userland module handlers chains. */
diff --git a/freebsd/sys/netinet/libalias/alias_mod.h b/freebsd/sys/netinet/libalias/alias_mod.h
index e9dfc724..727df8e6 100644
--- a/freebsd/sys/netinet/libalias/alias_mod.h
+++ b/freebsd/sys/netinet/libalias/alias_mod.h
@@ -57,30 +57,30 @@ MALLOC_DECLARE(M_ALIAS);
/* Protocol handlers struct & function. */
/* Packet flow direction. */
-#define IN 1
-#define OUT 2
+#define IN 1
+#define OUT 2
/* Working protocol. */
#define IP 1
#define TCP 2
#define UDP 4
-/*
+/*
* Data passed to protocol handler module, it must be filled
* right before calling find_handler() to determine which
* module is elegible to be called.
*/
-struct alias_data {
- struct alias_link *lnk;
+struct alias_data {
+ struct alias_link *lnk;
struct in_addr *oaddr; /* Original address. */
- struct in_addr *aaddr; /* Alias address. */
+ struct in_addr *aaddr; /* Alias address. */
uint16_t *aport; /* Alias port. */
uint16_t *sport, *dport; /* Source & destination port */
uint16_t maxpktsize; /* Max packet size. */
-};
+};
-/*
+/*
* This structure contains all the information necessary to make
* a protocol handler correctly work.
*/
@@ -88,29 +88,29 @@ struct alias_data {
struct proto_handler {
u_int pri; /* Handler priority. */
int16_t dir; /* Flow direction. */
- uint8_t proto; /* Working protocol. */
+ uint8_t proto; /* Working protocol. */
int (*fingerprint)(struct libalias *, /* Fingerprint * function. */
- struct alias_data *);
+ struct alias_data *);
int (*protohandler)(struct libalias *, /* Aliasing * function. */
- struct ip *, struct alias_data *);
+ struct ip *, struct alias_data *);
LIST_ENTRY(proto_handler) entries;
};
-/*
+/*
* Used only in userland when libalias needs to keep track of all
* module loaded. In kernel land (kld mode) we don't need to care
* care about libalias modules cause it's kld to do it for us.
*/
#define DLL_LEN 32
-struct dll {
+struct dll {
char name[DLL_LEN]; /* Name of module. */
- void *handle; /*
+ void *handle; /*
* Ptr to shared obj obtained through
* dlopen() - use this ptr to get access
- * to any symbols from a loaded module
- * via dlsym().
+ * to any symbols from a loaded module
+ * via dlsym().
*/
SLIST_ENTRY(dll) next;
};
@@ -122,7 +122,7 @@ void handler_chain_destroy(void);
int LibAliasAttachHandlers(struct proto_handler *);
int LibAliasDetachHandlers(struct proto_handler *);
int detach_handler(struct proto_handler *);
-int find_handler(int8_t, int8_t, struct libalias *,
+int find_handler(int8_t, int8_t, struct libalias *,
struct ip *, struct alias_data *);
struct proto_handler *first_handler(void);
@@ -137,7 +137,7 @@ struct dll *walk_dll_chain(void);
/* End of handlers. */
#define EOH -1
-/*
+/*
* Some defines borrowed from sys/module.h used to compile a kld
* in userland as a shared lib.
*/
@@ -149,7 +149,7 @@ typedef enum modeventtype {
MOD_SHUTDOWN,
MOD_QUIESCE
} modeventtype_t;
-
+
typedef struct module *module_t;
typedef int (*modeventhand_t)(module_t, int /* modeventtype_t */, void *);
diff --git a/freebsd/sys/netinet/libalias/alias_nbt.c b/freebsd/sys/netinet/libalias/alias_nbt.c
index 1add2fa3..8cbf2582 100644
--- a/freebsd/sys/netinet/libalias/alias_nbt.c
+++ b/freebsd/sys/netinet/libalias/alias_nbt.c
@@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#else
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
#define NETBIOS_NS_PORT_NUMBER 137
diff --git a/freebsd/sys/netinet/libalias/alias_pptp.c b/freebsd/sys/netinet/libalias/alias_pptp.c
index 59c7af82..60d2999e 100644
--- a/freebsd/sys/netinet/libalias/alias_pptp.c
+++ b/freebsd/sys/netinet/libalias/alias_pptp.c
@@ -61,9 +61,9 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#else
-#include <rtems/bsd/local/alias.h>
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias.h"
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
#define PPTP_CONTROL_PORT_NUMBER 1723
diff --git a/freebsd/sys/netinet/libalias/alias_proxy.c b/freebsd/sys/netinet/libalias/alias_proxy.c
index ec0a158c..e2234333 100644
--- a/freebsd/sys/netinet/libalias/alias_proxy.c
+++ b/freebsd/sys/netinet/libalias/alias_proxy.c
@@ -78,8 +78,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_mod.h>
#else
#include <arpa/inet.h>
-#include <rtems/bsd/local/alias.h> /* Public API functions for libalias */
-#include <rtems/bsd/local/alias_local.h> /* Functions used by alias*.c */
+#include "alias.h" /* Public API functions for libalias */
+#include "alias_local.h" /* Functions used by alias*.c */
#endif
/*
diff --git a/freebsd/sys/netinet/libalias/alias_sctp.c b/freebsd/sys/netinet/libalias/alias_sctp.c
index ed0279b3..c8d83878 100644
--- a/freebsd/sys/netinet/libalias/alias_sctp.c
+++ b/freebsd/sys/netinet/libalias/alias_sctp.c
@@ -85,10 +85,10 @@
#include <netinet/sctp_crc32.h>
#include <machine/in_cksum.h>
#else
-#include <rtems/bsd/local/alias_sctp.h>
+#include "alias_sctp.h"
#include <arpa/inet.h>
-#include <rtems/bsd/local/alias.h>
-#include <rtems/bsd/local/alias_local.h>
+#include "alias.h"
+#include "alias_local.h"
#include <machine/in_cksum.h>
#include <sys/libkern.h>
#endif //#ifdef _KERNEL
diff --git a/freebsd/sys/netinet/libalias/alias_sctp.h b/freebsd/sys/netinet/libalias/alias_sctp.h
index b6ad6f17..8c244b45 100644
--- a/freebsd/sys/netinet/libalias/alias_sctp.h
+++ b/freebsd/sys/netinet/libalias/alias_sctp.h
@@ -25,7 +25,7 @@
*/
/*
- * Alias_sctp forms part of the libalias kernel module to handle
+ * Alias_sctp forms part of the libalias kernel module to handle
* Network Address Translation (NAT) for the SCTP protocol.
*
* This software was developed by David A. Hayes
@@ -38,7 +38,7 @@
* proposed by Jason But and Grenville Armitage:
* http://caia.swin.edu.au/urp/sonata/
*
- *
+ *
* This project has been made possible in part by a grant from
* the Cisco University Research Program Fund at Community
* Foundation Silicon Valley.
@@ -51,7 +51,7 @@
#define _ALIAS_SCTP_H_
#include <rtems/bsd/sys/param.h>
-#ifdef _KERNEL
+#ifdef _KERNEL
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/kernel.h>
@@ -59,7 +59,7 @@
#include <sys/uio.h>
#include <sys/socketvar.h>
#include <sys/syslog.h>
-#endif // #ifdef _KERNEL
+#endif // #ifdef _KERNEL
#include <rtems/bsd/sys/types.h>
#include <sys/queue.h>
@@ -73,7 +73,7 @@
/**
* These are defined in sctp_os_bsd.h, but it can't be included due to its local file
* inclusion, so I'm defining them here.
- *
+ *
*/
#include <machine/cpufunc.h>
#include <machine/cpu.h>
@@ -165,20 +165,19 @@ union sctpChunkOfInt {
/**
* @brief SCTP message
- *
+ *
* Structure containing the relevant information from the SCTP message
*/
struct sctp_nat_msg {
uint16_t msg; /**< one of the key messages defined above */
-#ifndef __rtems__
#ifdef INET6
// struct ip6_hdr *ip_hdr; /**< pointer to ip packet header */ /*no inet6 support yet*/
+#ifdef __rtems__
+ struct ip *ip_hdr; /**< pointer to ip packet header */
+#endif /* __rtems__ */
#else
struct ip *ip_hdr; /**< pointer to ip packet header */
#endif //#ifdef INET6
-#else //__rtems__
- struct ip *ip_hdr; /**< pointer to ip packet header */
-#endif //__rtems__
struct sctphdr *sctp_hdr; /**< pointer to sctp common header */
union sctpChunkOfInt sctpchnk; /**< union of pointers to the chunk of interest */
int chunk_length; /**< length of chunk of interest */
@@ -187,7 +186,7 @@ struct sctp_nat_msg {
/**
* @brief sctp nat timer queue structure
- *
+ *
*/
struct sctp_nat_timer {
diff --git a/freebsd/sys/netinet/libalias/alias_skinny.c b/freebsd/sys/netinet/libalias/alias_skinny.c
index 47bc46c2..9f292916 100644
--- a/freebsd/sys/netinet/libalias/alias_skinny.c
+++ b/freebsd/sys/netinet/libalias/alias_skinny.c
@@ -51,8 +51,8 @@
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#else
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
static void
diff --git a/freebsd/sys/netinet/libalias/alias_smedia.c b/freebsd/sys/netinet/libalias/alias_smedia.c
index 9232568a..6c6c6aab 100644
--- a/freebsd/sys/netinet/libalias/alias_smedia.c
+++ b/freebsd/sys/netinet/libalias/alias_smedia.c
@@ -122,8 +122,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
#else
-#include <rtems/bsd/local/alias_local.h>
-#include <rtems/bsd/local/alias_mod.h>
+#include "alias_local.h"
+#include "alias_mod.h"
#endif
#define RTSP_CONTROL_PORT_NUMBER_1 554
diff --git a/freebsd/sys/netinet/libalias/alias_util.c b/freebsd/sys/netinet/libalias/alias_util.c
index 3f8b8ac3..fd9465b9 100644
--- a/freebsd/sys/netinet/libalias/alias_util.c
+++ b/freebsd/sys/netinet/libalias/alias_util.c
@@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/libalias/alias.h>
#include <netinet/libalias/alias_local.h>
#else
-#include <rtems/bsd/local/alias.h>
-#include <rtems/bsd/local/alias_local.h>
+#include "alias.h"
+#include "alias_local.h"
#endif
/*
diff --git a/freebsd/sys/netinet/sctp_auth.h b/freebsd/sys/netinet/sctp_auth.h
index a7ded047..eac89f6f 100644
--- a/freebsd/sys/netinet/sctp_auth.h
+++ b/freebsd/sys/netinet/sctp_auth.h
@@ -236,4 +236,4 @@ sctp_initialize_auth_params(struct sctp_inpcb *inp,
struct sctp_tcb *stcb);
/* test functions */
-#endif /* __SCTP_AUTH_HH__ */
+#endif /* __SCTP_AUTH_H__ */
diff --git a/freebsd/sys/netinet/sctp_output.c b/freebsd/sys/netinet/sctp_output.c
index c2c7b147..1bca9771 100644
--- a/freebsd/sys/netinet/sctp_output.c
+++ b/freebsd/sys/netinet/sctp_output.c
@@ -4840,11 +4840,11 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt,
* being equal to the beginning of the params i.e. (iphlen +
* sizeof(struct sctp_init_msg) parse through the parameters to the
* end of the mbuf verifying that all parameters are known.
- *
+ *
* For unknown parameters build and return a mbuf with
* UNRECOGNIZED_PARAMETER errors. If the flags indicate to stop
* processing this chunk stop, and set *abort_processing to 1.
- *
+ *
* By having param_offset be pre-set to where parameters begin it is
* hoped that this routine may be reused in the future by new
* features.
@@ -7754,7 +7754,7 @@ nothing_to_send:
* (when CMT is off) then it calls
* sctp_fill_outqueue for the net. This gets data on
* the send queue for that network.
- *
+ *
* In sctp_fill_outqueue TSN's are assigned and data is
* copied out of the stream buffers. Note mostly
* copy by reference (we hope).
diff --git a/freebsd/sys/netinet/sctp_pcb.c b/freebsd/sys/netinet/sctp_pcb.c
index 68eca553..47877ef1 100644
--- a/freebsd/sys/netinet/sctp_pcb.c
+++ b/freebsd/sys/netinet/sctp_pcb.c
@@ -3019,7 +3019,7 @@ continue_anyway:
* bind specific, make sure flags is off and add a new
* address structure to the sctp_addr_list inside the ep
* structure.
- *
+ *
* We will need to allocate one and insert it at the head. The
* socketopt call can just insert new addresses in there as
* well. It will also have to do the embed scope kame hack
@@ -3151,11 +3151,11 @@ sctp_iterator_inp_being_freed(struct sctp_inpcb *inp)
* from happening. But of course the iterator has a
* reference on the stcb and inp. We can mark it and it will
* stop.
- *
+ *
* If its a single iterator situation, we set the end iterator
* flag. Otherwise we set the iterator to go to the next
* inp.
- *
+ *
*/
if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) {
sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT;
diff --git a/freebsd/sys/netinet/tcp_input.c b/freebsd/sys/netinet/tcp_input.c
index 02840c89..25afbb26 100644
--- a/freebsd/sys/netinet/tcp_input.c
+++ b/freebsd/sys/netinet/tcp_input.c
@@ -540,6 +540,8 @@ tcp6_input(struct mbuf **mp, int *offp, int proto)
(caddr_t)&ip6->ip6_dst - (caddr_t)ip6);
return IPPROTO_DONE;
}
+ if (ia6)
+ ifa_free(&ia6->ia_ifa);
tcp_input(m, *offp);
return IPPROTO_DONE;
@@ -1208,7 +1210,8 @@ relocked:
rstreason = BANDLIM_RST_OPENPORT;
goto dropwithreset;
}
- ifa_free(&ia6->ia_ifa);
+ if (ia6)
+ ifa_free(&ia6->ia_ifa);
}
#endif
/*